Model Managers and QuerySets

The following Managers and QuerySets support the various mixins and base classes provided by Djem.

CommonInfoManager

class djem.models.managers.CommonInfoManager

CommonInfoManager is a custom manager for CommonInfoMixin that simply provides access to CommonInfoQuerySet.

CommonInfoQuerySet

class djem.models.managers.CommonInfoQuerySet(*args, **kwargs)[source]

CommonInfoQuerySet provides custom functionality pertaining to the fields provided by CommonInfoMixin.

update(user=None, **kwargs)[source]

Overridden to ensure the user_modified and date_modified fields are always updated. The user argument is required and must be passed a User instance, unless the DJEM_COMMON_INFO_REQUIRE_USER_ON_SAVE setting is False.

owned_by(user)[source]

Return a queryset of records “owned” by the given user, as per the user_created field. user can be a User instance or an id.

ArchivableManager

class djem.models.managers.ArchivableManager(archived=None)[source]

ArchivableManager is a custom manager for ArchivableMixin. The constructor argument archived is a flag used to dictate the default filter applied on the is_archived field provided by ArchivableMixin. When given as None, no filter will be applied (the manager behaviour will not be altered). When given as True or False, the default queryset provided by the manager will be filtered to archived or unarchived records, respectively.

ArchivableManager provides access to ArchivableQuerySet.

ArchivableQuerySet

class djem.models.managers.ArchivableQuerySet(*args, **kwargs)[source]

ArchivableQuerySet provides custom functionality pertaining to the is_archived field provided by ArchivableMixin.

archive()[source]

Archive all records in the current queryset.

unarchive()[source]

Unarchive all records in the current queryset.

VersioningManager

class djem.models.managers.VersioningManager

VersioningManager is a custom manager for VersioningMixin that simply provides access to VersioningQuerySet.

VersioningQuerySet

class djem.models.managers.VersioningQuerySet(*args, **kwargs)[source]

VersioningQuerySet provides custom functionality pertaining to the version field provided by VersioningMixin.

update(**kwargs)[source]

Overridden to ensure the version field is always updated.