Projection

This module handles most of the tasks related to projection.

Models

class projection.models.PITLevel(*args, **kwargs)[source]

Projectionist In Training (PIT) levels

Parameters:
  • id (AutoField) – Id (required)
  • name_short (CharField) – Name short (required)
  • name_long (CharField) – Name long (required)
  • ordering (IntegerField) – Ordering (default=0)
exception DoesNotExist
exception MultipleObjectsReturned
id

AutoField(verbose_name=”ID”, primary_key=True, serialize=False, auto_created=True)

name_long

CharField(max_length=16)

name_short

CharField(max_length=3)

objects = <django.db.models.manager.Manager object>
ordering

IntegerField(default=0)

pitinstances

Reverse Manager for projection.PitInstance’s pit_level

pitrequest

Reverse Manager for projection.PitRequest’s level

class projection.models.PitInstance(*args, **kwargs)[source]

Record of a projectionist’s completion of a PIT

Parameters:
  • id (AutoField) – Id (required)
  • projectionist (ForeignKey to Projectionist) – Projectionist (required)
  • pit_level (ForeignKey to PITLevel) – Pit level (required)
  • created_on (DateField) – Created on (required)
  • valid (BooleanField) – Valid (default=True)
exception DoesNotExist
exception MultipleObjectsReturned
created_on

DateField()

get_next_by_created_on(*, field=<django.db.models.fields.DateField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateField: created_on>, is_next=False, **kwargs)
id

AutoField(verbose_name=”ID”, primary_key=True, serialize=False, auto_created=True)

objects = <django.db.models.manager.Manager object>
pit_level

ForeignKey(related_name=”pitinstances”, on_delete=PROTECT(), to= PITLevel)

pit_level_id

Raw (integer) FK for pit_level

projectionist

ForeignKey(related_name=”pitinstances”, on_delete=CASCADE(), to= Projectionist)

projectionist_id

Raw (integer) FK for projectionist

valid

BooleanField(default=True)

class projection.models.PitRequest(*args, **kwargs)[source]

Members can submit a request to receive their next level of training

Parameters:
  • id (AutoField) – Id (required)
  • projectionist (ForeignKey to Projectionist) – Projectionist (required)
  • level (ForeignKey to PITLevel) – Level (required)
  • requested_on (DateTimeField) – Requested on (required)
  • approved (BooleanField) – Approved (default=False)
  • scheduled_for (DateTimeField) – Scheduled for
exception DoesNotExist
exception MultipleObjectsReturned
approved

BooleanField(default=False)

get_next_by_requested_on(*, field=<django.db.models.fields.DateTimeField: requested_on>, is_next=True, **kwargs)
get_previous_by_requested_on(*, field=<django.db.models.fields.DateTimeField: requested_on>, is_next=False, **kwargs)
id

AutoField(verbose_name=”ID”, primary_key=True, serialize=False, auto_created=True)

level

ForeignKey(related_name=”pitrequest”, on_delete=PROTECT(), to= PITLevel)

level_id

Raw (integer) FK for level

objects = <django.db.models.manager.Manager object>
projectionist

ForeignKey(related_name=”pitrequest”, on_delete=CASCADE(), to= Projectionist)

projectionist_id

Raw (integer) FK for projectionist

requested_on

DateTimeField(auto_now_add=True)

scheduled_for

DateTimeField(blank=True, null=True)

class projection.models.Projectionist(id, user, license_number, license_expiry)[source]
Parameters:
  • id (AutoField) – Id (required)
  • user (OneToOneField to User) – User (required)
  • license_number (CharField) – License number
  • license_expiry (DateField) – License expiry
exception DoesNotExist
exception MultipleObjectsReturned
expired
expiring
id

AutoField(verbose_name=”ID”, primary_key=True, serialize=False, auto_created=True)

is_alumni
level
license_expiry

DateField(blank=True, null=True)

license_number

CharField(max_length=10, blank=True, null=True)

objects = <django.db.models.manager.Manager object>
pitinstances

Reverse Manager for projection.PitInstance’s projectionist

pitrequest

Reverse Manager for projection.PitRequest’s projectionist

user

OneToOneField(on_delete=CASCADE(), to= User)

user_id

Raw (integer) FK for user

validlevels

Views

class projection.views.BulkUpdateView(**kwargs)[source]

Update a PIT for multiple projectionists at the same time

form_class

alias of projection.forms.BulkUpdateForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

perms = 'projection.edit_pits'
success_url
template_name = 'form_crispy_cbv.html'
class projection.views.CancelPITRequest(**kwargs)[source]

Cancel a PIT request

get_success_url()[source]
model

alias of projection.models.PitRequest

msg = 'Cancelled PIT Request'
perms = 'projection.view_pits'
template_name = 'form_cancel_request.html'
class projection.views.PITRequest(**kwargs)[source]

Create a new PIT request

form_class

alias of projection.forms.PITRequestForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

model

alias of projection.models.PitRequest

perms = 'projection.view_pits'
template_name = 'projection_pit_request.html'
class projection.views.ProjectionCreate(**kwargs)[source]

Add a new projectionist

form_class

alias of projection.forms.ProjectionistForm

get_context_data(**kwargs)[source]

Insert the form into the context dict.

model

alias of projection.models.Projectionist

perms = 'projection.edit_pits'
success_url
template_name = 'form_crispy_projection.html'
class projection.views.ProjectionistDelete(**kwargs)[source]

Remove a projectionist (does not remove the associated user)

get_success_url()[source]
model

alias of projection.models.Projectionist

msg = 'Deleted Projectionist'
perms = 'projection.edit_pits'
template_name = 'form_delete_cbv.html'
projection.views.bulk_projection(request)[source]

Add new projection events in bulk. This is an internal form and is often used when there are multiple showings over the course of a weekend.

projection.views.get_saturdays_for_range(date_1, date_2)[source]

Get a list of Saturdays in a given time frame

Parameters:
  • date_1 – Datetime of the lower bound
  • date_2 – Datetime of the upper bound
Returns:

An array of datetime objects

projection.views.manage_pit_request(request, id)[source]

Edit or approve a PIT request (not accessible by trainee)

projection.views.pit_complete(request, id)[source]

Mark a PIT as complete

projection.views.pit_request_update(request, id)[source]

Edit a PIT request (accessible by trainee)

projection.views.pit_schedule(request)[source]

List all PIT requests

projection.views.plist(request)[source]

List all projectionists

projection.views.plist_detail(request)[source]

Grid view of projectionists and their completed PITs

projection.views.projection_update(request, id)[source]

Update a projectionist’s license and / or PIT records

projection.views.send_request_notification(form, update=False)[source]

Send the head projectionist a PIT request notification


Forms

class projection.forms.BulkCreateForm(*args, **kwargs)[source]
base_fields = {'billing': <ajax_select.fields.AutoCompleteSelectField object>, 'contact': <ajax_select.fields.AutoCompleteSelectField object>, 'date_first': <django.forms.fields.DateField object>, 'date_second': <django.forms.fields.DateField object>}
declared_fields = {'billing': <ajax_select.fields.AutoCompleteSelectField object>, 'contact': <ajax_select.fields.AutoCompleteSelectField object>, 'date_first': <django.forms.fields.DateField object>, 'date_second': <django.forms.fields.DateField object>}
media
class projection.forms.BulkUpdateForm(*args, **kwargs)[source]
base_fields = {'date': <django.forms.fields.DateField object>, 'pit_level': <django.forms.models.ModelChoiceField object>, 'users': <ajax_select.fields.AutoCompleteSelectMultipleField object>}
create_updates()[source]
declared_fields = {'date': <django.forms.fields.DateField object>, 'pit_level': <django.forms.models.ModelChoiceField object>, 'users': <ajax_select.fields.AutoCompleteSelectMultipleField object>}
media
class projection.forms.DateEntryFormSetBase(*args, **kwargs)[source]
base_fields = {'date': <django.forms.fields.DateField object>, 'friday': <django.forms.fields.BooleanField object>, 'matinee': <django.forms.fields.BooleanField object>, 'name': <django.forms.fields.CharField object>, 'saturday': <django.forms.fields.BooleanField object>, 'sunday': <django.forms.fields.BooleanField object>}
declared_fields = {'date': <django.forms.fields.DateField object>, 'friday': <django.forms.fields.BooleanField object>, 'matinee': <django.forms.fields.BooleanField object>, 'name': <django.forms.fields.CharField object>, 'saturday': <django.forms.fields.BooleanField object>, 'sunday': <django.forms.fields.BooleanField object>}
media
save_objects(user, contact, org, ip=None)[source]
time_offsets = {'friday': datetime.timedelta(days=-1), 'matinee': datetime.timedelta(days=-1, seconds=64800), 'saturday': datetime.timedelta(0), 'sunday': datetime.timedelta(days=1)}
class projection.forms.InstanceForm(*args, **kwargs)[source]
class Meta[source]
fields = ('pit_level', 'created_on', 'valid')
model

alias of projection.models.PitInstance

base_fields = {'created_on': <django.forms.fields.DateField object>, 'pit_level': <django.forms.models.ModelChoiceField object>, 'valid': <django.forms.fields.BooleanField object>}
declared_fields = {'created_on': <django.forms.fields.DateField object>}
media
class projection.forms.PITRequestAdminForm(*args, **kwargs)[source]
base_fields = {'approved': <django.forms.fields.BooleanField object>, 'level': <django.forms.models.ModelChoiceField object>, 'scheduled_for': <django.forms.fields.SplitDateTimeField object>}
declared_fields = {'approved': <django.forms.fields.BooleanField object>, 'level': <django.forms.models.ModelChoiceField object>, 'scheduled_for': <django.forms.fields.SplitDateTimeField object>}
media
class projection.forms.PITRequestForm(*args, **kwargs)[source]
class Meta[source]
fields = ('level', 'scheduled_for', 'approved')
model

alias of projection.models.PitRequest

base_fields = {'approved': <django.forms.fields.BooleanField object>, 'level': <django.forms.models.ModelChoiceField object>, 'scheduled_for': <django.forms.fields.SplitDateTimeField object>}
declared_fields = {'level': <django.forms.models.ModelChoiceField object>, 'scheduled_for': <django.forms.fields.SplitDateTimeField object>}
media
class projection.forms.ProjectionistForm(*args, **kwargs)[source]
class Meta[source]
fields = ('user', 'license_number', 'license_expiry')
model

alias of projection.models.Projectionist

base_fields = {'license_expiry': <django.forms.fields.DateField object>, 'license_number': <django.forms.fields.CharField object>, 'user': <ajax_select.fields.AutoCompleteSelectField object>}
declared_fields = {'user': <ajax_select.fields.AutoCompleteSelectField object>}
media
class projection.forms.ProjectionistUpdateForm(*args, **kwargs)[source]
class Meta[source]
fields = ('license_number', 'license_expiry')
model

alias of projection.models.Projectionist

base_fields = {'license_expiry': <django.forms.fields.DateField object>, 'license_number': <django.forms.fields.CharField object>}
declared_fields = {}
media