You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where I would like to store localized fields that are not CharField or TextField fields.
I'd like to start with adding JSONField, which seems to work pretty well.
I would also like to explore FileField. That field just stores a path in the database, but will need some additional work to wrap it so it returns FieldFile instance as expected.
The text was updated successfully, but these errors were encountered:
I started out with #119 and #120 after reading this in the docs:
Behavior is tested using CharField() and TextField(), as these make most sense for translated values. Additional fields could make sense, and will likely work, but need extra test coverage.
I have also considered an alternate approach to satisfying #118 that I could draft and submit as a PR. This approach would replace #119 and #120 by pushing out to project-specific configuration, e.g., providing MODELTRANS_ settings to customize:
The supported fields (MODELTRANS_SUPPORTED_FIELDS)
The TranslatedVirtualField class (which a subclass could be used to override the FileField functionality) (MODELTRANS_VIRTUAL_FIELD_CLASS)
The TranslationField class (which a subclass could be used to override the pre_save functionality) (MODELTRANS_TRANSLATION_FIELD_CLASS)
I have a use case where I would like to store localized fields that are not
CharField
orTextField
fields.I'd like to start with adding JSONField, which seems to work pretty well.
I would also like to explore
FileField
. That field just stores a path in the database, but will need some additional work to wrap it so it returnsFieldFile
instance as expected.The text was updated successfully, but these errors were encountered: