class ImageAsset(Model, TestModelMixin): default_fields = [ 'topics', 'attributes.imageFormat', 'attributes.imageType' ] title = StringProperty() version = StringProperty(default='1') description = StringProperty() name = StringProperty() skills = StringProperty(repeated=True) topics = KeyProperty(kind=Tag, repeated=True) publicationDate = AttributesProperty( attributes={'year': IntegerProperty()}) attributes = AttributesProperty( attributes={ 'imageFormat': KeyProperty(kind=Tag, repeated=True), 'imageType': KeyProperty(kind=Tag, repeated=True), 'files': AttributesProperty(attributes={ 'url': StringProperty(), 'bucket_key': StringProperty(), 'mime_type': StringProperty(), 'height': IntegerProperty(), 'width': IntegerProperty() }, repeated=True) })
class Edge(Model, CassandraModelMixin): _storage_type = ('simple',) label = StringProperty() indoc = KeyProperty() outdoc = KeyProperty() create_date = DateTimeProperty(auto_now_add=True) last_update = DateTimeProperty(auto_now=True)
class VideoAsset(Model, CassandraModelMixin): title = StringProperty(default='monkey') music = 'rock' num = IntegerProperty() def _pre_put_hook(self): self.music = 'metal' @key_ref def revision(self): if hasattr(self, 'version'): return self.version return '1'
class Tag(Model, TestModelMixin): title = StringProperty()
class Article(Model, TestModelMixin): revision = IntegerProperty(default=1) title = StringProperty()
class Book(Model, TestModelMixin): title = StringProperty() published = DateTimeProperty(auto_now_add=True) updated = DateTimeProperty(auto_now=True)
class AudioAsset(Model): titles = StringProperty(repeated=True)
class ImageAsset(Model): title = StringProperty() description = StringProperty()