squaresdb.gate.views module

class squaresdb.gate.views.AnnoPerson(*args: List[Any], **kwargs: Dict[str, Any])[source]

Bases: Person

Person annotated with fields for the voting member viewed

Largely exists for type-checking

Parameters:

Relationship fields:

Parameters:

Reverse relationships:

Parameters:
exception DoesNotExist

Bases: DoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: NotUpdated

__init__(*args: List[Any], **kwargs: Dict[str, Any]) None[source]
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.'
__init__(*args, **kwargs)[source]
clean()[source]

Hook for doing any extra formset-wide cleaning after Form.clean() has been called on every form. Any ValidationError raised by this method will not be associated with a particular form; it will be accessible via formset.non_form_errors()

save(commit=True)[source]

Save model instances for every form, adding and changing instances as necessary, and return the list of instances.

exception squaresdb.gate.views.FailureResponseException(response)[source]

Bases: Exception

__init__(response)[source]
exception squaresdb.gate.views.JSONFailureException(msg)[source]

Bases: FailureResponseException

__init__(msg)[source]
class squaresdb.gate.views.SubPeriodView(**kwargs)[source]

Bases: DetailView

context_object_name = 'period'
get_context_data(*args, **kwargs)[source]

Insert the single object into the context dict.

model

alias of SubscriptionPeriod

squaresdb.gate.views.books(request, pk)[source]

Main books view

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.bulk_sub(request, slug)[source]
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.member_stats(request, slug)[source]
squaresdb.gate.views.new_sub_period(request)[source]
squaresdb.gate.views.paper_gate(request)[source]
squaresdb.gate.views.pay_stats(request)[source]
squaresdb.gate.views.pay_stats_dances(request)[source]
squaresdb.gate.views.pay_stats_subs(request)[source]
squaresdb.gate.views.person_table_annotate_people(people: QuerySet, dance_ids: List[int], sub_ids: List[int]) QuerySet[source]
squaresdb.gate.views.signin(request, pk)[source]

Main gate view

squaresdb.gate.views.signin_annotate_button_class(dance, people, subscribers)[source]

Annotate the people with their button class (paid/present status) for dance

squaresdb.gate.views.signin_api(request)[source]
squaresdb.gate.views.signin_api_undo(request)[source]
squaresdb.gate.views.strtobool(string)[source]

Convert “true” or “false” as strings to booleans

squaresdb.gate.views.upload_subs(request)[source]
squaresdb.gate.views.voting_members(request)[source]