Exemple #1
0
 def validate(cls):
     return super(APN, cls).validate() + [
         appier.not_null("token"),
         appier.not_empty("token"),
         appier.not_null("event"),
         appier.not_empty("event")
     ]
Exemple #2
0
 def validate(cls):
     return super(Subscription, cls).validate() + [
         appier.not_null("user_id"),
         appier.not_empty("user_id"),
         appier.not_null("event"),
         appier.not_empty("event")
     ]
Exemple #3
0
 def validate_new(cls):
     return super(EAccount, cls).validate_new() + [
         appier.not_null("password"),
         appier.not_empty("password"),
         appier.not_null("password_confirm"),
         appier.not_empty("password_confirm")
     ]
    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")
        ]
Exemple #5
0
    def validate(cls):
        return super(Asset, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

            appier.not_null("node")
        ]
Exemple #6
0
 def validate(cls):
     return super(Event, cls).validate() + [
         appier.not_null("name"),
         appier.not_empty("name"),
         appier.not_null("handler"),
         appier.not_empty("handler")
     ]
Exemple #7
0
    def validate(cls):
        return super(Measurement, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

            appier.not_null("value")
        ]
Exemple #8
0
 def validate(cls):
     return super(Snapshot, cls).validate() + [
         appier.not_null("target_id"),
         appier.not_null("target_cls"),
         appier.not_empty("target_cls"),
         appier.not_null("model_data")
     ]
Exemple #9
0
    def validate(cls):
        return super(Artifact, cls).validate() + [
            appier.not_null("identifier"),
            appier.not_empty("identifier"),

            appier.not_null("version"),
            appier.not_empty("version")
        ]
Exemple #10
0
    def validate(cls):
        return super(APN, cls).validate() + [
            appier.not_null("token"),
            appier.not_empty("token"),

            appier.not_null("event"),
            appier.not_empty("event")
        ]
Exemple #11
0
    def validate_new(cls):
        return super(EAccount, cls).validate_new() + [
            appier.not_null("password"),
            appier.not_empty("password"),

            appier.not_null("password_confirm"),
            appier.not_empty("password_confirm")
        ]
Exemple #12
0
    def validate(cls):
        return super(Association, cls).validate() + [
            appier.not_null("user_id"),
            appier.not_empty("user_id"),

            appier.not_null("mid"),
            appier.not_empty("mid")
        ]
Exemple #13
0
    def validate(cls):
        return super(Printer, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

            appier.not_null("type"),
            appier.not_empty("type")
        ]
Exemple #14
0
    def validate(cls):
        return super(Subscription, cls).validate() + [
            appier.not_null("user_id"),
            appier.not_empty("user_id"),

            appier.not_null("event"),
            appier.not_empty("event")
        ]
Exemple #15
0
    def validate(cls):
        return super(Menu, cls).validate() + [
            appier.not_null("day"),
            appier.gt("day", 0),

            appier.not_null("dishes"),
            appier.not_empty("dishes")
        ]
Exemple #16
0
    def validate(cls):
        return super(Web, cls).validate() + [
            appier.not_null("url"),
            appier.not_empty("url"),

            appier.not_null("event"),
            appier.not_empty("event")
        ]
Exemple #17
0
    def validate(cls):
        return super(Association, cls).validate() + [
            appier.not_null("user_id"),
            appier.not_empty("user_id"),

            appier.not_null("mid"),
            appier.not_empty("mid")
        ]
Exemple #18
0
    def validate(cls):
        return super(Event, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

            appier.not_null("handler"),
            appier.not_empty("handler")
        ]
Exemple #19
0
 def validate(cls):
     return super(Locale, cls).validate() + [
         appier.not_null("locale"),
         appier.not_empty("locale"),
         appier.is_regex("locale", "^[a-z]{2}(?:_[a-z]{2}(?:_[a-z]+)?)?$"),
         appier.not_null("data_j"),
         appier.not_empty("data_j")
     ]
Exemple #20
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")
     ]
Exemple #21
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")
        ]
Exemple #22
0
    def validate(cls):
        return super(Feature, cls).validate() + [
            appier.not_null("url"),
            appier.not_empty("url"),
            appier.is_url("url"),

            appier.not_null("name"),
            appier.not_empty("name")
        ]
Exemple #23
0
    def validate(cls):
        return super(Currency, cls).validate() + [
            appier.not_null("iso"),
            appier.not_empty("iso"),
            appier.string_eq("iso", 3),

            appier.not_null("decimal_places"),
            appier.gte("decimal_places", 0)
        ]
Exemple #24
0
    def validate(cls):
        return super(Locale, cls).validate() + [
            appier.not_null("locale"),
            appier.not_empty("locale"),
            appier.is_regex("locale", "^[a-z]{2}(?:_[a-z]{2}(?:_[a-z]+)?)?$"),

            appier.not_null("data_j"),
            appier.not_empty("data_j")
        ]
    def validate(cls):
        return super(Snapshot, cls).validate() + [
            appier.not_null("target_id"),

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

            appier.not_null("model_data")
        ]
Exemple #26
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")
     ]
    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())
        ]
Exemple #28
0
    def validate(cls):
        return super(Artifact, cls).validate() + [
            appier.not_null("version"),
            appier.not_empty("version"),

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

            appier.not_null("package")
        ]
Exemple #29
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")
        ]
Exemple #30
0
 def validate(cls):
     return super(Search, cls).validate() + [
         appier.not_null("token"),
         appier.not_empty("token"),
         appier.not_null("target_id"),
         appier.not_null("target_cls"),
         appier.not_empty("target_cls"),
         appier.not_null("target_title"),
         appier.not_empty("target_title")
     ]
