Skip to main content

Use marshmallow-dataclass as a Django Field

Project description

Use marshmallow-dataclasses as Django Fields.

Usage

from marshmallow_dataclass_djangofield import MarshmallowField
from marshmallow_dataclass_djangofield import marshmallow_dataclass_djangofield



class MyModel(Model):

    @marshmallow_dataclass_djangofield(model_name='MyModel')
    @marshmallow_dataclass.dataclass
    class MyDataClass:
        foo: str
        bar: int

    foobars = MarshmallowField(many=True, schema=MyDataClass)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page