RE: Problem with DetailView
To do what? I'm trying to lead you to conclussions, but i seem to be leading you to confusion instead.
You should read the generic views docs again. For any single object view, the default object name is 'object', unless you set the context_object_name parameter. The list view calls it 'objects'. The template name doesn't need to be set up either, if you don't want to, it will default to '<appname>/<model>_list.html (or _detail.html)
-----Mensaje original-----
De: Soviet
Enviados: 08/07/2012 15:47:06
Asunto: Re: Problem with DetailView
Ha! Thank you and sorry for my stupidity. I was confused by the fact that I
didn't had to do this in {for ... in ...}.
W dniu niedziela, 8 lipca 2012 19:05:17 UTC+2 użytkownik Tomas Neme napisał:
>
> Man...
>
> > (r'^sets/(?P<pk>\d+)/$', SetDetailView.as_view(
> > model=Set,
> > context_object_name="set_details",
> > template_name='data/set_details.html',
> > )),
> >
> > But the site is empty. Here's my extremely simple template:
> >
> > {% block title %}{{ set.text_name }}{% endblock %}
> >
> > {% block content %}
> > <h2>Set:</h2>
> >
> > {{ set.theme }} - {{ set.subtheme }}
> > {% endblock %}
>
> and where, pray, would that 'set' variable be populated when you very
> explicitly told the DetailView you wanted your context object named
> 'set_details'?
>
> --
> "The whole of Japan is pure invention. There is no such country, there
> are no such people" --Oscar Wilde
>
> |_|0|_|
> |_|_|0|
> |0|0|0|
>
> (\__/)
> (='.'=)This is Bunny. Copy and paste bunny
> (")_(") to help him gain world domination.
>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/0yKZyt9Wzd4J.
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home