Beispiel #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")
     ]
Beispiel #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")
     ]
Beispiel #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")
     ]
Beispiel #4
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")
        ]
Beispiel #5
0
    def validate(cls):
        return super(Asset, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

            appier.not_null("node")
        ]
Beispiel #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")
     ]
Beispiel #7
0
    def validate(cls):
        return super(Measurement, cls).validate() + [
            appier.not_null("name"),
            appier.not_empty("name"),

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

            appier.not_duplicate("code", cls._name())
        ]
Beispiel #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()),
     ]
Beispiel #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")
     ]
Beispiel #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]+$")
     ]
Beispiel #52
0
 def validate_password_set(cls):
     return [appier.not_null("_password"), appier.not_empty("_password")]
Beispiel #53
0
 def validate_password_confirm(cls):
     return [
         appier.not_null("_password_confirm"),
         appier.not_empty("_password_confirm"),
         appier.field_eq("_password_confirm", "_password")
     ]
Beispiel #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")
     ]