Exemple #1
0
 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')
Exemple #2
0
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)
Exemple #3
0
        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()
Exemple #4
0
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)
Exemple #5
0
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)
Exemple #6
0
        class Model(models.DomainModel):
            """Test domain model with multiple unique key."""

            id = fields.Int()
            email = fields.String()
            __unique_key__ = (id, email)
Exemple #7
0
 class Profile(models.DomainModel):
     id = fields.Int()
     name = fields.String()
     main_photo = fields.Model(Photo)
     photos = fields.Collection(Photo)
     birth_date = fields.Date()
Exemple #8
0
 class Photo(models.DomainModel):
     id = fields.Int(required=True)
     storage_path = fields.String(required=True)
Exemple #9
0
 class Photo(models.DomainModel):
     id = fields.Int()
     storage_path = fields.String(
         default='some/dir/where/photos/live/default.jpg')
Exemple #10
0
 class Model(models.DomainModel):
     """Test model."""
     field = fields.String()
Exemple #11
0
class Photo(models.DomainModel):
    id = fields.Int()
    storage_path = fields.String()