Hi, new to Web2py, going through the book, currently on chapter 7. I'm trying to get both the linkto (person's dogs) link to display on the view and to
not display the person.image.filename. It seems if I allow
person.image.filename to be displayed then the file name from the image doesn't get stored in the DB. Is this normal behavior? I'm sure I'm doing something wrong. Any help would be appreciated.
def forms():
record = db.person(request.args(0))
url = URL('download')
link = URL('list_records', args='db')
form = SQLFORM(db.person, record, deletable=True, upload=url,
linkto=link, labels = {'dog.owner':"This person's dogs"}),
fields=['name', 'gender', 'married', 'profile', 'image'])
if request.vars.image != None:
form.vars.image_filename = request.vars.image.filename
if form.process().accepted:
response.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors'
return dict(form=form)
In general, I'm not clear what can sent back and forth between a controller and a view and it does that. Lot's of print statements to aid but slow going. Is there a resource for dummies? Much appreciated.
Sorry if this double posted. I can't find the first one.