Open jacobwegner opened 5 months ago
I started out with #119 and #120 after reading this in the docs:
Behavior is tested using
CharField()
andTextField()
, 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:
MODELTRANS_SUPPORTED_FIELDS
)TranslatedVirtualField
class (which a subclass could be used to override the FileField
functionality) (MODELTRANS_VIRTUAL_FIELD_CLASS
)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.