mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
custom queryset method to bulk update customer balance
This commit is contained in:
18
counter/baker_recipes.py
Normal file
18
counter/baker_recipes.py
Normal file
@ -0,0 +1,18 @@
|
||||
from model_bakery.recipe import Recipe, foreign_key
|
||||
|
||||
from club.models import Club
|
||||
from core.models import User
|
||||
from counter.models import Counter, Product, Refilling, Selling
|
||||
|
||||
counter_recipe = Recipe(Counter)
|
||||
product_recipe = Recipe(Product, club=foreign_key(Recipe(Club)))
|
||||
sale_recipe = Recipe(
|
||||
Selling,
|
||||
product=foreign_key(product_recipe),
|
||||
counter=foreign_key(counter_recipe),
|
||||
seller=foreign_key(Recipe(User)),
|
||||
club=foreign_key(Recipe(Club)),
|
||||
)
|
||||
refill_recipe = Recipe(
|
||||
Refilling, counter=foreign_key(counter_recipe), operator=foreign_key(Recipe(User))
|
||||
)
|
Reference in New Issue
Block a user