Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#6538 closed (invalid)

"Complex" Syndication Example Error?

Reported by: gtaylor@… Owned by: nobody
Component: contrib.syndication Version: master
Severity: Keywords: rss, syndication
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Following the example at:

I've arrived at the following:

class BpostCatPosts(Feed):
    Shows the latest blog posts from an individual blog post category.
    def get_object(self, bits):
        # In case of "/feeds/bpcatposts/0613/foo/bar/baz/", or other such clutter,
        # check that bits has only one member.
        if len(bits) != 1:
            raise ObjectDoesNotExist
        return BlogCategory.objects.get(id__exact=2)
    def title(self, obj):
        return "Greg Taylor's Latest: %s" %
    def link(self, obj):
        if not obj:
            raise FeedDoesNotExist
        return obj.get_absolute_url()
    def description(self, obj):
        return "The latest posts from the %s category of Greg Taylor's blog." %
    def items(self, obj):
        return BlogPost.objects.filter(category=[])[:10]

My feed section of looks like this:

feeds = {
    'latest_bpost': LatestBposts,
    'latest_bpostcat': BpostCatPosts,

urlpatterns = patterns('',
    # Serve Media via Django
    (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    # Default Page
    (r'^', include('apps.pages.urls')),
    # Standard Pages
    (r'^pages/', include('apps.pages.urls')),
    # Blog URLs
    (r'^blog/', include('')),
    # Django Admin Interface
    (r'^admin/', include('django.contrib.admin.urls')),
    # RSS Feeds
    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),

When visiting the URL http://localhost:8000/feeds/latest_bpostcat/2/ I am getting the following error:

InterfaceError at /feeds/latest_bpostcat/2/
Error binding parameter 0 - probably unsupported type.

I've looked over this quite a few times and can't figure out if the API has changed or if there was an omission. I've tried my best to assure that the error wasn't on my part.

Change History (3)

comment:1 Changed 10 years ago by anonymous

Oh, I missed part of the error message that may help:

InterfaceError at /feeds/latest_bpostcat/2/
Error binding parameter 0 - probably unsupported type.
Request Method: 	GET
Request URL: 	http://localhost:8000/feeds/latest_bpostcat/2/
Exception Type: 	InterfaceError
Exception Value: 	Error binding parameter 0 - probably unsupported type.
Exception Location: 	C:\Python25\lib\site-packages\django\db\backends\sqlite3\ in execute, line 133
Python Executable: 	C:\Python25\python.exe
Python Version: 	2.5.1
Python Path: 	['C:\\Documents and Settings\\Greg Taylor\\eclipse_workspace\\gsite', 'C:\\WINDOWS\\system32\\', 'C:\\Python25\\DLLs', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win', 'C:\\Python25\\lib\\lib-tk', 'C:\\Python25', 'C:\\Python25\\lib\\site-packages', 'C:\\Python25\\lib\\site-packages\\Numeric', 'C:\\Python25\\lib\\site-packages\\PIL']


Request Method: GET
Request URL: http://localhost:8000/feeds/latest_bpostcat/2/
Django Version: 0.97-pre-SVN-7054
Python Version: 2.5.1
Installed Applications:
Installed Middleware:

File "C:\Python25\lib\site-packages\django\core\handlers\" in get_response
  82.                 response = callback(request, *callback_args, **callback_kwargs)
File "C:\Python25\lib\site-packages\django\contrib\syndication\" in feed
  19.         feedgen = f(slug, request).get_feed(param)
File "C:\Python25\lib\site-packages\django\contrib\syndication\" in get_feed
  105.         for item in self.__get_dynamic_attr('items', obj):
File "C:\Python25\lib\site-packages\django\db\models\" in __iter__
  114.         return iter(self._get_data())
File "C:\Python25\lib\site-packages\django\db\models\" in _get_data
  483.             self._result_cache = list(self.iterator())
File "C:\Python25\lib\site-packages\django\db\models\" in iterator
  189.         cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + ",".join(select) + sql, params)
File "C:\Python25\lib\site-packages\django\db\backends\" in execute
  18.             return self.cursor.execute(sql, params)
File "C:\Python25\lib\site-packages\django\db\backends\sqlite3\" in execute
  133.         return Database.Cursor.execute(self, query, params)

Exception Type: InterfaceError at /feeds/latest_bpostcat/2/
Exception Value: Error binding parameter 0 - probably unsupported type.

comment:2 Changed 10 years ago by Malcolm Tredinnick

Resolution: invalid
Status: newclosed

This is an error in your code. Run this line


in the Django shell and you'll see the same error. You probably want to use the __in lookup type there.

comment:3 Changed 10 years ago by James Bennett

(In [7302]) Fixed #6541: Corrected documentation of how the admin chooses a default manager. Refs #6538.

Note: See TracTickets for help on using tickets.
Back to Top