Tuesday, November 30, 2010

Re: missing object in object_list generic view

Start by reading http://www.b-list.org/weblog/2006/nov/16/django-tips-get-most-out-generic-views/ and finish by writing one (or many!) wrapper function(s) as suggested.

It will make your code 1) readable, 2) easier to debug, 3) extensible, 4) powerful, and 5) DRY.


Cheers,
Andre Terra

On Tue, Nov 30, 2010 at 17:20, Carlos Aboim <aboim2@gmail.com> wrote:
It's very strange, got this:
urls
info_dict = {
   'Queryset': Obra.objects.all (),
   }

(r'index / $ ',' django.views.generic.list_detail.object_list ',
info_dict, dict (name = "obras_index", template_object_name = 'obras',
paginate_by = 5)),

template
[...]
{% For book in the works%}
<h2> obra.numero {{}} </ h2>    ## example
[...]

and what appears in place of the list of objects paged out of 5 in 5,
is
"Page of"

I'm missing the queryset variable somehow

What can I do to solve the problem

thank you
Aboim

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment