예제 #1
0
class LikeSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Like

    dog_id_give = ma.auto_field()
    dog_id_receive = ma.auto_field()
    match = ma.auto_field()
예제 #2
0
class PhotoSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Photo

    id = ma.auto_field()
    dog_account_id = ma.auto_field()
    link = ma.auto_field()
예제 #3
0
class ConversationSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Conversation

    id = ma.auto_field()
    time_started = ma.auto_field()
    messages = fields.Nested(MessageSchema, many=True)
    dogs = ma.auto_field()
class UserSchema(ma.SQLAlchemySchema):
    class Meta:
        model = UserModel
        # fields = ("id", "name", )

    id = ma.auto_field()
    email = ma.auto_field()
    name = ma.auto_field()
예제 #5
0
class InterestSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Interest

    id = ma.auto_field()

    dog_id = ma.auto_field()
    breed_id = ma.auto_field()
    gender_interest = ma.auto_field()
예제 #6
0
class MessageSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Message

    id = ma.auto_field()
    message = ma.auto_field()
    ts = ma.auto_field()
    dog_id = ma.auto_field()
    conversation_id = ma.auto_field()
예제 #7
0
class UserSchema(ma.SQLAlchemySchema):
    """ Serializer to users """
    class Meta:
        """ From where fields will come """
        model = User

    id = ma.auto_field()
    name = ma.auto_field()
    email = ma.auto_field()
    is_admin = ma.auto_field()
예제 #8
0
class OrderSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Order

    id = ma.auto_field()
    status = ma.auto_field()
    date = ma.auto_field()
    payment_method = ma.auto_field()
    total_price = ma.auto_field()
    products = fields.Nested(ProductSchema, many=True)
예제 #9
0
class DogSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Dog

    id = ma.auto_field()
    name = ma.auto_field()
    details = ma.auto_field()
    owner_id = ma.auto_field()
    breed = fields.Nested(BreedSchema)
    gender = ma.auto_field()
    conversations = fields.Nested(ConversationSchema, many=True)
    photos = fields.Nested(PhotoSchema, many=True)
    interest = fields.Nested(InterestSchema, many=True)
예제 #10
0
class ProductSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Product

    id = ma.auto_field()
    name = ma.auto_field()
    price = ma.auto_field()
    description = ma.auto_field()
    image = ma.auto_field()
    category_id = ma.auto_field()
예제 #11
0
class OwnerSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Owner

    id = ma.auto_field()
    name = ma.auto_field()
    surname = ma.auto_field()
    document = ma.auto_field()
    email = ma.auto_field()
    address = ma.auto_field()

    dogs = fields.Nested(dog_model.DogSchema, many=True)
예제 #12
0
class BreedSchema(ma.SQLAlchemySchema):
    class Meta:
        model = Breed

    id = ma.auto_field()
    name = ma.auto_field()
예제 #13
0
class CategorySchema(ma.SQLAlchemySchema):
    class Meta:
        model = Category

    id = ma.auto_field()
    name = ma.auto_field()