Re: templatetags and refresh

2011-06-24 Thread bruno desthuilliers
On Jun 24, 4:02 pm, Wim Feijen wrote: > Thanks Bruno for your detailed advice and attention! > Sorry I didn't have time to provide relevant pointers (which I usually do) :-/ -- You received this message because you are subscribed to the Google Groups "Django users"

Re: templatetags and refresh

2011-06-24 Thread Wim Feijen
Thanks Bruno for your detailed advice and attention! I agree wholeheartedly. Wim On Jun 24, 12:53 pm, bruno desthuilliers wrote: > On Jun 24, 11:57 am,WimFeijen wrote: > > > > > Looking at it again, I saw what was wrong and fixed it! For > >

Re: templatetags and refresh

2011-06-24 Thread bruno desthuilliers
On Jun 24, 11:57 am, Wim Feijen wrote: > > Looking at it again, I saw what was wrong and fixed it! For > completeness, I moved the NewsItem query within the NewsItemBlockNode FWIW, code at the module top-level is only executed when the module is first imported. Now you'll

Re: templatetags and refresh

2011-06-24 Thread Wim Feijen
Thanks! That helped. :) The code for the tag was as follows: import re from django.template import Variable, VariableDoesNotExist, Node, Library, Template, TemplateSyntaxError, Context, loader from django.conf import settings from django.utils.safestring import mark_safe from django.utils.html

Re: templatetags and refresh

2011-06-22 Thread Daniel Roseman
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

Re: templatetags and refresh

2011-06-22 Thread Michał Sawicz
Dnia 2011-06-22, śro o godzinie 06:32 -0700, Wim Feijen pisze: > 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()

templatetags and refresh

2011-06-22 Thread Wim Feijen
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: