In controller

def mypage():
    people = db(db.people.id>0).select()
    return dict(people=people)


In view


<div id="*accordion*">
    {{ for person in people: }}
    <h3><a href="#">{{=person.name}}</a></h3>
    <div>{{=person.comments}}</div>
    {{ pass }}
</div>

Include JqueryUI in the view.

Bruno Rocha
http://about.me/rochacbruno/bio


2011/1/21 Ialejandro <[email protected]>

> Hi there! I'm new to web2py, It is just... awesome!
>
> Well this is my question, I'd like to know how could I use the jquery
> UI accordion with web2py and fill it from a db.
>
> For example I have the model,
>
> db.define_table('people',
>     Field('name','string')
>     Field('comments','text'))
>
> And i like to have the accordion title = people.name
> and the accordion body = people.comments
>
> Thanks!
>

Reply via email to