On Mon, Mar 18, 2013 at 3:23 PM, julianb <julian....@gmail.com> wrote:
> Hi,
>
> imagine the following use case:
>
> You build an online store where you have sorted products into several
> categories and maybe associated an occasion. Now you want to build URLs. So
> the URL schema that all of the store's owners agree on is:
>
> /<product-slug>/
> /<category-slug>/
> /<occasion-slug>/
>

Really straying into user talk now...

If you have a heterogeneous hierarchy of objects that have slugs, and
you wish to look up arbitrary objects by slug, perhaps just go the
whole hog, add a SluggedItem model with a generic foreign key, and a
view that fetches items from their slugs and dispatches to the
appropriate view.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to