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