from marshmallow import fields  # NOQA F401
from marshmallow_enum import EnumField  # NOQA F401

from hobbit_core.schemas import PagedSchema, ModelSchema

from app.models import {{ metadata | join(', ') }}


{% for model_name, Model in metadata.items() -%}
class {{ model_name }}Schema(ModelSchema):

    class Meta:
        model = {{ model_name }}


class Paged{{ model_name }}Schema(PagedSchema):
    items = fields.Nested({{ model_name }}Schema, many=True)


{{ Model.singular }}_schema = {{ model_name }}Schema()
paged_{{ Model.singular }}_schemas = Paged{{ model_name }}Schema()
{% if not loop.last %}

{% endif %}
{%- endfor %}