Esempio n. 1
0
 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()]
         }]
     }
Esempio n. 2
0
 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)
         }]
     }
Esempio n. 3
0
 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)
         }]
     }
Esempio n. 4
0
 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)]
         }]
     }
Esempio n. 5
0
 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()
Esempio n. 6
0
 def json(self) -> BlockJSON:
     return {self.id: [{'user_id': self.user_id,
                        'insert_time': convert_timestamp(self.insert_time)}]
             }