Skip to content

Commit

Permalink
fix(groups): django group view model
Browse files Browse the repository at this point in the history
  • Loading branch information
philtweir committed Jan 20, 2025
1 parent 7fae3dc commit 77e081c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion arches_orm/arches_django/datatypes/django_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __bool__(self):
# We have to do this as we do not have a concept of an empty node
return bool(self.pk)

class MissingDjangoGroupViewModel(Group, GroupViewModelMixin):
class MissingDjangoGroupViewModel(DjangoGroupViewModel):
...

@REGISTER("django-group")
Expand Down
5 changes: 0 additions & 5 deletions arches_orm/graphql/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ def init(self):
self.definitions = {}

for _, model in orm_models.items():
print(repr(model))
model_name = model._model_name
field, info = next(iter(model.get_fields(include_root=True).items()))
self.definitions[model_name] = {
Expand All @@ -155,9 +154,7 @@ def init(self):
def _process_field(self, model_name, field, info, model, top_level=False):
typ = info["type"]
model_class_name = model.__name__
print(typ, field, "TF")
if typ == DataTypeNames.SEMANTIC:
print(info)
for subfield, subinfo in info.get("children", {}).items():
self._build_semantic(field, subfield, subinfo, model_name, model.__name__)
self._process_field(model_name, subfield, subinfo, model)
Expand Down Expand Up @@ -340,14 +337,12 @@ def to_graphene(self, info, field, model_class_name, additional_fields=None):
if additional_fields:
fields += additional_fields
semantic_schema_objects[semantic_type] = None # empty semantic fields are not useful
print(self.semantic_nodes)
if semantic_type in self.semantic_nodes:
semantic_detail = self.semantic_nodes[semantic_type]
for subfield, subinfo in semantic_detail["fields"]:
data_type = data_types.to_graphene(subinfo, subfield, semantic_detail["model_class_name"])
if data_type:
fields.append((subfield, data_type))
print(fields, "FIELDS")
if fields:
members = {
subfield: typ for subfield, typ in fields
Expand Down
1 change: 0 additions & 1 deletion tests/static/test_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ def test_can_insert_into_concept_scheme(arches_orm):
StatusEnum = rdm.get_collection("7849cd3c-3f0d-454d-aaea-db9164629641")
concept_1 = rdm.make_simple_concept("My Status", "Done")
StatusEnum = rdm.derive_collection("7849cd3c-3f0d-454d-aaea-db9164629641", include=[concept_1], exclude=[StatusEnum.BacklogDashSkeleton.value])
print(list(StatusEnum))

0 comments on commit 77e081c

Please sign in to comment.