Categories not showing up
Sam Ruby
rubys at intertwingly.net
Sat Oct 14 01:54:22 EST 2006
Michel Klijmij wrote:
>
>> with the latest Feed Parser,
>> the key you will get back is tags:
>>
>> http://feedparser.org/docs/reference-feed-tags.html
>>
>> The htmltmpl support in Venus specifically requests individual keys to
>> avoid this problem in the future.
>
> Sounds great, but being less technically knowledgable: how can I get
> categories in Venus with htmltmpl and how in Planet 2.0?
In planet/planet/__init__.py, there is a method named NewsItem.update.
There will need to be code added that looks for a key named 'tags'. I
haven't tested it, but something akin to the following will grab the
term from the first category:
elif key == 'tags':
self.set_as_string("category", entry[key][0]['term'])
There may need to be error checking logic (for example, on the length of
the array, and whether or not there is a 'term' property).
- Sam Ruby
More information about the devel
mailing list