On Tue, 2006-08-01 at 15:00 -0700, [EMAIL PROTECTED] wrote:
> In other words, if my url is www.mydomain.com/foo is the template aware
> that it's current directory is foo?
One minor point: It's a bit dangerous to talk about the trailing
portions of a URL as directories. It is only accidental that in some
cases they actually do map to directories on the file system.
> I'm trying to figure out how I can filter items based on location. I
> have a field in the model that says foo or bar, and I want the foo
> items on the foo page, and the bar items on the bar page.
This sounds like something you should be filtering in the view, when you
construct the queryset of results to pass to the template, rather than
trying to make the template do all the heavy lifting.
When you call your view, pass in that component of the path ("foo" or
"bar") and use that to prime a filter() clause.
Regards,
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---