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.

Files for marshmallow-dataclass-djangofield, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size marshmallow_dataclass_djangofield-0.3.0-py3-none-any.whl (3.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size marshmallow-dataclass-djangofield-0.3.0.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page