Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ojford/marshmallow-dataclass-djangofield
Use a marshmallow dataclass as a Django Field
https://github.com/ojford/marshmallow-dataclass-djangofield
dataclass django field marshmallow orm
Last synced: about 1 month ago
JSON representation
Use a marshmallow dataclass as a Django Field
- Host: GitHub
- URL: https://github.com/ojford/marshmallow-dataclass-djangofield
- Owner: OJFord
- License: mit
- Created: 2019-09-27T17:34:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-04T11:22:41.000Z (almost 2 years ago)
- Last Synced: 2024-11-29T03:27:29.511Z (about 2 months ago)
- Topics: dataclass, django, field, marshmallow, orm
- Language: Python
- Homepage: https://pypi.org/project/marshmallow-dataclass-djangofield/
- Size: 32.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Use [marshmallow-dataclass](https://github.com/lovasoa/marshmallow_dataclass)es as [Django](https://github.com/django/django) Fields.
## Usage
```python
from marshmallow_dataclass_djangofield import MarshmallowField
from marshmallow_dataclass_djangofield import marshmallow_dataclass_djangofieldclass MyModel(Model):
@marshmallow_dataclass_djangofield(model_name='MyModel')
@marshmallow_dataclass.dataclass
class MyDataClass:
foo: str
bar: intfoobars = MarshmallowField(many=True, schema=MyDataClass)
```