Concept model relations

These are direct reimplementations of Django model relations, at the moment they onyl exist to make permissions-based filtering easier for the GraphQL codebase. However, in future these may add additional functionality such as automatically applying certain permissions to ensure users only retrieve the right objects.

When building models that link to any subclass of _concept, use these in place of the Django builtins.


The model these are place on does not need to be a subclass of concept. They are for linking to a concept subclass.

class aristotle_mdr.fields.ConceptForeignKey(to, on_delete=None, related_name=None, related_query_name=None, limit_choices_to=None, parent_link=False, to_field=None, db_constraint=True, **kwargs)[source]

Reimplementation of ForeignKey for linking a model to a Concept

class aristotle_mdr.fields.ConceptManyToManyField(to, related_name=None, related_query_name=None, limit_choices_to=None, symmetrical=None, through=None, through_fields=None, db_constraint=True, db_table=None, swappable=True, **kwargs)[source]

Reimplementation of ManyToManyField for linking a model to a Concept

class aristotle_mdr.fields.ConceptOneToOneField(to, on_delete=None, to_field=None, **kwargs)[source]

Reimplementation of OneToOneField for linking a model to a Concept

class aristotle_mdr.fields.LowerEmailField(*args, **kwargs)[source]

Reimplementation of email field, where email is always stored lowercase