Skip to content

Commit

Permalink
tested locally and works
Browse files Browse the repository at this point in the history
  • Loading branch information
ndamania00 committed Jan 11, 2025
1 parent 5c51c9b commit f7b792e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
17 changes: 0 additions & 17 deletions liminal/entity_schemas/tag_schema_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,23 +399,6 @@ def update_schema_props(self, update_diff: dict[str, Any]) -> TagSchemaModel:
else:
self.constraint = None

if "constraint_fields" in update_diff_names:
if update_props.constraint_fields:
has_bases = False
if "bases" in update_props.constraint_fields:
has_bases = True
update_props.constraint_fields.discard("bases")
constraint_fields = [
f
for f in self.fields
if f.systemName in update_props.constraint_fields
]
self.constraint = TagSchemaConstraint.from_constraint_fields(
constraint_fields, has_bases
)
else:
self.constraint = None

self.prefix = (
update_props.prefix if "prefix" in update_diff_names else self.prefix
)
Expand Down
6 changes: 6 additions & 0 deletions liminal/orm/schema_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class SchemaProperties(BaseSchemaProperties):
The naming strategies of the schema.
mixture_schema_config : MixtureSchemaConfig | None
The mixture schema config of the schema.
use_registry_id_as_label : bool | None = None
If the schema will display the Registry ID as the main label for items
include_registry_id_in_chips : bool | None = None
If the registry ID is included in the chip for an item
constraint_fields : set[str] | None
Set of constraints of field values for the schema. Set of column names, that specify that their values must be a unique combination in their entities.
If the entity type is a Sequence, "bases" can be a constraint field.
Expand All @@ -43,6 +47,8 @@ class SchemaProperties(BaseSchemaProperties):
prefix: str
entity_type: BenchlingEntityType
naming_strategies: set[BenchlingNamingStrategy]
use_registry_id_as_label: bool | None = False
include_registry_id_in_chips: bool | None = False
mixture_schema_config: MixtureSchemaConfig | None = None
constraint_fields: set[str] | None = None
_archived: bool = False
Expand Down

0 comments on commit f7b792e

Please sign in to comment.