Model mixin to return all field data in a dictionary
Get all field data, e.g. for an export.
- models
- model
- export
- orm
- metaprogramming
Get all field data, e.g. for an export.
Enables convenient adding of fields, methods and properties to Django models. Instead of: User.add_to_class('foo', models.CharField(...) User.add_to_class('bar', models.IntegerField(...) you can write: class UserMixin(ModelMixin): model = User foo = models.CharField(...) bar = models.IntegerField(...)
2 snippets posted so far.