reporting.users package

Submodules

reporting.users.admin module

class reporting.users.admin.DeveloperNodeAdmin(model, admin_site)[source]

Bases: ModelAdmin

get_host(view)[source]
list_display = ('id', 'ip', 'get_host')
property media
class reporting.users.admin.NonDeveloperUsers(request, params, model, model_admin)[source]

Bases: SimpleListFilter

lookups(request, model_admin)[source]

Returns a list of tuples. The first element in each tuple is the coded value for the option that will appear in the URL query. The second element is the human-readable name for the option that will appear in the right sidebar.

parameter_name = 'user_type'
queryset(request, queryset)[source]

Returns the filtered queryset based on the value provided in the query string and retrievable via self.value().

title = 'User type'
class reporting.users.admin.PageViewAdmin(model, admin_site)[source]

Bases: ModelAdmin

get_host(view)[source]
list_display = ('user', 'view', 'ip', 'get_host', 'path', 'timestamp')
list_filter = ('user', 'view', <class 'reporting.users.admin.NonDeveloperUsers'>)
property media
class reporting.users.admin.SNSUserAdmin(model, admin_site)[source]

Bases: UserAdmin

get_groups(user)[source]
list_display = ('username', 'first_name', 'last_name', 'get_groups', 'is_staff', 'is_superuser')
property media
class reporting.users.admin.SiteNotificationAdmin(model, admin_site)[source]

Bases: ModelAdmin

list_display = ('id', 'message', 'is_active')
list_editable = ('message', 'is_active')
property media

reporting.users.models module

class reporting.users.models.DeveloperNode(*args, **kwargs)[source]

Bases: Model

Table of IP names recognized as developer nodes

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

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.

objects = <django.db.models.manager.Manager object>
class reporting.users.models.PageView(id, user, view, path, ip, timestamp)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

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.

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.

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_id
view

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

class reporting.users.models.SiteNotification(id, message, is_active)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

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

is_active

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

message

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>
class reporting.users.models.TruncatingCharField(*args, db_collation=None, **kwargs)[source]

Bases: CharField

get_prep_value(value)[source]

Perform preliminary non-db specific value checks and conversions.

reporting.users.urls module

Define url structure

reporting.users.view_util module

View utility functions for user management

reporting.users.view_util.fill_template_values(request, **template_args)[source]

Fill the template argument items needed to populate side bars and other satellite items on the pages.

Only the arguments common to all pages will be filled.

reporting.users.view_util.is_experiment_member(request, instrument_id, experiment_id)[source]

Determine whether a user is part of the given experiment.

Parameters:
  • request – request object

  • instrument_id – Instrument object

  • experiment_id – IPTS object

reporting.users.view_util.is_instrument_staff(request, instrument_id)[source]

Determine whether a user is part of an instrument team

Parameters:
  • request – HTTP request object

  • instrument_id – Instrument object

reporting.users.view_util.login_or_local_required(fn)[source]

Function decorator to check whether a user is allowed to see a view.

reporting.users.view_util.login_or_local_required_401(fn)[source]

Function decorator to check whether a user is allowed to see a view.

Usually used for AJAX calls.

reporting.users.view_util.monitor(fn)[source]

Function decorator to monitor page usage

reporting.users.views module

User management

reporting.users.views.perform_login(request)[source]

Perform user authentication

reporting.users.views.perform_logout(request)[source]

Logout user

Module contents