django-dynamic-models
django-dynamic-models copied to clipboard
FieldSchema: support for 'db_column' option
It would be nice if user could specify the db_column option for FieldSchema.
I need uppercase field names and as workaround I have to monkey patch the get_options method to inject the db_column option.
@pyMan the 0.4 release will include a major change in the way field schema are defined. A class path and a JSON field of kwargs will be used to construct the dynamic model's Field instances.
I believe this should support your use case. The master branch is updated but there are still some things to clean up that I haven't gotten around to yet.
@rvinzent ok thank you. Just afraid of JSONField is not supported by all databases, like mssql.
@pyMan in the latest versions of Django, JSONField was moved into the core fields. I believe they were able to do this because there is now broad database support in most or all of their supported backends.
I also think the flexibility that the feature will add is a worthwhile trade off because it should enable users to dynamically construct any field that can be constructed using JSON serializable kwargs, even custom fields not defined in core Django.