On Tuesday 14 March 2006 21:43, Viktor Kerkez wrote: > 1. Why are the generic views from list_detail package different from > the views from create_update package. > > When I use create_object or update_object, I have to pass to it > {'model' : MyModel} dict, but when I use object_list I have to do: > > from django.db.models.query import QuerySet > info_dict = {'queryset' : QuerySet(model=MyModel)}
The list_detail is fundamentally different from create/update - the former is just used for displaying a set of objects (which might have additional filters), but the create/update views need a model class since they will be creating/changing instances of that class. The way I had anticipated using the queryset parameter was: info_dict = {'queryset' : MyModel.objects.all() } ... so you don't have to import QuerySet. > 2. Why does the object_list return 404 when my table is empty, > instead of rendering the template with object_list variable beeing an > empty list. You can pass 'allow_empty=True' to get the behaviour you want. I think personally that should be the default -- IIRC there is a ticket about this. Luke -- "Whom have I in heaven but You? And there is none upon earth that I desire besides You." Psalm 73:25 Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---