intranet.apps.cslapps package

Subpackages

Submodules

intranet.apps.cslapps.admin module

class intranet.apps.cslapps.admin.AppAdmin(model, admin_site)[source]

Bases: ModelAdmin

list_display = ('name', 'order', 'description', 'oauth_application', 'url')
search_fields = ('name', 'description', 'url')

intranet.apps.cslapps.models module

class intranet.apps.cslapps.models.App(*args, **kwargs)[source]

Bases: Model

Represents an app maintained by the CSL. .. attribute:: name

The name of the app.

type:

str

description

A description of the app.

Type:

str

order

The order in which the app should be displayed.

Type:

int

oauth_application

The OAuth application associated with the app, if any.

Type:

CSLApplication

auth_url

The URL to the app’s authentication page (preferably, if available, using Ion OAuth).

Type:

str

url

The URL to the app.

Type:

str

image_url

The URL to the image icon for the app.

Type:

str

html_icon

HTML for the icon of the app, can be used for things like font awesome icons. WARNING: this is rendered as safe. Do not allow untrusted content here.

Type:

str

invert_image_color_for_dark_mode

Whether or not to invert the image color for dark mode. Set to true if the image is a mostly dark color, which will require it to be inverted to appear on dark mode.

Type:

bool

groups_visible

Groups that can access this app.

Type:

list of Group

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

auth_url

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

description

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

groups_visible

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

html_icon

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

id

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

image_url

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

invert_image_color_for_dark_mode

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

name

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

oauth_application

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.

oauth_application_id
objects = <intranet.apps.cslapps.models.AppManager object>
order

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

url

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

visible_to(user)[source]
class intranet.apps.cslapps.models.AppManager(*args, **kwargs)[source]

Bases: Manager

visible_to_user(user)[source]

Get a list of apps available to a given user.

Same logic as Announcements and Events.

class intranet.apps.cslapps.models.App_groups_visible(id, app, group)

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

app

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.

app_id
group

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.

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

intranet.apps.cslapps.tests module

class intranet.apps.cslapps.tests.AppsTest(methodName='runTest')[source]

Bases: IonTestCase

Tests for the CSL Apps module

test_app_requests()[source]
test_create_app()[source]

intranet.apps.cslapps.urls module

intranet.apps.cslapps.views module

Module contents