示例#1
0
    def validate(cls):
        return super(Account, cls).validate() + [
            appier.not_null("username"),
            appier.not_empty("username"),
            appier.is_lower("username"),
            appier.string_gt("username", 3),
            appier.string_lt("username", 64),
            appier.not_duplicate("username", cls._name()),

            appier.not_null("email"),
            appier.not_empty("email"),
            appier.is_lower("email"),
            appier.is_email("email"),
            appier.not_duplicate("email", cls._name()),

            appier.not_empty("password"),
            appier.string_gt("password", 3),
            appier.string_lt("password", 256),

            appier.not_null("type"),

            appier.not_empty("password_confirm"),
            appier.string_gt("password_confirm", 3),
            appier.string_lt("password_confirm", 256),
            appier.equals("password_confirm", "password")
        ]
示例#2
0
    def validate(cls):
        return super(Package, cls).validate() + [
            appier.not_null("identifier"),
            appier.not_empty("identifier"),
            appier.not_duplicate("identifier", cls._name()),

            appier.not_null("name"),
            appier.not_empty("name"),
            appier.not_duplicate("name", cls._name())
        ]
示例#3
0
    def validate(cls):
        return super(Instance, cls).validate() + [
            appier.not_null("iid"),
            appier.not_empty("iid"),
            appier.not_duplicate("iid", cls._name()),

            appier.not_null("address"),
            appier.not_empty("address"),
            appier.not_duplicate("address", cls._name())
        ]
示例#4
0
    def validate(cls):
        return super(Label, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

            appier.not_duplicate("code", cls._name())
        ]
示例#5
0
 def validate(cls):
     return super(EAccount, cls).validate() + [
         appier.not_null("username"),
         appier.not_empty("username"),
         appier.string_gt("username", 3),
         appier.not_duplicate("username", cls._name()),
         appier.not_null("email"),
         appier.not_empty("email"),
         appier.is_email("email"),
         appier.not_duplicate("email", cls._name()),
         appier.not_null("first_name"),
         appier.not_empty("first_name"),
         appier.is_regex("phone_number", "^\+?[0-9\s]{2,}$"),
         appier.equals("password_confirm", "password"),
         appier.equals("new_password_confirm", "new_password")
     ]
示例#6
0
文件: referral.py 项目: gcandal/budy
 def validate(cls):
     return super(Referral, cls).validate() + [
         appier.not_null("name"),
         appier.not_empty("name"),
         appier.string_gt("name", 3),
         appier.string_lt("name", 64),
         appier.not_duplicate("name", cls._name())
     ]
示例#7
0
 def validate(cls):
     return super(Config, cls).validate() + [
         appier.not_null("key"),
         appier.not_empty("key"),
         appier.not_duplicate("key", cls._name()),
         appier.not_null("value"),
         appier.not_empty("value")
     ]
示例#8
0
 def validate(cls):
     return super(Account, cls).validate() + [
         appier.not_null("email"),
         appier.not_empty("email"),
         appier.is_email("email"),
         appier.not_duplicate("email", cls._name()),
         appier.not_null("name"),
         appier.not_empty("name")
     ]
示例#9
0
    def validate(cls):
        return super(Config, cls).validate() + [
            appier.not_null("key"),
            appier.not_empty("key"),
            appier.not_duplicate("key", cls._name()),

            appier.not_null("value"),
            appier.not_empty("value")
        ]
示例#10
0
 def validate(cls):
     return super(Entity, cls).validate() + [
         appier.not_null("identifier"),
         appier.not_empty("identifier"),
         appier.is_lower("identifier"),
         appier.string_gt("identifier", 3),
         appier.string_lt("identifier", 64),
         appier.not_duplicate("identifier", cls._name()),
     ]
示例#11
0
 def validate(cls):
     return super(Role, cls).validate() + [
         appier.not_null("name"),
         appier.not_empty("name"),
         appier.is_lower("name"),
         appier.string_gt("name", 3),
         appier.string_lt("name", 64),
         appier.not_duplicate("name", cls._name()),
         appier.not_null("tokens")
     ]
示例#12
0
    def validate(cls):
        return super(Account, cls).validate() + [
            appier.not_null("email"),
            appier.not_empty("email"),
            appier.is_email("email"),
            appier.not_duplicate("email", cls._name()),

            appier.not_null("name"),
            appier.not_empty("name")
        ]
示例#13
0
    def validate(cls):
        return super(Campaign, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),
            appier.string_gt("name", 3),
            appier.string_lt("name", 20),
            appier.not_duplicate("name", cls._name()),

            appier.is_email("email")
        ]
示例#14
0
    def validate(cls):
        return super(EAccount, cls).validate() + [
            appier.not_null("username"),
            appier.not_empty("username"),
            appier.string_gt("username", 3),
            appier.not_duplicate("username", cls._name()),

            appier.not_null("email"),
            appier.not_empty("email"),
            appier.is_email("email"),
            appier.not_duplicate("email", cls._name()),

            appier.not_null("first_name"),
            appier.not_empty("first_name"),

            appier.is_regex("phone_number", "^\+?[0-9\s]{2,}$"),

            appier.equals("password_confirm", "password"),
            appier.equals("new_password_confirm", "new_password")
        ]
示例#15
0
 def validate(cls):
     return super(OAuthClient, cls).validate() + [
         appier.not_null("name"),
         appier.not_empty("name"),
         appier.is_lower("name"),
         appier.string_gt("name", 3),
         appier.string_lt("name", 64),
         appier.not_duplicate("name", cls._name()),
         appier.not_null("redirect_uri"),
         appier.not_empty("redirect_uri"),
         appier.is_url("redirect_uri")
     ]
示例#16
0
 def validate(cls):
     return super(Account, cls).validate() + [
         appier.not_null("username"),
         appier.not_empty("username"),
         appier.is_lower("username"),
         appier.string_gt("username", 3),
         appier.string_lt("username", 64),
         appier.not_duplicate("username", cls._name()),
         appier.not_null("email"),
         appier.not_empty("email"),
         appier.is_lower("email"),
         appier.is_email("email"),
         appier.not_duplicate("email", cls._name()),
         appier.not_empty("password"),
         appier.string_gt("password", 3),
         appier.string_lt("password", 256),
         appier.not_null("type"),
         appier.not_empty("password_confirm"),
         appier.string_gt("password_confirm", 3),
         appier.string_lt("password_confirm", 256),
         appier.equals("password_confirm", "password")
     ]
示例#17
0
    def validate(cls):
        return super(OAuthClient, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),
            appier.is_lower("name"),
            appier.string_gt("name", 3),
            appier.string_lt("name", 64),
            appier.not_duplicate("name", cls._name()),

            appier.not_null("redirect_uri"),
            appier.not_empty("redirect_uri"),
            appier.is_url("redirect_uri")
        ]
示例#18
0
文件: bundle.py 项目: gcandal/budy
    def validate(cls):
        return super(Bundle, cls).validate() + [
            appier.not_duplicate("key", cls._name()),

            appier.not_null("quantity"),
            appier.gte("quantity", 0.0),

            appier.not_null("sub_total"),
            appier.gte("sub_total", 0.0),

            appier.not_null("discount"),
            appier.gte("discount", 0.0),

            appier.not_null("shipping_cost"),
            appier.gte("shipping_cost", 0.0),

            appier.not_null("taxes"),
            appier.gte("taxes", 0.0),

            appier.not_null("total"),
            appier.gte("total", 0.0)
        ]
示例#19
0
 def validate(cls):
     return super(App, cls).validate() + [
         appier.not_null("name"),
         appier.not_empty("name"),
         appier.not_duplicate("name", cls._name())
     ]