New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Contributing] Thoughts on adding a contrib
folder for dataclass
support?
#75
Comments
Could you please describe the use case for |
In the Python code, we'd work with dataclasse, rather than Dicts. In the DB, it gets stored as a JSON. Basically dataclass with a JSON schema get serialized/deserialized as JSON. |
This makes good sense for |
Pseudo code example: @dataclass
class Foo:
x: int
class MyModel:
foo = DataclassJSONField(Foo)
foo_list = DataclassJSONField(Foo, many=True)
m = MyModel.objects.first()
assert isinstance(m.foo, Foo)
assert isinstance(m.foo_list, list)
assert isinstance(m.foo_list[0], Foo) |
That does sound useful. Alright, I'm open to include this in the library. Kindly open a PR. Thank you. |
I am @ghost |
Hi @bhch , I'm working on a project which requires
django-jsonform
+dataclasses-jsonschema
.I feel this project could be quite useful to the Django community. So I want to make this functionality public.
Would you be OK if I make PRs to add a
contrib/dataclasses
folder?E.g.,
from django_jsonform.contrib.dataclasses import DataclassJSONField
The text was updated successfully, but these errors were encountered: