Pages

Monday, December 18, 2006

Basic filters work

Finally, all the filters work:


reviews = articles.filter(article_type__name__exact='review')


Not sure what the problem was. Today I'll learn how to commit.

Sunday, December 17, 2006

Allegedly figured out filtering

Allegedly figured filtering out using an IBM tutorial. Apparently, you have to specify the entire path across the object to the attribute using double underscores as separators (__). This wasn't entirely clear in the documentation.


news = articles.filter(article_type__name__exact='news')


Articles is a query set where I yanked all an artist's related articles. The filter works by looking at the object__attribute__filter you'd like to use.

Works for news, but it's not working for playlists...

Artist slugs working

I didn't have the regex guide on the train, so I didn't get the slugs working till tonight:


(r'^music/artists/(?P[-\w]+)/$', 'objecta_website.content_manager.views.artist_profile'),


I need to check-in, but I'm kind of waiting on getting the filters on M2M lookups working correctly. Bastards.