thegooglecodearchive / django-grappelli

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

ModelList does not string-match as expected #356

Closed GoogleCodeExporter closed 9 years ago

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

Which GRAPPELLI-VERSION are you using?
2.3.2

What steps will reproduce the problem?
self.children.append(modules.ModelList(
            _('Just one model'),
            column=1,
            collapsible=False,
            models = ('myapp.mymodel',)
        ))

What is the expected output? What do you see instead?
Create block on the dashboard which contains only the model mymodel.

There is no extra block created on the dashboard.

Additionally if the second to last line of the above code is changed to:
            models = ('myapp.mymodel.*',)
All of the models from myapp are included in the new block

Original issue reported on code.google.com by ndudenho...@gmail.com on 16 Mar 2011 at 12:22

GoogleCodeExporter commented 9 years ago
first off, grappelli 2.3+ requires django 1.3+ (resp. django trunk). I´m not 
sure if this causes the issue, but I can´t reproduce it with a not-supported 
django-version.

Original comment by sehmaschine on 16 Mar 2011 at 12:29

GoogleCodeExporter commented 9 years ago
I just updated to Django 1.3RC1

And still cannot create the block with a single model.

models = ('myapp.*',)  produces a block with all of the models in myapp
models = ('myapp.mymodel',)  does not show up in dashboard
models = ('myapp.mymodel.*',) also does not show up in dashboard (contrary to 
my earlier experience)

Original comment by ndudenho...@gmail.com on 16 Mar 2011 at 1:00

GoogleCodeExporter commented 9 years ago

Original comment by sehmaschine on 16 Mar 2011 at 8:06

GoogleCodeExporter commented 9 years ago
the correct implementation is:

models = ('myapp.*',)  produces a block with all of the models in myapp
models = ('myapp.models.*',)  same as before
models = ('myapp.models.MyModel',) single model

does that answer your question? if yes, I´m going to update the docs.

Original comment by sehmaschine on 17 Mar 2011 at 3:01

GoogleCodeExporter commented 9 years ago
Yes, that works.  Thank you for clarifying.

After looking back at the docs, they are not wrong.  That was a foolish mistake 
on my part (of course you need to specify 'models'), but some more explicit 
clarification in the docs would be nice.

Original comment by ndudenho...@gmail.com on 17 Mar 2011 at 3:09

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1421.

Original comment by sehmaschine on 17 Mar 2011 at 3:11