Schemas
NonEmptyStr = Annotated[str, MinLen(1)]
module-attribute
¶
SimpleClubSchema
¶
Bases: ModelSchema
SimpleUserSchema
¶
Bases: ModelSchema
A schema with the minimum amount of information to represent a user.
Counter
¶
Bases: Model
gen_token()
¶
barmen_list()
¶
get_random_barman()
¶
update_activity()
¶
can_refill()
¶
Show if the counter authorize the refilling with physic money.
Source code in counter/models.py
get_top_barmen()
¶
Return a QuerySet querying the office hours stats of all the barmen of all time of this counter, ordered by descending number of hours.
Source code in counter/models.py
get_top_customers(since=None)
¶
Return a QuerySet querying the money spent by customers of this counter since the specified date, ordered by descending amount of money spent.
Each element of the QuerySet corresponds to a customer and has the following data :
- the full name (first name + last name) of the customer
- the nickname of the customer
- the amount of money spent by the customer
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
since
|
datetime | date | None
|
timestamp from which to perform the calculation |
None
|
Source code in counter/models.py
get_total_sales(since=None)
¶
Compute and return the total turnover of this counter since the given date.
By default, the date is the start of the current semester.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
since
|
datetime | date | None
|
timestamp from which to perform the calculation |
None
|
Returns:
| Type | Description |
|---|---|
CurrencyField
|
Total revenue earned at this counter. |
Source code in counter/models.py
customer_is_barman(customer)
¶
Check if this counter is a bar and if the customer is currently logged in.
This is useful to compute special prices.
Source code in counter/models.py
Price
¶
Bases: Model
Product
¶
Bases: Model
A product, with all its related information.
is_owned_by(user)
¶
Method to see if that object can be edited by the given user.
Source code in counter/models.py
ProductType
¶
Bases: OrderedModel
A product type.
Useful only for categorizing.
is_owned_by(user)
¶
Method to see if that object can be edited by the given user.
CounterSchema
¶
Bases: ModelSchema
CounterFilterSchema
¶
Bases: FilterSchema
SimplifiedCounterSchema
¶
Bases: ModelSchema
ProductTypeSchema
¶
Bases: ModelSchema
SimpleProductTypeSchema
¶
Bases: ModelSchema
ReorderProductTypeSchema
¶
Bases: Schema
SimpleProductSchema
¶
Bases: ModelSchema
ProductPriceSchema
¶
Bases: ModelSchema
ProductSchema
¶
Bases: ModelSchema
ProductFilterSchema
¶
Bases: FilterSchema
SaleFilterSchema
¶
Bases: FilterSchema