I'm trying to use Marcin Kaszynski's django-multilingual plugin, but
when I try to use the add action in the admin interface for a
translatable class, I get an exception:
-------------
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py"
in get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/
decorators.py" in _checklogin
55. return view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/views/decorators/
cache.py" in _wrapped_view_func
39. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/
main.py" in add_stage
298. return render_change_form(model, manipulator, c, add=True)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/views/
main.py" in render_change_form
196. first_form_field_id =
bound_field_sets[0].bound_field_lines[0].bound_fields[0].form_fields[0].get_id();
IndexError at /nplay/admin/reservation/play/add/
list index out of range
-------------
It seems like bound_field_sets is empty at line 196
Here's my model:
-------------
import multilingual
class Play(models.Model):
class Translation(multilingual.Translation):
name = models.CharField(maxlength=100)
description = models.TextField()
short_description = models.CharField(maxlength=200)
class
Admin:
pass
-------------
I'm using the svn trunk of django and django-multilingual, running on
Python 2.5 (Ubuntu 7.04)
Any ideas about what might be missing?
I was hit by the same problem. If you add a property to your class
Play (not to the Translation one) then Translation will be able to
bound to something visible in Admin and it will work.
It's more of a workaround then real solution, but if you are in a
hurry it could be useful.
regards,
Jure Cuhalev
That worked. Thank you very much!
On May 13, 9:38 pm, Jan Söderback <jsode...@gmail.com> wrote:
> Any ideas about what might be missing?
it is a bug in Django admin interface -- the edit view assumes that
the model has at least one editable field. You can either use Jure's
workaround or patch your copy of Django. See this ticket for details
and a patch:
http://code.djangoproject.com/ticket/3434
Regards,
-mk