Pull requests

#3 Open
Repository
Lacrymology Lacrymology
Branch
optional-meta
Repository
brankovukelic brankovukelic
Branch
master

if Meta doesn't exist, create an empty class for it

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

git checkout master
git remote add Lacrymology/django-i18n-model https://bitbucket.org/Lacrymology/django-i18n-model.git
git fetch Lacrymology/django-i18n-model
git merge --no-ff -m 'Merged in Lacrymology/django-i18n-model/optional-meta (pull request #3)' remotes/Lacrymology/django-i18n-model/optional-meta
Author
  1. Tomas Neme
Reviewers
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.

Comments (0)