haldis/app/fatmodels.py

21 lines
344 B
Python
Raw Normal View History

2016-09-10 16:52:46 +02:00
from models import User, Location, Order, OrderItem
class CountableModel:
@classmethod
def amount(cls):
return cls.query.count()
class FatLocation(Location, CountableModel): pass
class FatOrder(Order, CountableModel): pass
class FatUser(User, CountableModel): pass
class FatOrderItem(OrderItem, CountableModel): pass