Exemple #31
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())
        ]
Exemple #32
0
    def validate(cls):
        return super(Composition, cls).validate() + [
            appier.not_null("part"),
            appier.not_empty("part"),

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

            appier.not_null("value")
        ]
Exemple #33
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")
     ]
Exemple #34
0
    def validate(cls):
        return super(PushiEvent, cls).validate() + [
            appier.not_null("mid"),
            appier.not_empty("mid"),

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

            appier.not_null("timestamp")
        ]
Exemple #35
0
    def validate(cls):
        return super(ExchangeRate, cls).validate() + [
            appier.not_null("base"),
            appier.not_empty("base"),

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

            appier.not_null("rate"),
            appier.gte("rate", 0.0)
        ]
Exemple #36
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")
     ]
Exemple #37
0
    def validate(cls):
        return super(Measurement, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

            appier.not_null("value"),

            appier.gte("price", 0.0),

            appier.gte("taxes", 0.0),

            appier.not_null("product")
        ]
    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")
        ]
Exemple #39
0
    def validate(cls):
        return super(Search, cls).validate() + [
            appier.not_null("token"),
            appier.not_empty("token"),

            appier.not_null("target_id"),

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

            appier.not_null("target_title"),
            appier.not_empty("target_title")
        ]
    def validate(cls):
        return super(Subscription, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),
            appier.string_gt("name", 3),
            appier.string_lt("name", 20),

            appier.not_null("email"),
            appier.not_empty("email"),
            appier.is_email("email"),

            appier.not_null("campaign")
        ]
Exemple #41
0
 def validate(cls):
     return super(ECreditCard, cls).validate() + [
         appier.not_null("card_name"),
         appier.not_empty("card_name"),
         appier.not_null("card_number"),
         appier.not_empty("card_number"),
         appier.not_null("expiration_month"),
         appier.gte("expiration_month", 1),
         appier.lte("expiration_month", 12),
         appier.not_null("expiration_year"),
         appier.not_null("security_code"),
         appier.not_empty("security_code")
     ]
Exemple #42
0
    def validate(cls):
        return super(Replica, cls).validate() + [
            appier.not_null("origin_url"),
            appier.not_empty("origin_url"),
            appier.is_url("origin_url"),

            appier.not_null("target_url"),
            appier.not_empty("target_url"),
            appier.is_url("target_url"),

            appier.not_null("branches"),
            appier.not_empty("branches")
        ]
Exemple #43
0
    def validate(cls):
        return super(Media, cls).validate() + [
            appier.not_null("description"),
            appier.not_empty("description"),

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

            appier.not_null("order"),

            appier.not_null("file"),
            appier.not_empty("file")
        ]
Exemple #44
0
    def validate(cls):
        return super(Order, cls).validate() + [
            appier.not_null("s_id"),

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

            appier.not_null("s_total_price"),

            appier.not_null("s_status"),

            appier.not_null("payment")
        ]
    def validate(cls):
        return super(OAuthToken, cls).validate() + [
            appier.not_null("username"),
            appier.not_empty("username"),

            appier.not_null("scope"),
            appier.not_empty("scope"),
            appier.string_gt("scope", 0),

            appier.not_null("redirect_uri"),
            appier.not_empty("redirect_uri"),
            appier.is_url("redirect_uri"),

            appier.not_null("client")
        ]
Exemple #46
0
    def validate(cls):
        return super(OAuthToken, cls).validate() + [
            appier.not_null("username"),
            appier.not_empty("username"),

            appier.not_null("scope"),
            appier.not_empty("scope"),
            appier.string_gt("scope", 0),

            appier.not_null("redirect_uri"),
            appier.not_empty("redirect_uri"),
            appier.is_url("redirect_uri"),

            appier.not_null("client")
        ]
Exemple #47
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")
     ]
Exemple #48
0
    def validate(cls):
        return super(Label, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

            appier.not_duplicate("code", cls._name())
        ]
Exemple #49
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()),
     ]
Exemple #50
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")
     ]
Exemple #51
0
 def validate(cls):
     return super(EAddress, cls).validate() + [
         appier.not_null("first_name"),
         appier.not_empty("first_name"),
         appier.not_null("last_name"),
         appier.not_empty("last_name"),
         appier.not_null("address"),
         appier.not_empty("address"),
         appier.not_null("country"),
         appier.not_empty("country"),
         appier.not_null("city"),
         appier.not_empty("city"),
         appier.not_null("postal_code"),
         appier.not_empty("postal_code"),
         appier.not_null("phone_number"),
         appier.not_empty("phone_number"),
         appier.string_gt("phone_number", 7),
         appier.is_regex("phone_number", "^\+?[0-9\s]+$")
     ]
Exemple #52
0
 def validate_password_set(cls):
     return [appier.not_null("_password"), appier.not_empty("_password")]
Exemple #53
0
 def validate_password_confirm(cls):
     return [
         appier.not_null("_password_confirm"),
         appier.not_empty("_password_confirm"),
         appier.field_eq("_password_confirm", "_password")
     ]
Exemple #54
0
 def validate(cls):
     return super(Message, cls).validate() + [
         appier.not_null("receivers"),
         appier.not_empty("receivers")
     ]
 def validate(cls):
     return super(SomeModel, cls).validate() + [
         appier.not_null("field"),
         appier.not_empty("field")
     ]