def json(self) -> StoreJSON: return { self.id: [{ 'name': self.name, 'created_at': convert_timestamp(self.created_timestamp), 'last_modified': convert_timestamp(self.modify_timestamp), 'items': [item.json() for item in self.items.all()] }] }
def json(self) -> ItemJSON: return { self.id: [{ 'item_name': self.item_name, 'price': self.price, 'store': self.store_id, 'last_modified': convert_timestamp(self.modify_timestamp) }] }
def all_items_json(self) -> ALLItemJSON: return { self.id: [{ 'item_name': self.item_name, 'price': self.price, 'store': self.store_id, 'hold_by_user': self.user_id, 'last_modified': convert_timestamp(self.modify_timestamp) }] }
def json(self) -> UserJSON: return { self.id: [{ 'username': str(encrypt(self.username)), 'email': str(encrypt(self.email)), 'last_login_timestamp ': convert_timestamp(self.last_login_timestamp), 'items': [item.json() for item in ItemModel.find_cart(self.id)] }] }
def find_by_user_id(cls, _id: int) -> "PaymentModel": return cls.query.with_entities( func.sum(convert_timestamp( PaymentModel.payment_timestamp))).filter_by( user_id=_id).first()
def json(self) -> BlockJSON: return {self.id: [{'user_id': self.user_id, 'insert_time': convert_timestamp(self.insert_time)}] }