club_sessions package#
Subpackages#
- club_sessions.views package
- Submodules
- club_sessions.views.admin module
- club_sessions.views.core module
add_table()
augment_session_entries()
augment_session_entries_process_entry()
back_out_top_up()
bridge_credits_for_club()
calculate_payment_method_and_balance()
change_user_on_session_entry()
change_user_on_session_entry_non_player()
change_user_on_session_entry_player()
delete_table()
edit_session_entry_handle_bridge_credits()
edit_session_entry_handle_ious()
edit_session_entry_handle_other()
get_allowed_payment_methods()
get_extras_as_total_for_session_entries()
get_extras_for_session_entries()
get_session_fee_for_player()
get_session_fees_for_session()
get_summary_table_data()
get_summary_table_data_sub()
get_table_view_data()
handle_bridge_credit_changes_refund()
handle_change_additional_session_fee()
handle_change_additional_session_fee_reason()
handle_change_secondary_payment_method()
handle_change_session_type()
handle_iou_changes_for_misc_off()
handle_iou_changes_for_misc_on()
handle_iou_changes_off()
handle_iou_changes_on()
iou_for_club()
load_session_entry_static()
pay_bridge_credit_for_extra()
process_bridge_credits()
recalculate_session_status()
refund_bridge_credit_for_extra()
reset_values_on_session_entry()
session_health_check()
session_totals_calculations()
- club_sessions.views.decorators module
- club_sessions.views.imports module
- club_sessions.views.manage_session module
- club_sessions.views.new_session module
- club_sessions.views.reports module
- Module contents
Submodules#
club_sessions.admin module#
Generated by utils/cgit/cgit_util_generate_admin_file on 2022-01-24 12:15:50.068914
- class club_sessions.admin.MemberOrganisationLinkAdmin(model, admin_site)[source]#
Bases:
ModelAdmin
Admin class for model MemberOrganisationLink
- autocomplete_fields = ['member_transaction', 'organisation_transaction']#
- property media#
- class club_sessions.admin.SessionAdmin(model, admin_site)[source]#
Bases:
ModelAdmin
Admin class for model Session
- autocomplete_fields = ['director', 'session_type', 'venue']#
- property media#
- search_fields = ['director', 'venue']#
- class club_sessions.admin.SessionEntryAdmin(model, admin_site)[source]#
Bases:
ModelAdmin
Admin class for model SessionEntry
- autocomplete_fields = ['session', 'org_tran', 'member_tran', 'payment_method']#
- property media#
- search_fields = ['player']#
- class club_sessions.admin.SessionMiscPaymentAdmin(model, admin_site)[source]#
Bases:
ModelAdmin
Admin class for model SessionMiscPayment
- autocomplete_fields = ['session_entry']#
- property media#
- search_fields = ['system_number']#
- class club_sessions.admin.SessionTypeAdmin(model, admin_site)[source]#
Bases:
ModelAdmin
Admin class for model SessionType
- autocomplete_fields = ['organisation']#
- property media#
- search_fields = ['name', 'organisation']#
club_sessions.apps module#
club_sessions.forms module#
- class club_sessions.forms.FileImportForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None, bound_field_class=None)[source]#
Bases:
Form
Session file upload form
- base_fields = {'file': <django.forms.fields.FileField object>}#
- declared_fields = {'file': <django.forms.fields.FileField object>}#
- property media#
Return all media required to render the widgets on this form.
- class club_sessions.forms.SessionForm(*args, **kwargs)[source]#
Bases:
ModelForm
Session Form
- class Meta[source]#
Bases:
object
- fields = ['director', 'session_type', 'session_date', 'description', 'venue', 'time_of_day', 'additional_session_fee', 'additional_session_fee_reason', 'default_secondary_payment_method', 'director_notes']#
- base_fields = {'additional_session_fee': <django.forms.fields.DecimalField object>, 'additional_session_fee_reason': <django.forms.fields.CharField object>, 'default_secondary_payment_method': <django.forms.models.ModelChoiceField object>, 'description': <django.forms.fields.CharField object>, 'director': <django.forms.models.ModelChoiceField object>, 'director_notes': <django.forms.fields.CharField object>, 'session_date': <django.forms.fields.DateField object>, 'session_type': <django.forms.models.ModelChoiceField object>, 'time_of_day': <django.forms.fields.TypedChoiceField object>, 'venue': <django.forms.models.ModelChoiceField object>}#
- clean_description()[source]#
remove “; from description in case someone deliberately wants it to fail. Least likely code to ever run
- declared_fields = {'director_notes': <django.forms.fields.CharField object>}#
- property media#
Return all media required to render the widgets on this form.
- class club_sessions.forms.UserSessionForm(*args, **kwargs)[source]#
Bases:
Form
Form for the screen to allow editing a single user in a session Has a bit of a mixture of things on it from multiple places
- base_fields = {'fee': <django.forms.fields.DecimalField object>, 'is_paid': <django.forms.fields.BooleanField object>, 'payment_method': <django.forms.fields.ChoiceField object>}#
- declared_fields = {'fee': <django.forms.fields.DecimalField object>, 'is_paid': <django.forms.fields.BooleanField object>, 'payment_method': <django.forms.fields.ChoiceField object>}#
- property media#
Return all media required to render the widgets on this form.
club_sessions.models module#
- class club_sessions.models.MasterSessionType(*values)[source]#
Bases:
TextChoices
Master list of different types of session that are supported The idea with this is that different things will happen depending upon the master_session_type. Currently nothing happens so this is just set to DUPLICATE.
- DUPLICATE = 'DP'#
- MULTI_SESSION = 'MS'#
- WORKSHOP = 'WS'#
- class club_sessions.models.Session(*args, **kwargs)[source]#
Bases:
Model
Basic definition of a session of bridge
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- class SessionStatus(*values)[source]#
Bases:
TextChoices
- COMPLETE = 'CO'#
- CREDITS_PROCESSED = 'BC'#
- DATA_LOADED = 'LD'#
- additional_session_fee#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- additional_session_fee_reason#
allows all users to be charged an additional fee for this session
- default_secondary_payment_method#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- default_secondary_payment_method_id#
- description#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- director#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- director_id#
- director_notes#
Comments on the session
- get_next_by_session_date(*, field=<django.db.models.fields.DateField: session_date>, is_next=True, **kwargs)#
- get_previous_by_session_date(*, field=<django.db.models.fields.DateField: session_date>, is_next=False, **kwargs)#
- get_status_display(*, field=<django.db.models.fields.CharField: status>)#
- get_time_of_day_display(*, field=<django.db.models.fields.CharField: time_of_day>)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- import_messages#
A place to store the messages generated when we imported the file (if we did)
- objects = <django.db.models.manager.Manager object>#
- session_date#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- session_type#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- session_type_id#
- sessionentry_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- status#
shows whether this session has had payments made and is now closed
- time_of_day#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- venue#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- venue_id#
- class club_sessions.models.SessionEntry(*args, **kwargs)[source]#
Bases:
Model
A player who is playing in a session
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- fee#
default to -99 so we know it hasn’t been set. Zero is a valid fee to set it to
- get_seat_display(*, field=<django.db.models.fields.CharField: seat>)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_paid#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- member_tran#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- member_tran_id#
- objects = <django.db.models.manager.Manager object>#
- org_tran#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- org_tran_id#
- pair_team_number#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- payment_method#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- payment_method_id#
- player_name_from_file#
Player name as it appears on the file. We usually use the system_number, but for non-ABF members we need this
- save(*args, **kwargs)[source]#
We add the seat number internal on save, so we can load from database in order NSEW
- seat#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- seat_number_internal#
seat_number_internal is used to sort NSEW in order
- session#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- session_id#
- sessionmiscpayment_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- system_number#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- userpendingpayment_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class club_sessions.models.SessionMiscPayment(*args, **kwargs)[source]#
Bases:
Model
holds miscellaneous payments associated with a session. These are not paid until the payments for this session are all processed.
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- amount#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- description#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_payment_type_display(*, field=<django.db.models.fields.CharField: payment_type>)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>#
- payment_made#
Has this payment been processed. We use a different name from SessionEntry to help with searching the code
- payment_method#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- payment_method_id#
- payment_type#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- session_entry#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- session_entry_id#
- userpendingpayment_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class club_sessions.models.SessionType(*args, **kwargs)[source]#
Bases:
Model
Specific club session types
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- get_master_session_type_display(*, field=<django.db.models.fields.CharField: master_session_type>)#
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- master_session_type#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- name#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>#
- organisation#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- organisation_id#
- session_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- sessiontypepaymentmethod_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- status#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class club_sessions.models.SessionTypePaymentMethod(*args, **kwargs)[source]#
Bases:
Model
Payment types for a session type
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>#
- payment_method#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- payment_method_id#
- session_type#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- session_type_id#
- sessiontypepaymentmethodmembership_set#
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class club_sessions.models.SessionTypePaymentMethodMembership(*args, **kwargs)[source]#
Bases:
Model
Links a session type (and payment method) to a membership type and sets the fee
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- fee#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- id#
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- membership#
This either holds a link to a membership type or can be blank to signify the rate for non-members
- membership_id#
- objects = <django.db.models.manager.Manager object>#
- session_type_payment_method#
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- session_type_payment_method_id#