Anthony:

I'm reading web2py book about Links to referencing records and I
pasted the examples, so
in my application has the following components:

Models

db.define_table('person',
   Field('name','string'),
   Field('surname','string'),
   Field('image_filename'),
   Field('image', 'upload'))

db.define_table('dog',
   Field('owner', db.person),
   Field('name', requires=IS_NOT_EMPTY()))

Controllers

def display_form():
   record = db.person(request.args(0))
   url = URL('download')
   link = URL('list_records')
   form = SQLFORM(db.person, record, deletable=True,
                 upload=url, linkto=link)
   if form.process().accepted:
       response.flash = 'form accepted'
   elif form.errors:
      response.flash = 'form has errors'
   return dict(form=form)

def list_records():
   table = request.args(0)
   query = request.vars.query
   records = db(query).select(db[table])
   return dict(records=records,table=table,query=query)

def download():
   return response.download(request, db)

Views

display_form.html
{{extend 'layout.html'}}
<h5>Display Form</h5>
{{=form}}

list_records.html
{{extend 'layout.html'}}
{{=records}}

Sorry for my English. Thanks you very much for answers.

On 13 ene, 17:39, Anthony <abasta...@gmail.com> wrote:
> On Friday, January 13, 2012 12:52:26 PM UTC-5, isi_jca wrote:
>
> > Thanks for your answers. I made a correction, but the error persist. I
> > was reading about this error in
>
> >https://groups.google.com/group/web2py/browse_thread/thread/11835a3c9....
>
> What is the relevance of that issue? Where do you set that query?

Reply via email to