Ah ok, that really helps. Well I get the data as a very thick json
object from the Bloglines Beta API and it's not very pretty and has a
bunch of lists and stuff so I just am forgoiing storify all together
for now. But that list literal makes *a lot* of sense. Maybe I'll
clean the json up before I shoot it over to the template.
Thanks!
Bjorn
On 9/6/07, Angelo Gladding <[EMAIL PROTECTED]> wrote:
> `web.storify()` might be a little awkward at first. Let me know if this
> helps:
>
> controller
> a = [web.storify({'title':'Pulmonary Archery', 'content':'Why did you kick
> my scooter?'}), web.storify({'title':'Harder, Better, Faster, Stronger',
> 'content':'Neither watersheds nor wastebaskets would understand.'})]
> # -- OR simply pull it from a DB --
> a = web.select('articles')
> return web.output(render.articles(a))
>
> view
> $def with (articles)
>
> $for a in articles:
> <h2>$a.title</h2>
> <p>$a.content</p>
>
> It's always best to copy/paste a snippet of code when requesting help. If
> this doesn't help, try giving us your call to storify.
>
>
> On 9/5/07, Bjorn Tipling <[EMAIL PROTECTED]> wrote:
> >
> > Looks like storify took my dictionary of arrays and flattened it. Hrm.
> >
> > On 9/5/07, Bjorn Tipling <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > Thanks that worked, but only sort of. Funny thing is it iterated
> > > through the characters in the string of the last element in the list
> > > that is in article Data instead of each item in the list. Why would it
> > > do that??
> > >
> > > On 9/5/07, Tzury < [EMAIL PROTECTED]> wrote:
> > > >
> > > > > I would like to do something like this:
> > > > >
> > > > > <div id="articleList">
> > > > > $for article in articleData:
> > > > > <h2>article.title</h2>
> > > > > <p>article.content</p>
> > > > > </div>
> > > > >
> > > > > But it doesn't work for me :/
> > > >
> > > > pay attention to those two and your templates will fly.
> > > >
> > > > a) the '$' sign, b) indentation
> > > >
> > > > a) (missing in your code)
> > > >
> > > > $for article in articleData:
> > > > <h2>$article.title</h2>
> > > > <p>$article.content</p>
> > > >
> > > > b)
> > > > You must make sure you keep indentation correctly as you would with
> > > > standard python code.
> > > > as I see it in here <h2> and <p> are not aligned correctly
> > > >
> > > >
> > > > > >
> > > >
> > >
> >
> >
> >
> >
>
>
>
> --
> Angelo Gladding
> [EMAIL PROTECTED]
> http://angelogladding.com
> (626) 755 - 1417
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---