http://groups.google.com/group/web2py/browse_thread/thread/b7cd19c53648ef0d

On 12/14/10, Rick <sababa.sab...@gmail.com> wrote:
> Hi,
>
> I'm trying to make a data base for storing names and addresses, but
> since I'm a n00b then I can't get it working. I've no idea what's
> wrong. The problem is that the input function doesn't redirect to the
> show function and that the show function doesn't show any data. Here's
> the code:
>
> the controller file:
> def show():
>       id=request.vars.id
>       record=db(db.measure.id==id).select()
>       return dict(record=record)
>
> def input():
>       form = SQLFORM(db.addresses)
>       if form.accepts(request.vars, session):
>               redirect(URL(r=request, f='show'))
>       return dict(form=form)
>
> **********************
>
> and the model file table:
>
> db.define_table('addresses',
>      Field('person'),
>      Field('adress'))
>
> **********************
>
> input.html
> {{extend 'layout.html'}}
> {{=form}}
>
>
> **********************
>
> show.html:
> {{extend 'layout.html'}}
> <h1>Addresses</h1>
> {{for record in record:}}
> {{=record.name}} : {{=record.address}}<br>
> {{pass}}
>
> **********************
>
> Thanks in advance for help!

Reply via email to