On Fri, Mar 26, 2010 at 9:32 AM, grimmus <graham.col...@gmail.com> wrote:

> In the view:
>
> diary = Entry.objects.filter(status=1).order_by('-pub_date')[:5]
>
> t = loader.get_template('cms/page.html')
> c = RequestContext(request,{
>     'diary':diary,
> })
> return HttpResponse(t.render(c))
>

Is that diary = line really inside your view function? Since you have not
shown the actual view function definition it is hard to be sure. Based on
the behavior you describe it sounds like that line is not inside the view
function definition, and therefore possibly only executed once, when
views.py is loaded. If you want it to be executed when the view function is
called, it needs to be inside the view function itself.

Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to