Beispiel #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")
        ]
Beispiel #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")
        ]
Beispiel #3
0
 def validate_new(cls):
     return super(Set, cls).validate_new() + [
         quorum.not_null("set_id"),
         quorum.not_empty("set_id"),
         quorum.string_gt("set_id", 1),
         quorum.string_lt("set_id", 64),
         quorum.not_duplicate("set_id", cls._name())
     ]
Beispiel #4
0
 def validate_new(cls):
     return super(Camera, cls).validate_new() + [
         quorum.not_null("camera_id"),
         quorum.not_empty("camera_id"),
         quorum.string_gt("camera_id", 2),
         quorum.string_lt("camera_id", 64),
         quorum.not_duplicate("camera_id", cls._name())
     ]
Beispiel #5
0
def validate_app():
    return [
        quorum.not_null("name"),
        quorum.not_empty("name"),
        quorum.string_gt("name", 4),
        quorum.string_lt("name", 20),
        quorum.not_duplicate("name", "apps"),

        quorum.not_null("description"),
        quorum.not_empty("description"),
    ]
Beispiel #6
0
    def validate_new(cls):
        return super(Device, cls).validate_new() + [
            quorum.not_null("device_id"),
            quorum.not_empty("device_id"),
            quorum.string_gt("device_id", 2),
            quorum.string_lt("device_id", 64),
            quorum.not_duplicate("device_id", cls._name()),

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

            quorum.not_null("model_d"),
            quorum.not_empty("model_d")
        ]
Beispiel #7
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")
        ]