OdifYltsaeb / django-multilingual

Automatically exported from code.google.com/p/django-multilingual
MIT License
0 stars 0 forks source link

multilingual.ModelAdmin assumes inlines is a list #100

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This should be a quick fix. The code

class SectionAdmin(multilingual.ModelAdmin):
    list_display = ('title', 'order', 'url', 'type')
    prepopulated_fields = {'url': ('title',)}
    inlines = (ImageInline,)

crashes in multilingual_modeladmin_new:191 with

  cls.inlines.insert(0, translation_modeladmin)

Changing "inlines" to [ImageInline] and it works. Probably change the above to

  cls.inlines = [translation_modeladmin] + cls.inlines

or even

  cls.inlines = type(cls.inlines)((translation_modeladmin,))

to avoid changing the type of inlines (the above works with both lists and
tuples).

This is with r174.

Original issue reported on code.google.com by olau%iol...@gtempaccount.com on 29 May 2009 at 4:07

GoogleCodeExporter commented 8 years ago
Indeed, I can verify this.

Will look into it, thanks for reporting.

Original comment by panos.la...@gmail.com on 16 Dec 2009 at 10:43

GoogleCodeExporter commented 8 years ago
r183 should fix it. Enjoy :)

Original comment by panos.la...@gmail.com on 16 Dec 2009 at 11:43