On 6/23/06, Frankie Robertson <[EMAIL PROTECTED]> wrote:
>
> Please, is there any way of doing this? I've dumped the last approach,
> I'm planning on using inclusion tags to query the database, but the
> templates would still need to know the slug of the hostee's current
> page. So generic views don't work because they don't know what the
> blog_slug is, as it is I'm not replacing the generic views with my
> own, not very DRY, but hey. To be honest I feel this is a bit of
> failing in django and may file a bug, not sure how it would be
> corrected to be honest though.


Maybe I'm misunderstanding you, let's see if I have this straight:

Your model (Blog) has a column named 'slug'. You're displaying each
Blog row with a generic_view (I'm guessing one of the object_detail
views). Your worry is that because the slug is in the URL, you don't
have access to it in the template, because the generic view doesn't
pass the slug to the template.

If I'm correct on that, then the answer is very simple: object_detail
passes the object itself into the templae. The object knows what its
own slug is. So in your template, you'd do:

{{object.slug}}


Or have I completely misunderstood you?

Jay P.

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

Reply via email to