Pages

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

No comments: