It's a bug: https://github.com/web2py/web2py/issues/1140

For now, either stick with the older version of web2py, or instead of using 
onvalidation, manipulate request.post_vars directly *before* calling 
form.process.

Also, for future reference, a "minimal" app should ideally be a new app 
with that absolute minimum amount of code necessary to demonstrate the 
problem (you can create a dummy db model and a simplified version of all 
the logic) -- no Auth, special settings, etc. Make it as easy as possible 
for someone to getting it running and get to the problem without having to 
wade through lots of irrelevant code.

Anthony

On Wednesday, December 23, 2015 at 7:16:20 AM UTC-5, Karl Florian wrote:
>
> Hi Anthony,
> were you able to reproduce the problem i have with the app i sent you?
> Do you have any solution for my problem with version 
> 2.13.2-stable+timestamp.2015.12.18.11.00.46 ?
> Or should i use version 2.12.3-stable+timestamp.2015.08.19.00.18.03 as i 
> did before ?
>
> regards Karl
>
> *I wish everybody a merry christmas an a happy new year!!!!*
>
> Mit freundlichen Grüßen
>
> C.H.Florian
>
> Florian Software
> Ferdinand-Abt-Str. 3A
> 65510 Idstein
> Germany
> Tel.: 06126/5097041
> Internet: www.florian-sw.de
>
> Am 21.12.2015 um 21:37 schrieb K.H.Florian:
>
> Hi Anthony,
> here is my minimal app.
> Same problem in new version #2.13.1.
>
> Thanks
>
> Mit freundlichen Grüßen
>
> C.H.Florian
>
> Florian Software
> Ferdinand-Abt-Str. 3A
> 65510 Idstein
> Germany
> Tel.: 06126/5097041
> Internet: www.florian-sw.de
>
> Am 21.12.2015 um 14:25 schrieb Anthony:
>
> Do you mean the records are being inserted/updated without those template 
> values?
>
> Can you attach a minimal app that reproduces the problem?
>
> Anthony
>
> On Monday, December 21, 2015 at 7:24:04 AM UTC-5, Karl Florian wrote: 
>>
>> *Hi,*
>> *I too upgraded to this Version.*
>>
>> *My issue is the following controller function worked in the previous 
>> versions but not in this one.*
>>
>> *The onvalidation def txtlabel_valupd(form): is not filling my 
>> form.vars.titel and form.vars.posting *
>> *as it did in previous versions!?*
>>
>> *If form.vars.title is empty the function should get the title and 
>> posting out of the text-template db*
>> *and fill them into the form fields. But it doesn't.*
>> *Is there anything wrong with the coding?* 
>> *Or is there a better way of moving the field values out of the 
>> texttemplate (alltext) table*
>> *into the textlabel (altxtlbl) table ?*
>>
>>
>> *This is my code and table definitions:*
>>
>> *def txtlabel_edit():*
>>     def txtlabel_valupd(form):
>>         if len(form.vars.text_mc) >0 and len(form.vars.titel)<=0:
>>             
>> alltxtrec=db(db.alltext.text_mc==form.vars.text_mc).select().first()
>>             if alltxtrec:
>>                 form.vars.titel=alltxtrec.titel
>>                 form.vars.posting=alltxtrec.posting
>>
>>     def txtlabel_valnew(form):
>>         if len(form.vars.text_mc) >0 and len(form.vars.titel)<=0:
>>             alltxtrecs=db(db.alltext.text_mc==form.vars.text_mc).select()
>>             if alltxtrecs[0]:
>>                 form.vars.titel=alltxtrecs[0].titel
>>                 form.vars.posting=alltxtrecs[0].posting
>>
>>     db.altxtlbl.text_mc.requires = 
>> IS_EMPTY_OR(IS_IN_DB(db,db.alltext.text_mc,'alltext.description'))
>>     if len(request.args):
>>         session.recstat = 'upd'
>>         req_id=request.args(0)
>>         record = db.altxtlbl(request.args(0))
>>         btn_list = [TAG.button(SPAN(_class="icon-arrow-left glyphicon 
>> glyphicon-arrow-left"),' Back',_type='button', _onClick = 
>> "parent.location='%s' " % 
>> URL('txtlabel_grid')),TAG.button(SPAN(_class="icon-ok glyphicon 
>> glyphicon-ok"),' Submit', _type='submit', _id='submit_btn'), 
>> TAG.button(SPAN(_class="icon-refresh glyphicon glyphicon-refresh"),' 
>> Reset', _type='reset', _onclick='return confirm("Are you sure you want to 
>> reset the form?");', _id='clear_btn'),TAG.button(SPAN(_class="icon-pencil 
>> glyphicon glyphicon-pencil"),' New-Label',_type='button',_onClick = 
>> "parent.location='%s' " % URL('orders', 'txtlabel_edit', 
>> args=[])),TAG.button(SPAN(_class="icon-print glyphicon glyphicon-print"),' 
>> Txt-Label',_type='button',_onClick = "parent.location='%s' " % 
>> URL('print_txtlabel', args=req_id))]
>>         db.altxtlbl.posting.requires =  requires=IS_LENGTH(1000,30)
>>         
>>         form = SQLFORM(db.altxtlbl, 
>>                         record,
>>                         buttons = btn_list,
>>                         formstyle = 'table3cols',
>>                         user_signature=True)
>>         form.process(onvalidation=txtlabel_valupd, 
>> session=settings.editsession) 
>>         if form.accepted:
>>             response.flash = 'record saved'
>>             redirect(URL('txtlabel_edit', args=form.vars.id))
>>         elif form.errors:
>>             response.flash = 'form has errors'
>>     else:
>>
>> db.define_table(
>>     'alltext',
>>     Field('text_mc', 'string', length=8, unique=True, label='Text-MC'),
>>     Field('description', 'string', length=50, requires=IS_NOT_EMPTY(), 
>> label='Description'),
>>     Field('titel', 'string', length=50, requires=IS_NOT_EMPTY(), 
>> label='Titel'),
>>     Field('posting', 'text', length=1000, requires=IS_LENGTH(1000,30), 
>> label='Text'),
>>     Field('date_changed', 'datetime', update = request.now, writable = 
>> False, label=T('Modified')),
>>     Field('user_id', 'reference auth_user', update=auth.user and 
>> auth.user.id, writable = False, readable = False),
>>     migrate=settings.migrapp,
>>     redefine=settings.redefin,
>>     format='%(text_mc)s'
>> )
>> db.alltext.text_mc.requires = [IS_NOT_IN_DB(db, 'alltext.text_mc'), 
>> IS_UPPER(), IS_LENGTH(minsize=2, maxsize=8)]
>>
>> db.define_table(
>>     'altxtlbl',
>>     Field('order_date', 'datetime', default = request.now, 
>> label='Order-Date'),
>>     Field('text_mc', 'string', length=8, label='Text-MC'),
>>     Field('titel', 'string', length=50, label='Titel'),
>>     Field('posting', 'text', length=1000, label='Text'),
>>     Field('no_label', 'integer', notnull=True, requires = 
>> IS_INT_IN_RANGE(1, 10000), label='No-of-Label'),
>>     Field('client_mc', 'string', length=8, requires = 
>> IS_IN_DB(db,db.alcustomers.cust_mc,'alcustomers.name1'), label='Client-MC'),
>>     Field('orderdatemc', 'string', length=25, compute=lambda r: '%s%s' % 
>> (r.text_mc,r.order_date), label='Order-MC-Date'),
>>     Field('date_printed', 'datetime', writable = False, 
>> label='Date-Printed'),
>>     Field('date_created', 'datetime', default = request.now, writable = 
>> False, label='Created'),
>>     Field('date_changed', 'datetime', update = request.now, writable = 
>> False, label='Modified'),
>>     Field('user_id', 'reference auth_user', update=auth.user and 
>> auth.user.id, writable = False, readable = False),
>>     migrate=settings.migrapp,
>>     redefine=settings.redefin,
>>     format='%(order_date)s %(text_mc)s'
>> )
>> db.altxtlbl.orderdatemc.requires = [IS_NOT_IN_DB(db, 
>> 'altxtlbl.orderdatemc')]
>> db.altxtlbl.titel.requires = requires=IS_LENGTH(50,0)
>>
>>
>>  
>>
>> Am Freitag, 18. Dezember 2015 07:31:38 UTC+1 schrieb Massimo Di Pierro:
>>
>>> CHANGELOG 
>>>
>>> ## 2.13.1
>>>
>>>
>>> - fixed oauth2 renew token, thanks dokime7
>>>
>>> - fixed add_membership, del_membership, add_membership IntegrityError 
>>> (when auth.enable_record_versioning)
>>>
>>> - allow passing unicode to template render
>>>
>>> - allow IS_NOT_IN_DB to work with custom primarykey, thanks timmyborg
>>>
>>> - allow HttpOnly cookies
>>>
>>> - added fabfile.py
>>>
>>> - french pluralizaiton rules, thanks Mathieu Clabaut
>>>
>>> - fixed bug in redirect to cas service, thanks Fernando González
>>>
>>> - allow deploying to pythonanywhere from the web2py admin that you're 
>>> running locally, thanks Leonel
>>>
>>> - better tests
>>>
>>> - many more bug fixes
>>>
>> -- 
> 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 a topic in the 
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/hYH5cYoKVAw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> 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 a topic in the 
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/hYH5cYoKVAw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to