Models
Counter
¶
Bases: Model
gen_token()
¶
get_barmen_list()
¶
Returns the barman list as list of User.
Also handle the timeout of the barmen
Source code in counter/models.py
get_random_barman()
¶
update_activity()
¶
is_inactive()
¶
Returns True if the counter self is inactive from SITH_COUNTER_MINUTE_INACTIVE's value minutes, else False.
Source code in counter/models.py
barman_list()
¶
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
ProductType
¶
Bases: Model
A product type.
Useful only for categorizing.
is_owned_by(user)
¶
Method to see if that object can be edited by the given user.
Stock
¶
Bases: Model
The Stock class, this one is used to know how many products are left for a specific counter.
StockItem
¶
Bases: Model
The StockItem class, element of the stock.
ShoppingList
¶
Bases: Model
The ShoppingList class, used to make an history of the shopping lists.
ShoppingListItem
¶
Bases: Model
An Item on a shopping list.