Model Translations

That error is caused by this:

The template field in the TemplateFields model is a foreign key to Templates, so your queryset must return instances of Templates, not TemplateFields.

What you’re probably going to want to do here is use the iterator attribute of the ModelChoiceField to create a custom representation of the select options.

You would still have a custom queryset - one that annotates the desired translation in the Templates model instances. You would then add the custom subclass as described in the docs to return that annotated value as the display option for that field.

1 Like