3 ms·
Correct answer: @sql @dataclass class Comment: body: str date: Date Any db specific Metadata can be specified via fields.
by adsharma 6y ago
Correct answer:
@sql
@dataclass
class Comment:
body: str
date: Date
Any db specific Metadata can be specified via fields.
- blackrobot 6y agoWhere does the `@sql` decorator come from? If it's not adding attributes that are django specific, then you lose most of django's functionality built around models: automatic admin, user model, etc...
- adsharma 6y agoAn idea that I submitted for discussion here: https://github.com/ppinard/dataclasses-sql/issues/4 https://github.com/ppinard/dataclasses-sql/issues/4 My belief is that the django functionality can be added back in the form of decorators. I have similar work to add @graphql to python dataclasses.