Exemplo n.º 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")
        ]
Exemplo n.º 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())
        ]
Exemplo n.º 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())
        ]
Exemplo n.º 4
0
    def validate(cls):
        return super(Label, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

            appier.not_duplicate("code", cls._name())
        ]
Exemplo n.º 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")
     ]
Exemplo n.º 6
0
 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())
     ]
Exemplo n.º 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")
     ]
Exemplo n.º 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")
     ]
Exemplo n.º 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")
        ]
Exemplo n.º 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()),
     ]
Exemplo n.º 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")
     ]
Exemplo n.º 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")
        ]
Exemplo n.º 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")
        ]
Exemplo n.º 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")
        ]
Exemplo n.º 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")
     ]
Exemplo n.º 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")
     ]
Exemplo n.º 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")
        ]
Exemplo n.º 18
0
    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)
        ]
Exemplo n.º 19
0
 def validate(cls):
     return super(App, cls).validate() + [
         appier.not_null("name"),
         appier.not_empty("name"),
         appier.not_duplicate("name", cls._name())
     ]