Re: Having problem using the Syndication Feed Framework

2008-01-30 Thread Matt Davies
Hi Jeff

This error

NoneType' object has no attribute 'startswith'

Usually means that you have got a NoneType obejct back from the database,
and you can't very well ask what it starts with, computer says no.

If I were you I'd spare an hour and go through the two screencasts on this
page with Michael.

http://blog.michaeltrier.com/screencasts

Download the movie file and watch it and do it as he does, pausing etc etc.

If you go through those videos and still have the problem, then ask again, I
doubt it though and it's a good exercise nevertheless.




On 30/01/2008, jeffself <[EMAIL PROTECTED]> wrote:
>
>
> I'm trying to get an understanding of the Feed Framework, so I've
> created a simple application to try it out.  I have followed the steps
> that are in the documentation but I'm getting the following error when
> I go to this URL: "http://127.0.0.1:8000/feeds/news/":
>
> AttributeError at /feeds/news/
> 'NoneType' object has no attribute 'startswith'
>
> Here are my files:
>
> feeds.py
> 
> from django.contrib.syndication.feeds import Feed
> from news.models import News
>
> class NewsFeed(Feed):
> '''Feed for latest 5 news entries'''
> title = "My news"
> link = "/sitenews/"
> description = "Updates on changes and additions to my news"
>
> def items(self):
> return News.objects.order_by('-submit_date')[:5]
>
> urls.py
> ##
> from django.conf.urls.defaults import *
> from mysite.news.models import News
> from news.feeds import *
>
> site_feeds = {
> 'news': NewsFeed,
> }
>
> news_info = {
> "queryset" : News.objects.all().order_by("-submit_date"),
> }
>
> urlpatterns = patterns('',
> (r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed',
> {'feed_dict': site_feeds}),
> )
>
> models.py
> #
> class News(models.Model):
> title = models.CharField(max_length=50, db_index=True)
> submit_date = models.DateTimeField()
> story = models.TextField()
>
> And I have two templates in a feeds folder under mysite/templates
>
> news_title.html  ->  {{ obj.title }}
> news_description.html  ->  {{ obj.story }}
>
>
> I've looked over this several times and everything seems to be
> correct.  Help!!!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Having problem using the Syndication Feed Framework

2008-01-29 Thread jeffself

I'm trying to get an understanding of the Feed Framework, so I've
created a simple application to try it out.  I have followed the steps
that are in the documentation but I'm getting the following error when
I go to this URL: "http://127.0.0.1:8000/feeds/news/":

AttributeError at /feeds/news/
'NoneType' object has no attribute 'startswith'

Here are my files:

feeds.py

from django.contrib.syndication.feeds import Feed
from news.models import News

class NewsFeed(Feed):
'''Feed for latest 5 news entries'''
title = "My news"
link = "/sitenews/"
description = "Updates on changes and additions to my news"

def items(self):
return News.objects.order_by('-submit_date')[:5]

urls.py
##
from django.conf.urls.defaults import *
from mysite.news.models import News
from news.feeds import *

site_feeds = {
'news': NewsFeed,
}

news_info = {
"queryset" : News.objects.all().order_by("-submit_date"),
}

urlpatterns = patterns('',
(r'^feeds/(?P.*)/$', 'django.contrib.syndication.views.feed',
{'feed_dict': site_feeds}),
)

models.py
#
class News(models.Model):
title = models.CharField(max_length=50, db_index=True)
submit_date = models.DateTimeField()
story = models.TextField()

And I have two templates in a feeds folder under mysite/templates

news_title.html  ->  {{ obj.title }}
news_description.html  ->  {{ obj.story }}


I've looked over this several times and everything seems to be
correct.  Help!!!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---