I'm creating a website and it needs support for internationalization. The default languages are Portuguese, English and Spanish. I'm using the django-i18nmodel and so far it works great.
When the admin wants to create a product, using django-admin, by default I create 3 inLine items of the model ProductI18N.
class LanguageStackedInline(admin.StackedInline):
model = ProductI18N
extra = 1
I want to create these 3 rows with the 3 default languages I mentioned above (pt-PT, en-US, es-ES). I know that in the Model I can only set a default value.
Does Django provide an easy way of doing this?
Provide a custom formset class for the inline admin:
You can take a look at the documentation on admin and inline formsets for more notes on customization.