intranet.apps.sessionmgmt package

Submodules

intranet.apps.sessionmgmt.admin module

intranet.apps.sessionmgmt.helpers module

intranet.apps.sessionmgmt.helpers.trust_session(request)None[source]

Creates a TrustedSession object for a given request’s session, populating all the fields properly.

Parameters

request – A request from the device/session that should be trusted.

intranet.apps.sessionmgmt.models module

class intranet.apps.sessionmgmt.models.TrustedSession(id, description, device_type, user, session_key, first_trusted_date)[source]

Bases: django.db.models.base.Model

DEVICE_TYPES = (('mobile', 'Mobile'), ('tablet', 'Tablet'), ('computer', 'Computer'), ('unknown', 'Unknown type'))
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

classmethod delete_expired_sessions(*, user=None)None[source]

Deletes all expired trusted sessions for the given user. If user is None 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 a ForwardManyToOneDescriptor instance.

user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

intranet.apps.sessionmgmt.tests module

intranet.apps.sessionmgmt.urls module

intranet.apps.sessionmgmt.views module

intranet.apps.sessionmgmt.views.global_logout_view(request)[source]
intranet.apps.sessionmgmt.views.index_view(request)[source]
intranet.apps.sessionmgmt.views.revoke_session_view(request)[source]
intranet.apps.sessionmgmt.views.trust_session_view(request)[source]

Module contents