Ok, found the syntax issue with the curly brace conversion...
def feed():
a = dict()
a = { "title":"my feed",
"link":"http://feed.example.com",
"description":"my first feed",
"entries":[{'title':"my feed",
"link":"http://feed.example.com",
"description":"my first feed"
}]
}
return a
I was missing the fact that entries requires a list.
It seems that the RSS functionality requires certain fields (title,
description, link, entries (which must be a list))
As a result I am guessing this is incompatible with the iTunes podcast
specification and I will need a different view to generate the
required file.
On Apr 27, 12:52 pm, Nite <[email protected]> wrote:
> Upgraded to 1.95.1 which is current.
>
> Still no joy.
>
> It doesn't appear that curly brace notation will work for generating
> RSS feeds or I am doing something wrong.
>
> From the book here is the example:
>
> def feed():
> return dict(title="my feed",
> link="http://feed.example.com",
> description="my first feed",
> entries=[
> dict(title="my feed",
> link="http://feed.example.com",
> description="my first feed")
> ])
>
> Here is my test of the same with curly brace notation:
>
> def feed():
> a = dict()
> a = { "title":"my feed",
> "link":"http://feed.example.com",
> "description":"my first feed",
> "entries":{'title':"my feed",
> "link":"http://feed.example.com",
> "description":"my first feed"
> }
> }
> return a
>
> The html result of the curly brace test is a correctly parsed
> dictionary in html format.
>
> The rss result is:
>
> RSS error<!--
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //--
>
>
>
> After striping the try/except from generic.rss I found this traceback:
> Traceback (most recent call last):
> File "gluon/restricted.py", line 181, in restricted
> File "/Applications/DigitalAudioLibrary.app/Contents/Resources/
> applications/DAL/views/generic.rss", line 11, in <module>
> File "gluon/serializers.py", line 71, in rss
> TypeError: string indices must be integers
>
> Function argument list
> (feed={'description': 'my first feed', 'entries': {'description': 'my
> first feed', 'link': 'http://feed.example.com', 'title': 'my feed'},
> 'link': 'http://feed.example.com', 'title': 'my feed'})
>
> My version of web2py:
>
> Version 1.95.1 (2011-04-25 15:04:14)
> web2py is up to date
>
> On Apr 27, 12:25 pm, Anthony <[email protected]> wrote:
>
>
>
>
>
>
>
> > On Wednesday, April 27, 2011 12:01:29 PM UTC-4, Nite wrote:
>
> > > entries = [
> > > { 'itunes:name': foo,
> > > ...
> > > }
> > > ]
>
> > > Results in the following:
>
> > > 'itunes:owner' = [
> > > SyntaxError: keyword can't be an expression
>
> > I'm not sure this is the problem, but is foo a variable? If not, you
> > probably have to put it in quotes (i.e., 'foo').
>
> > > However, in RSS view I received this:
>
> > > RSS error<!--
> > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > >
> > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > >
> > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > >
> > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > >
> > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > >
> > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > > xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > > //--
>
> > What version of web2py are you using? I think when the response body is less
> > than 512 characters, web2py appends an HTML comment full of x's in order to
> > trick IE. However, this is only necessary for HTML responses (and generates
> > an error with RSS, as you have observed). This was fixed recently, though
> > (seehttp://code.google.com/p/web2py/source/detail?r=e46809139d9f9f8b91e6a...),
> > so maybe try the most recent version of web2py.
>
> > Anthony