class Profile(models.DomainModel): id = fields.Int() name = fields.String() main_photo = fields.Model(Photo, default=default_photo) photos = fields.Collection(Photo) birth_date = fields.Date() something = fields.String(default='def-val')
class Profile(models.DomainModel): """Profile model to be tested.""" id = fields.Int() name = fields.String() birth_date = fields.Date() business_address = fields.String() home_address = fields.String() main_photo = fields.Model(Photo) photos = fields.Collection(Photo)
class User(models.DomainModel): """Test user domain model.""" id = fields.Int() email = fields.String() first_name = fields.String() last_name = fields.String() gender = fields.String() birth_date = fields.String()
class ExampleModel(models.DomainModel): """Example model.""" field = fields.Field() field_default = fields.Field(default=123) field_default_callable = fields.Field(default=time.time) field_required_default = fields.Field(default=123, required=True) bool_field = fields.Bool() int_field = fields.Int() float_field = fields.Float() string_field = fields.String() binary_field = fields.Binary() date_field = fields.Date() datetime_field = fields.DateTime() model_field = fields.Model(RelatedModel) collection_field = fields.Collection(RelatedModel)
class Photo(models.DomainModel): """Photo model to be attached to profile.""" id = fields.Int() title = fields.String() path = fields.String() public = fields.Bool(default=False)
class Model(models.DomainModel): """Test domain model with multiple unique key.""" id = fields.Int() email = fields.String() __unique_key__ = (id, email)
class Profile(models.DomainModel): id = fields.Int() name = fields.String() main_photo = fields.Model(Photo) photos = fields.Collection(Photo) birth_date = fields.Date()
class Photo(models.DomainModel): id = fields.Int(required=True) storage_path = fields.String(required=True)
class Photo(models.DomainModel): id = fields.Int() storage_path = fields.String( default='some/dir/where/photos/live/default.jpg')
class Model(models.DomainModel): """Test model.""" field = fields.String()
class Photo(models.DomainModel): id = fields.Int() storage_path = fields.String()