masterpoints package#
Submodules#
masterpoints.admin module#
masterpoints.apps module#
masterpoints.factories module#
- class masterpoints.factories.MasterpointDB[source]#
Bases:
MasterpointFactory
Concrete implementation of a masterpoint factory using a database to get the data
- class masterpoints.factories.MasterpointFactory[source]#
Bases:
object
Abstract class for accessing masterpoint data
- class masterpoints.factories.MasterpointFile[source]#
Bases:
MasterpointFactory
Concrete implementation of a masterpoint factory using a file to get the data
- masterpoints.factories.masterpoint_query_list(query)[source]#
Generic function to talk to the masterpoints SQL Server and return data as a list
masterpoints.models module#
masterpoints.tests module#
masterpoints.urls module#
masterpoints.views module#
- masterpoints.views.abf_checksum_is_valid(abf_number: int) bool [source]#
Takes an ABF number and confirms the number has a valid checksum. Doesn’t check with the MPC to see if this is a valid number (not inactive, actually registered etc).
- masterpoints.views.abf_registration_card(request)[source]#
Logged out search for user to print a registration card
- masterpoints.views.abf_registration_card_htmx(request)[source]#
Perform the user search and return the list
- masterpoints.views.download_abf_card_pdf(request)[source]#
Downloads a PDF with basic information about this registered user
- masterpoints.views.get_abf_checksum(abf_raw: int) int [source]#
Calculate the checksum for an ABF number given the raw number without the checksum
Formula is:
convert to 6 digit with leading 0, e.g. 62024 becomes 062024 total is 0th place x 7, 1st place x 6, 2nd place x 5 etc result = total mod 11 if result = 0 checksum = 0 else checksum = 11 - (result mod 11)
- masterpoints.views.masterpoint_query_local(query)[source]#
Generic function to talk to the masterpoints server and return data
THIS IS A DUPLICATE OF THE FUNCTION IN UTILS/UTIL_VIEWS/MASTERPOINTS due to circular dependency problems.
Takes in a SQLServer query e.g. “select count(*) from table”
Returns an iterable, either an empty list or the response from the server.
In case there is a problem connecting to the server, this will do everything it can to fail silently.
- masterpoints.views.process_transactions(details, month, year)[source]#
Separate process and provisional details add formatting to the matchpoint numbers
- masterpoints.views.search_mpc_users_by_name(first_name_search, last_name_search)[source]#
search the masterpoint centre for users by first and last name
- masterpoints.views.system_number_available(system_number)[source]#
Called from the registration page. Takes in a system number and returns True if number is valid and available