from django.http import HttpResponse
import feedparser
from ubermicro.shows.models import show
def show_page(request):
"""this is where we take what we need form the rss feeds in the
data base"""
query = show.objects.filter(show_feed__contains="http://")
podcast = feedparser.parse(query)
#show_about = podcast.feed.description
show_latest_title = podcast.entries[0].title
#show_latest = podcast.entries[0].description
return HttpResponse(show_latest_title)
ok so what this code is doing is its getting the rss feed from the
database and the I am using feedparser(http://www.feedparser.org) to
get the rss elements such as <description> and such but I keep getting
an error
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
site-packages/django/core/handlers/base.py" in get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "/Users/sebey/Sites/ubermicro/../ubermicro/shows/views.py" in
show_page
10. show_latest_title = podcast.entries[0].title
IndexError at /shows/
list index out of range
just to note that I am new web dev programing and of course django but
I think that I am using the wrong query so what query do I need I
guess
thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---