events Package

models Module

class events.models.BaseEvent(*args, **kwargs)[source]

An abstract class for the commonalities of the Event and HistoricalEvent models.

name

The name of the archived Event.

number

The number designated to the Event. Generated from the Event's date and abbreviation.

date

The date of the Event.

city

The city the Event occurred in.

state

The state or region the Event occurred in.

class Meta[source]

Order Events by Date.

class events.models.Event(*args, **kwargs)[source]

Hold information about Events.

get_absolute_url(*moreargs, **morekwargs)[source]

Return the URL of the Event’s Details Page.

get_net_change()[source]

Return the sum of all related credit and debit charges.

Return type:Decimal
save(*args, **kwargs)[source]

Set the number before saving.

class events.models.HistoricalEvent(*args, **kwargs)[source]

Historical Events record Events that occurred in previous Fiscal Years.

When a Fiscal Year is closed, all Transactions from that Fiscal Year are purged. Historical Events preserve the state of Events before the purging. They do not save the Transaction data but rather the overall data such as the total number of debits.

Instances of this model are automatically created by the add_fiscal_year() view.

credit_total

The total number of Credits related to the Event.

debit_total

The total number of Debits related to the Event. This value should be a negative number.

net_change

The Net Change of all Transactions related to the Event.

views Module

events.views.show_event_detail(request, event_id, template_name='events/event_detail.html')[source]

Shows the details of an Event instance.

Parameters:
  • event_id (int) – The id of the Event to show.
  • template_name (string) – The template to use.
Returns:

HTTP Response containing the Event instance, and the Event's Debit Total, Credit Total and Net Change.

Return type:

HttpResponse