I think that this is because now is a tag and date is a filter, and
you probably have a
a "date" variable in context.  You could try passing in a "now"
variable from your
view.

Try rendering {{ date }} in this template to see whether there is such
a variable.

I think that you can only use variables, or variables passed through
filter, or literal
strings, in tag arguments.  Or I may be missing something.

On Tue, Jan 26, 2010 at 5:26 PM, Simon Davies <simon...@gmail.com> wrote:
> Hi
>
> I have been having some problems with the now date template tag.  I
> want to use it in the url tag.  This works fine with the date tag:
>
> {% url news_archive_month year=date|date:'Y' month=date|date:'m'
> day=date|date:'d' %}
>
> but if I want to use it with the current date using the now tag, it
> doesn't, like this:
>
> {% url news_archive_day now 'Y' now 'm' day.day %}
>
> I get this error message:
>
> Caught an exception while rendering: Reverse for 'news_archive_day'
> with arguments '('', u'Y', '', u'm', 28)' and keyword arguments '{}'
> not found.
>
> Is there any way of using the current date without passing in an
> additional variable from the view.  As its the default
> django.views.generic.date_based.py, this would be rather difficult.
>
> Regards
>
> SImon
>
> --
> 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.
>
>

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