AKModel.admin module

class AKModel.admin.EventRelatedFieldListFilter(field, request, params, model, model_admin, field_path)[source]

Bases: RelatedFieldListFilter

Reusable filter to restrict the possible choices of a field to those belonging to a certain event as specified in the event__id__exact GET parameter. The choices are only restricted if this parameter is present, otherwise all choices are used/returned

class AKModel.admin.EventAdmin(model, admin_site)[source]

Bases: ModelAdmin

Admin interface for Event

This allows to edit most fields of an event, some can only be changed by admin actions, since they have side effects

This admin interface registers additional views as defined in urls.py, the wizard, and the full scheduling functionality if the AKScheduling app is active.

The interface overrides the built-in creation interface for a new event and replaces it with the event creation wizard.

model

alias of Event

get_urls()[source]

Get all event-related URLs This will be both the built-in URLs and additional views providing additional functionality :return: list of all relevant URLs :rtype: List[path]

status_url(obj)[source]

Define a read-only field to go to the status page of the event

Parameters:

obj – the event to link

Returns:

status page link (HTML)

Return type:

str

toggle_plan_visibility(obj)[source]

Define a read-only field to toggle the visibility of the plan of this event This will choose from two different link targets/views depending on the current visibility status

Parameters:

obj – event to change the visibility of the plan for

Returns:

toggling link (HTML)

Return type:

str

publish(request, queryset)[source]

Admin action to publish the plan

unpublish(request, queryset)[source]

Admin action to hide the plan

class AKModel.admin.PrepopulateWithNextActiveEventMixin[source]

Bases: object

Mixin for automated pre-population of the event field

formfield_for_foreignkey(db_field, request, **kwargs)[source]

Override field generation for foreign key fields to introduce special handling for event fields: Pre-populate the event field with the next active event (since that is the most likeliest event to be worked on in the admin interface) to make creation of new owners easier

class AKModel.admin.AKOwnerAdmin(model, admin_site)[source]

Bases: PrepopulateWithNextActiveEventMixin, ModelAdmin

Admin interface for AKOwner

model

alias of AKOwner

aks_url(obj)[source]

Define a read-only field to go to the list of all AKs by this user

Parameters:

obj – user

Returns:

AK list page link (HTML)

Return type:

str

class AKModel.admin.AKCategoryAdmin(model, admin_site)[source]

Bases: PrepopulateWithNextActiveEventMixin, ModelAdmin

Admin interface for AKCategory

model

alias of AKCategory

class AKModel.admin.AKTrackAdmin(model, admin_site)[source]

Bases: PrepopulateWithNextActiveEventMixin, ModelAdmin

Admin interface for AKTrack

model

alias of AKTrack

class AKModel.admin.AKRequirementAdmin(model, admin_site)[source]

Bases: PrepopulateWithNextActiveEventMixin, ModelAdmin

Admin interface for AKRequirements

model

alias of AKRequirement

class AKModel.admin.WishFilter(request, params, model, model_admin)[source]

Bases: SimpleListFilter

Re-usable filter for wishes

class AKModel.admin.AKAdminForm(*args, **kwargs)[source]

Bases: ModelForm

Modified admin form for AKs, to be used in AKAdmin

Form fields:

__init__(*args, **kwargs)[source]
class AKModel.admin.AKAdmin(model, admin_site)[source]

Bases: PrepopulateWithNextActiveEventMixin, SimpleHistoryAdmin

Admin interface for AKs

Uses a modified form (see AKAdminForm)

model

alias of AK

form

alias of AKAdminForm

is_wish(obj)[source]

Property: Is this AK a wish?

wiki_export(request, queryset)[source]

Action: Export to wiki syntax This will use the wiki export view (therefore, all AKs have to have the same event to correclty handle the categories and to prevent accidentially merging AKs from different events in the wiki) but restrict the AKs to the ones explicitly selected here.

get_urls()[source]

Add additional URLs/views Currently used to reset the interest field and interest counter field

reset_interest(request, queryset)[source]

Action: Reset interest field for the given AKs Will use a typical admin confirmation view flow

reset_interest_counter(request, queryset)[source]

Action: Reset interest counter field for the given AKs Will use a typical admin confirmation view flow

class AKModel.admin.RoomAdmin(model, admin_site)[source]

Bases: PrepopulateWithNextActiveEventMixin, ModelAdmin

Admin interface for Rooms

model

alias of Room

get_urls()[source]

Add additional URLs/views This is currently used to adapt the creation form behavior, to allow the creation of virtual rooms in-place when the support for virtual rooms is turned on (AKOnline app active)

class AKModel.admin.EventTimezoneFormMixin[source]

Bases: object

Mixin to enforce the usage of the timezone of the associated event in forms

get_form(request, obj=None, change=False, **kwargs)[source]

Override form creation, use timezone of associated event

class AKModel.admin.AKSlotAdminForm(*args, **kwargs)[source]

Bases: ModelForm

Modified admin form for AKSlots, to be used in AKSlotAdmin

Form fields:

__init__(*args, **kwargs)[source]
class AKModel.admin.AKSlotAdmin(model, admin_site)[source]

Bases: EventTimezoneFormMixin, PrepopulateWithNextActiveEventMixin, ModelAdmin

Admin interface for AKSlots

Uses a modified form (see AKSlotAdminForm)

model

alias of AKSlot

form

alias of AKSlotAdminForm

Define a read-only field to link the details of the associated AK

Parameters:

obj – the AK to link

Returns:

AK detail page page link (HTML)

Return type:

str

class AKModel.admin.AvailabilityAdmin(model, admin_site)[source]

Bases: EventTimezoneFormMixin, ModelAdmin

Admin interface for Availabilities

class AKModel.admin.AKOrgaMessageAdmin(model, admin_site)[source]

Bases: ModelAdmin

Admin interface for AKOrgaMessages

class AKModel.admin.ConstraintViolationAdminForm(*args, **kwargs)[source]

Bases: ModelForm

Adapted admin form for constraint violations for usage in ConstraintViolationAdmin)

Form fields:

__init__(*args, **kwargs)[source]
class AKModel.admin.ConstraintViolationAdmin(model, admin_site)[source]

Bases: ModelAdmin

Admin interface for constraint violations Uses an adapted form (see ConstraintViolationAdminForm)

form

alias of ConstraintViolationAdminForm

get_urls()[source]

Add additional URLs/views to change status and severity of CVs

mark_resolved(request, queryset)[source]

Action: Mark CV as resolved

set_violation(request, queryset)[source]

Action: Promote CV to level violation

set_warning(request, queryset)[source]

Action: Set CV to level warning

class AKModel.admin.DefaultSlotAdminForm(*args, **kwargs)[source]

Bases: ModelForm

Adapted admin form for DefaultSlot for usage in DefaultSlotAdmin

Form fields:

__init__(*args, **kwargs)[source]
class AKModel.admin.DefaultSlotAdmin(model, admin_site)[source]

Bases: EventTimezoneFormMixin, ModelAdmin

Admin interface for default slots Uses an adapted form (see DefaultSlotAdminForm)

form

alias of DefaultSlotAdminForm