On 14 Apr, 11:48, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Mon, Apr 14, 2008 at 4:41 AM, fizban <[EMAIL PROTECTED]> wrote:
> >  In fact by default it only returns "object" (or the
> >  template_object_name name you pass), but I need it to return "year",
> >  "month" and "day" too. This is because in my *_detail.html template
> >  I'd have to keep on formatting object.pubdate over and over again to
> >  achieve a simple "breadcrumbs" and this is obviously boring other than
> >  not DRY at all ;)
>
> If you're just displaying the breadcrumbs once, there's no repetition;
> you'll have to find a way to format each element no matter what, after
> all.

Well, speaking of the breadcrumbs, the year is being accessed 4 times,
month 2 times, day 2 times.
"object.pub_date|date:" was repeated 9 times.. there was a lot of
repetition going on ;)

> If you're displaying them multiple times, you want the {% with %} tag.

Thanks, I really missed that tag!

Anyway, my question still stands.. is there a more elegant way to
extend a generic view to output more variables than it does by default
(see my first message for more details)? Beside this case it would be
handy for some other case too


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to