Wednesday, June 22, 2011

Re: templatetags and refresh

On Wednesday, 22 June 2011 14:32:10 UTC+1, Wim Feijen wrote:
Hello,

At www.mkb-rotterdam.nl we use a template tag to display NewsItems in
different formats on the homepage.

However, when a new NewsItem is added, it does not appear at once.

Might this have to do with the fact that we use a template tag to get
the NewsItems out of the db?

Our query is:

newsitems = NewsItem.objects.filter(Q(expires_at__gt = datetime.now())
| Q(expires_at__isnull = True), effective_at__lte = datetime.now(),
is_active=True).order_by('-news_timestamp')

Or is datetime.now() fixed to the past?

What would be a proper way to solve this then? Maybe add a post-save
signal but how could we use this then to refresh the tag?

If something else is the matter, or just if you're interested: we host
our site using a virtual apache + mod_wsgi + nginx.

Thanks for your help!

Wim



Please show the full code for the templatetag.
--
DR. 

--
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/-/-9ELyqjEGxwJ.
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