thegooglecodearchive / django-grappelli

Automatically exported from code.google.com/p/django-grappelli
Other
0 stars 0 forks source link

Problem with adminform.model_admin in change_form.html #385

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which DJANGO-VERSION are you using?
1.2.4

Which GRAPPELLI-VERSION are you using?
2.3.2

Which BROWSER (including the version) are you using?
Chrome 12.0.742.112

What steps will reproduce the problem?
1. Create a model (MyModel) with a generic foreign key (with 'content_type' and 
'object_id' fields)
2. Add related_lookup_fields = {
        'generic': [['content_type', 'object_id']],
    }
    to the ModelAdmin for MyModel
3. Go to admin page to edit or create an instance of MyModel

What is the expected output? What do you see instead?
I expect to see the generic selection tool, but it doesn't show up when editing 
MyModel. It will show up for a MyModel Inline, though, if MyModel is included 
as an inline for a parent model. 

Please provide any additional information below.
It seems like the problem is with adminform.model_admin causing a template 
error in change_form.html, so the get_related_lookup_fields_generic tag doesn't 
actually get the related 'generic' lookup fields. I tried debugging it by 
creating a change_form that extends the base change_form, and when I tried 
displaying {{ adminform.model_admin }} in the template, a template string error 
happens, but when I passed in adminfor to a temporary templatetag that just 
printed adminform.model_admin, everything was output correctly.

Original issue reported on code.google.com by e...@jumo.com on 8 Jul 2011 at 2:15

GoogleCodeExporter commented 9 years ago
grappelli 2.3 requires django 1.3 ... with django 1.2, you need to use 
grappelli 2.2

Original comment by sehmaschine on 8 Jul 2011 at 2:18