intranet.apps.sessionmgmt package¶
Submodules¶
intranet.apps.sessionmgmt.admin module¶
- class intranet.apps.sessionmgmt.admin.TrustedSessionAdmin(model, admin_site)[source]¶
Bases:
ModelAdmin
- list_display = ('user', 'description', 'device_type', 'first_trusted_date')¶
- list_filter = ('device_type', 'description', 'first_trusted_date')¶
- search_fields = ('user__username', 'user__first_name', 'user__last_name', 'description')¶
intranet.apps.sessionmgmt.helpers module¶
intranet.apps.sessionmgmt.models module¶
- class intranet.apps.sessionmgmt.models.TrustedSession(id, description, device_type, user, session_key, first_trusted_date)[source]¶
Bases:
Model
- DEVICE_TYPES = (('mobile', 'Mobile'), ('tablet', 'Tablet'), ('computer', 'Computer'), ('unknown', 'Unknown type'))¶
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- classmethod delete_expired_sessions(*, user=None) None [source]¶
Deletes all expired trusted sessions for the given user. If
user
isNone
or not given, deletes all expired trusted sessions.- Parameters:
user – The user to delete all expired trusted sessions for, or
None
to delete all expired trusted sessions
- description¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- device_type¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- first_trusted_date¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_device_type_display(*, field=<django.db.models.fields.CharField: device_type>)¶
- get_next_by_first_trusted_date(*, field=<django.db.models.fields.DateTimeField: first_trusted_date>, is_next=True, **kwargs)¶
- get_previous_by_first_trusted_date(*, field=<django.db.models.fields.DateTimeField: first_trusted_date>, is_next=False, **kwargs)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- session_key¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- user¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- user_id¶