The auto_complete field is working, however, adding the auto_complete
functionality introduces a flaw in the update function.

In the view I have got:

<td>
  {{=A(T('update/delete'),_href=URL(r=request,f='update_address',args=
[record.id]))}}
</td>


when the user clicks the link the update_adress function is called:

@auth.requires_membership('core_manager')
def update_address():
    response.view='core/update.html'
    response.flash=T('update or delete record')
    db.adres.bedrijf.writable=False
    record_id=request.args[0]
    record=db(db.adres.id==record_id).select(db.adres.bedrijf)[0]
    if not record:
        redirect(URL(r=request,f='crud_address'))
    elif not record.bedrijf==auth.user.bedrijf:
        redirect(URL(r=request,f='crud_address'))
    form=crud.update(db.adres,request.args[0],next=(URL
(r=request,f='crud_address')))
    return dict(form=form)

which displays an update/delete form, in which the plaats field is
empty. When I click the submit field without updating the record, the
record is updated with an empty plaats fields, whereas in the model
there I defined an IS_NOT_EMPTY() validator on the field. Removing the
widget restores the update function, but this is no solution, since I
need the widget.

db.adres.plaats.widget=lambda self,value:INPUT
(_id='place',_name='plaats',_class='ac_input',_type='text')


Kind regards,

Annet.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to