Last active
October 14, 2018 03:29
-
-
Save jtemporal/772722f88e7aabe25d659bda0c515361 to your computer and use it in GitHub Desktop.
v8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cachorrinho(Model): | |
nome = StringType(required=True, deserialize_from="name", | |
serialized_name="name") | |
cor = StringType(required=True, deserialize_from="fur", | |
serialized_name="fur") | |
def validate_nome(self, data, value): | |
if data['nome'].capitalize() != data['nome']: | |
raise ValidationError('Pet name is not capitalized!') | |
return value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment