PyBIS sections order in openBIS

Hi!

I have been working on creating object types, assigning properties, and then updating them over time. I just realized there is a feature that is a bit annoying, especially when managing large masterdata.

To reproduce:

  1. Create an object type with some properties assigned inside a section
  2. Add some more properties in a different section
  3. Define a new property in the section of step 1

What I get is two separate, yet identical sections:

I am using the syntax of object_type.assign_property(..., section=...).

The issue here is visual. So I am not sure if this is an issue of pybis or the frontend, I didn’t investigate in depth.

Thanks in advance,

Jose

Hello, each property also has an “ordinal” attribute which determines in what order the properties are displayed. So if you need to insert property before other you have to change the ordinal attribute of the new property to be between the ones that already exist.

So for example when you are creating new object type you can give the properties ordinals by 10, so first one would have 10, second one 20, etc. And then you can easily insert properties between them.

Or reorder them in admin UI. But I did not found a way to modify existing properties in Python other than creating custom request to the server.

I basically had to create extension of the pybis that allows you to define entity types as classes with attributes and then automatically creates/updates them according to the changes.

Hi @deiwo ,

Perfect, that worked (with pyBIS, assign_property() has an ordinal attribute). Thanks for the quick answer.

Best,

Jose