Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed two bugs:

- form.manipulator.model becomes form._meta.model
- added fourth, optional, parameter to Model __new__ method
  • Loading branch information...
commit 3464e9ae909e3f1209ccb0428dc64b9fb4a58f71 1 parent e4c60cb
joost@cassee.net authored
View
2  multilingual/templatetags/multilingual_tags.py
@@ -45,7 +45,7 @@ def __init__(self, form_name, field_name, language=None):
def render(self, context):
form = resolve_variable(self.form_name, context)
- model = form.manipulator.model
+ model = form._meta.model
trans_model = model._meta.translation_model
if self.language:
language_id = self.language.resolve(context)
View
4 multilingual/translation.py
@@ -369,7 +369,7 @@ def multilingual_modelbase_new(cls, name, bases, attrs):
# editor for multilingual models.
_old_admin_new = ModelAdmin.__new__
- def multilingual_modeladmin_new(cls, model, admin_site):
+ def multilingual_modeladmin_new(cls, model, admin_site, obj=None):
if isinstance(model.objects, manager.Manager):
X = cls.get_translation_modeladmin(model)
if cls.inlines:
@@ -380,7 +380,7 @@ def multilingual_modeladmin_new(cls, model, admin_site):
cls.inlines.append(X)
else:
cls.inlines = [X]
- return _old_admin_new(cls, model, admin_site)
+ return _old_admin_new(cls, model, admin_site, obj)
def get_translation_modeladmin(cls, model):
if hasattr(cls, 'Translation'):

0 comments on commit 3464e9a

Please sign in to comment.
Something went wrong with that request. Please try again.