Re: URL Issue - Slugged Url with Custom IDs

2011-12-07 Thread mattym
I found an article that described how theonion.com did something similar. Their url is the slug and an ID separated by a comma. The article said pulling by ID gives a performance gain. But they wanted to keep the seo friendly url as well. http://www.theonion.com/articles/secretary-of-agriculture-a

URL Issue - Slugged Url with Custom IDs

2011-12-07 Thread mattym
Hi all - Question. I would love to use a slug in the usual way for nice urls: #urls.py urlpatterns = patterns('app.views', (r'^(?P.*)/foo/$', 'viewfunction'), ) #views.py def viewfunction(request, myslug): themodel = get_object_or_404(MyModel, slug=myslug) However, due to requirements '