intranet.apps.logs package

Submodules

intranet.apps.logs.admin module

class intranet.apps.logs.admin.MethodFilter(request, params, model, model_admin)[source]

Bases: SimpleListFilter

lookups(request, model_admin)[source]
methods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS', 'HEAD']
parameter_name = 'method'
queryset(request, queryset)[source]
title = 'method'
class intranet.apps.logs.admin.PathFilter(request, params, model, model_admin)[source]

Bases: SimpleListFilter

lookups(request, model_admin)[source]
parameter_name = 'path'
queryset(request, queryset)[source]
title = 'path'
url_paths = ['index', 'login', 'logout', 'eighth_signup', 'eighth_admin_dashboard', 'view_announcements', 'request_announcement', 'bus', 'calendar', 'user_profile', 'events', 'enrichment', 'printing', 'send_feedback', 'signage_display']
url_paths_looked_up = []
class intranet.apps.logs.admin.RequestAdmin(model, admin_site)[source]

Bases: ModelAdmin

class Media[source]

Bases: object

css = {'all': ('css/admin.css',)}
actions = ['flag_requests']
exclude = ('request',)
flag_requests(request, queryset)[source]
list_display = ('timestamp', 'ip', 'user', <function RequestAdmin.truncated_path>, 'method', 'flag')
list_filter = ('flag', 'timestamp', <class 'intranet.apps.logs.admin.MethodFilter'>, <class 'intranet.apps.logs.admin.PathFilter'>)
list_per_page = 500
readonly_fields = ('ip', 'path', 'user_agent', 'user', 'method', 'request_json')
request_json(obj)[source]
search_fields = ('user__username', 'ip', 'path', 'flag', 'method', 'user_agent', 'request')
truncated_path()[source]
class intranet.apps.logs.admin.TruncatedPathFilter(request, params, model, model_admin)[source]

Bases: SimpleListFilter

lookups(request, model_admin)[source]
parameter_name = 'path'
queryset(request, queryset)[source]
title = 'path'
class intranet.apps.logs.admin.TruncatedUserAgentFilter(request, params, model, model_admin)[source]

Bases: SimpleListFilter

lookups(request, model_admin)[source]
parameter_name = 'user_agent'
queryset(request, queryset)[source]
title = 'user agent'

intranet.apps.logs.forms module

class intranet.apps.logs.forms.FlagRequestForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: Form

declared_fields = {'_selected_action': <django.forms.fields.CharField object>, 'action': <django.forms.fields.CharField object>, 'flag': <django.forms.fields.CharField object>}

intranet.apps.logs.models module

class intranet.apps.logs.models.Request(*args, **kwargs)[source]

Bases: Model

This model is used to store access logs. It is not used by any other part of the intranet.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

flag

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

get_next_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)
get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, 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.

ip

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

method

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>
path

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

request

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

property request_json
property request_json_obj
timestamp

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_agent

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

user_id
property username

intranet.apps.logs.urls module

intranet.apps.logs.views module

intranet.apps.logs.views.logs_context(queryset, request)[source]

Module contents