if Meta doesn't exist, create an empty class for it
Tomas Neme
Branch: Deleted repository:optional-meta
Deleted repository:optional-meta
Branch: brankovukelic/django-i18n-model:master
brankovukelic/django-i18n-model:master
Open
#3 · Created  · Last updated
Description
All properties in the Meta class are optional, if you name your translation model MyModelI18N you don't need a source_model attribute, and if you want all fields to be translatable you don't need a translation_fields attribute.
But the current code in this file makes it necessary to have at least this:
class MyModelI18N(I18nModel):
class Meta:
pass
A better solution might be either using the attr_meta variable or adding KeyError to the exception catching all over this file.
All properties in the Meta class are optional, if you name your translation model
MyModelI18N
you don't need asource_model
attribute, and if you want all fields to be translatable you don't need atranslation_fields
attribute.But the current code in this file makes it necessary to have at least this:
class MyModelI18N(I18nModel): class Meta: pass
A better solution might be either using the
attr_meta
variable or addingKeyError
to the exception catching all over this file.