Example #1
0
    def validate_new(cls):
        return super(Account, cls).validate_new() + [
            quorum.not_null("username"),
            quorum.not_empty("username"),
            quorum.string_gt("username", 4),
            quorum.string_lt("username", 64),
            quorum.not_duplicate("username", cls._name()),

            quorum.not_null("password"),
            quorum.not_empty("password"),

            quorum.not_null("password_confirm"),
            quorum.not_empty("password_confirm"),

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

            quorum.not_null("email_confirm"),
            quorum.not_empty("email_confirm"),

            quorum.not_null("plan"),
            quorum.not_empty("plan"),
            quorum.is_in("plan", ("test", "basic", "advanced")),

            quorum.equals("password_confirm", "password"),
            quorum.equals("email_confirm", "email")
        ]
Example #2
0
    def validate_new(cls):
        return super(Account, cls).validate_new() + [
            quorum.not_null("username"),
            quorum.not_empty("username"),
            quorum.string_gt("username", 4),
            quorum.string_lt("username", 64),
            quorum.not_duplicate("username", cls._name()),

            quorum.not_null("password"),
            quorum.not_empty("password"),

            quorum.not_null("password_confirm"),
            quorum.not_empty("password_confirm"),

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

            quorum.not_null("email_confirm"),
            quorum.not_empty("email_confirm"),

            quorum.not_null("plan"),
            quorum.not_empty("plan"),
            quorum.is_in("plan", ("test", "basic", "advanced")),

            quorum.equals("password_confirm", "password"),
            quorum.equals("email_confirm", "email")
        ]
Example #3
0
 def validate(cls):
     return super(Contact, cls).validate() + [
         quorum.not_null("name"),
         quorum.not_empty("name"),
         quorum.not_null("email"),
         quorum.not_empty("email"),
         quorum.is_email("email")
     ]
Example #4
0
    def validate(cls):
        return super(Contact, cls).validate() + [
            quorum.not_null("name"),
            quorum.not_empty("name"),

            quorum.not_null("email"),
            quorum.not_empty("email"),
            quorum.is_email("email")
        ]
Example #5
0
    def validate_new(cls):
        return super(Account, cls).validate_new() + [
            quorum.not_null("username"),
            quorum.not_empty("username"),
            quorum.string_gt("username", 1),
            quorum.string_lt("username", 64),
            quorum.not_duplicate("username", cls._name()),

            quorum.not_null("password"),
            quorum.not_empty("password"),

            quorum.not_null("password_confirm"),
            quorum.not_empty("password_confirm"),

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

            quorum.not_null("type"),

            quorum.not_null("cameras")
        ]