class Wifi(Product): internet_name = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) connections = db.IntField() download_speed = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) upload_speed = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) information = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) prepayment = db.IntField() continent = db.StringField(max_length=STRING_LENGTH['LONG'], required=True)
class Order(BaseDocument): product_id = db.ObjectIdField(required=True) quantity = db.IntField(required=True) name = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) email = db.StringField(max_length=STRING_LENGTH['LONG']) phone = db.StringField(max_length=STRING_LENGTH['EX_SHORT'], required=True) description = db.StringField(max_length=STRING_LENGTH['EX_SHORT']) address = db.StringField(max_length=STRING_LENGTH['EX_LONG']) product_type = db.StringField(max_length=STRING_LENGTH['LONG']) status = db.IntField(required=True)
class WifiProduct(BaseDocument): country = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) internet_name = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) connection = db.IntField(default=1) speed_download = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) speed_upload = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) information = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) prepayment = db.IntField() price_day = db.IntField() image = db.ObjectIdField() continent = db.StringField(max_length=STRING_LENGTH['LONG'], required=True)
class File(object): url = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) path = db.StringField(max_length=STRING_LENGTH['LONG'], required=True, unique=True) name = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) size = db.IntField(required=True) def delete(self, *args, **kwargs): uploader.remove(path=self.path) return super().delete(*args, **kwargs)
class Product(BaseDocument): name = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) price = db.IntField() category = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) image_id = db.ObjectIdField() country = db.StringField(max_length=STRING_LENGTH['LONG'], required=True)
class Sim(Product): owned = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) day_used = db.IntField()
class PromotionPackage(BaseDocument): name = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) sale_off_value = db.IntField(required=True)
class SimProduct(BaseDocument): owned = db.StringField(max_length=STRING_LENGTH['LONG'], required=True) day_used = db.IntField(default=0) price = db.IntField(default=0) image = db.ObjectIdField() country = db.StringField(max_length=STRING_LENGTH['LONG'])