squaresdb.gate.views module¶
- class squaresdb.gate.views.AnnoPerson(*args: List[Any], **kwargs: Dict[str, Any])[source]¶
Bases:
PersonPerson annotated with fields for the voting member viewed
Largely exists for type-checking
- Parameters:
id (BigAutoField) – Primary key: ID
name (CharField) – Name
email (EmailField) – Email
join_date (DateTimeField) – Join date
grad_year (IntegerField) – Year (expected or actual) graduated from MIT
last_marked_correct (DateTimeField) – Last marked correct
Relationship fields:
- Parameters:
level (
ForeignKeytoSquareLevel) – Highest level (related name:person)status (
ForeignKeytoPersonStatus) – Membership status (related name:person)mit_affil (
ForeignKeytoMITAffil) – MIT affiliation (related name:person)fee_cat (
ForeignKeytoFeeCategory) – Fee cat (related name:person)frequency (
ForeignKeytoPersonFrequency) – Attendance frequency (related name:person)
Reverse relationships:
- Parameters:
comments (Reverse
ForeignKeyfromPersonComment) – All comments of this person (related name ofperson)auth_links (Reverse
ForeignKeyfromPersonAuthLink) – All auth links of this person (related name ofperson)class_coord (Reverse
ForeignKeyfromTSClass) – All class coord of this person (related name ofcoordinator)class_assist (Reverse
ManyToManyFieldfromTSClass) – All class assist of this person (related name ofassistants)classes (Reverse
ManyToManyFieldfromTSClass) – All classes of this person (related name ofstudents)tsclassassist (Reverse
ForeignKeyfromTSClassAssist) – All Tech Squares class assistants of this person (related name ofassistant)tsclassmember (Reverse
ForeignKeyfromTSClassMember) – All Tech Squares class members of this person (related name ofstudent)payment (Reverse
ForeignKeyfromPayment) – All payments of this person (related name ofperson)attendee (Reverse
ForeignKeyfromAttendee) – All attendees of this person (related name ofperson)subscriptionlineitem (Reverse
ForeignKeyfromSubscriptionLineItem) – All subscription line items of this person (related name ofperson)
- exception DoesNotExist¶
Bases:
DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- exception NotUpdated¶
Bases:
NotUpdated
- class squaresdb.gate.views.BaseSubLineItemFormSet(*args, **kwargs)[source]¶
Bases:
BaseInlineFormSet- IGNORE_WARNING = ' To ignore this warning, check the box.'¶
- TS_MEMBER_UNKNOWN = 'Tech Squares member %(name)s is not in SquaresDB. Check the spelling, or try another possible spelling. To ignore this warning, check the box.'¶
- TS_PRICE_RANGE = 'Amount is not in the expected %(range)s range. If the fee category for %(name)s seems incorrect, please reach out to the officers. To ignore this warning, check the box.'¶
- exception squaresdb.gate.views.JSONFailureException(msg)[source]¶
Bases:
FailureResponseException
- class squaresdb.gate.views.SubPeriodView(**kwargs)[source]¶
Bases:
DetailView- context_object_name = 'period'¶
- model¶
alias of
SubscriptionPeriod
- squaresdb.gate.views.build_price_matrix(dance, periods)[source]¶
Build a matrix of fee category x product (dance or period)
- squaresdb.gate.views.build_price_matrix_col(fee_cat_prices, slug, price_set)[source]¶
Fill in a column of the price matrix
- squaresdb.gate.views.find_subs_from_upload(subs_file, form)[source]¶
Processes payment data from squares-pay
Notes on expected fields: webform_serial is per form, webform_sid is site-wide (per https://www.drupal.org/project/webform/issues/919832)
We care about: webform_completed_time – copied to payment.time name/email – used to find person tuesday_subscriptions – used to fill in periods amount – used to fill in amount notes – used to fill part of notes paymentOption – always expected to be “card”, used for payment_type decision – must be “ACCEPT”
We always leave at_dance blank and fee_cat is the person’s value.
The payment.notes field is filled with the submitted notes, plus webform_sid, name, email, and other things paid for (virtual_dances, rounds_class, other_items).
- squaresdb.gate.views.index(request)[source]¶
View to show sub periods, current dances, and useful links
- squaresdb.gate.views.make_api_getters(params)[source]¶
Return functions to get field/object or return error
- squaresdb.gate.views.person_table_annotate_people(people: QuerySet, dance_ids: List[int], sub_ids: List[int]) QuerySet[source]¶