Using the ConceptManager
in Django queries¶
-
class
aristotle_mdr.managers.
ConceptManager
[source]¶ The
ConceptManager
is the default object manager forconcept
and_concept
items, and extends from the django-model-utilsInheritanceManager
.It provides access to the
ConceptQuerySet
to allow for easy permissions-based filtering of ISO 11179 Concept-based items.
-
class
aristotle_mdr.managers.
ConceptQuerySet
(*args, **kwargs)[source]¶ -
editable
(user)[source]¶ Returns a queryset that returns all items that the given user has permission to edit.
It is chainable with other querysets. For example, both of these will work and return the same list:
ObjectClass.objects.filter(name__contains="Person").editable() ObjectClass.objects.editable().filter(name__contains="Person")
-
public
()[source]¶ Returns a list of public items from the queryset.
This is a chainable query set, that filters on items which have the internal _is_public flag set to true.
Both of these examples will work and return the same list:
ObjectClass.objects.filter(name__contains="Person").public() ObjectClass.objects.public().filter(name__contains="Person")
-
visible
(user)[source]¶ Returns a queryset that returns all items that the given user has permission to view.
It is chainable with other querysets. For example, both of these will work and return the same list:
ObjectClass.objects.filter(name__contains="Person").visible() ObjectClass.objects.visible().filter(name__contains="Person")
-