Beispiel #1
0
def category_name(value):
    IsReasonableLengthString()(value)

    if Category.objects.filter(name=value).exists():
        raise ValidationFailure('category name already exists', HTTP_409_CONFLICT)

    return value
Beispiel #2
0
 def __call__(self, location):
     (HasKey('description') & IsReasonableLengthString())(location)
     (HasKey('latitude') & OfType(float))(location)
     (HasKey('longitude') & OfType(float))(location)
Beispiel #3
0
def user_display_name(value):
    IsReasonableLengthString()(value)
    return value
Beispiel #4
0
def user_password(value):
    IsReasonableLengthString()(value)
    return value
Beispiel #5
0
def chat_name(value):
    IsReasonableLengthString()(value)
    return value
Beispiel #6
0
def message_content(value):
    IsReasonableLengthString()(value)
    return value
Beispiel #7
0
def group_description(value):
    IsReasonableLengthString()(value)
    return value
Beispiel #8
0
def group_name(value):
    IsReasonableLengthString()(value)
    return value
Beispiel #9
0
def user_last_name(value):
    IsReasonableLengthString()(value)
    return value