First attempt with Wep2py, going through the book, on chapter 7 and stuck 
getting both the linkto object to display and have the image filename 
stored in the database. I can one or the other but not both. Seems they are 
mutally exclusive, although my 2 AI helpers say no. Couldn't find any 
conversations here about this. Any help would be greatly appreciated. How 
can I get both to work? 

Seems that if person.image.filename is allowed to be displayed in the view, 
then linking to the image (pressing the button) does not store the filename 
in the DB. Is this as designed? 

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 mystified with what and how things get passed back and 
forth between the controllers and the views. Probably due to my lack of 
webdev experience, ack. I'd be glad of any other learning resources. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6bc78841-beb1-4cf7-aa51-eaf5325b801bn%40googlegroups.com.

Reply via email to