Wednesday, June 22, 2011

templatetags and refresh

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


--
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


Real Estate