Created
November 26, 2012 01:44
-
-
Save theorm/4146165 to your computer and use it in GitHub Desktop.
This file contains 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 Location(Document): | |
structure = { | |
"ll" : validate_coordinates, | |
"street" : ... | |
... | |
} | |
class Venue(Document): | |
structure = { | |
"location" : Location.validate, | |
"name" : unicode, | |
... | |
} | |
@property | |
def location(self): | |
# should be cached | |
return Location(self['location']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In fact that isn't even really necessary... it's just a list so we could override the validate() method on the Venue and implement the check there...