On Feb 3, 10:03 am, brad wrote:
> You could use the built-in __str__ method on now.year.
> In [11]: now.year.__str__()
> Out[11]: '2009'
>
> In [12]: now.year.__str__() == '2009'
> Out[12]: True
>
> In your template you'd do something like this:
> {% ifequal year month.year.__str__ %}
Doh! I d
On Feb 2, 6:37 pm, Bret W wrote:
> I've run into a problem with ifequal in one of my templates.
>
> I'm using date-based generic view to display all objects for a given
> year.
> urls.py:
> (r'^taken/(?P\d{4})/$' ...
>
> Part of the extra_context I pass is a DateQuerySet object:
> months = Photo.
I've run into a problem with ifequal in one of my templates.
I'm using date-based generic view to display all objects for a given
year.
urls.py:
(r'^taken/(?P\d{4})/$' ...
Part of the extra_context I pass is a DateQuerySet object:
months = Photo.objects.dates('date_taken', 'month', order='DESC')
3 matches
Mail list logo