[web2py] Re: form fields

2018-05-30 Thread Anthony
SQLFORM shows the values of non-writable fields but does not put those values into HTML form widgets, so they are not submitted with the form. A couple of options: - Instead of setting writable=False, specify a custom widget for the fields with the HTML readonly attribute set to true (e.g

[web2py] Re: form fields

2018-05-31 Thread Andrea Fae'
thanks Anthony. Could you give me simple example about second idea? It's noy possible to pass variables to a onvalidation funtion? i.e. onvalidation doesn't accept parameters... Il giorno giovedì 31 maggio 2018 00:24:29 UTC+2, Anthony ha scritto: > > SQLFORM shows the values of non-writable fiel

[web2py] Re: form fields

2018-05-31 Thread Anthony
On Thursday, May 31, 2018 at 2:27:44 PM UTC-4, Andrea Fae' wrote: > > thanks Anthony. Could you give me simple example about second idea? It's > noy possible to pass variables to a onvalidation funtion? i.e. onvalidation > doesn't accept parameters...the problem is: how to make that object > ava

[web2py] Re: form fields

2018-06-01 Thread Andrea Fae'
I'm saying thank you Anthony another time...you find every time the right way...my compliments. Tell me...in your opinion what is the best python guide/tutorial (for free or cheap money) to use? What do you suggest? Have a good day. Thank you! Il giorno giovedì 31 maggio 2018 23:32:51 UTC+2, A

[web2py] Re: Form fields in DB showing a 0 value

2013-11-09 Thread 黄祥
please use format as record representation or set it on IS_IN_DB form validation. e.g. if you want to show city as a drop down menu in order_bus form : db.define_table( 'route', Field('city'), Field('country_iso'), format = '%(city)s') db.order_bus.depart_from.requires = IS_IN_DB(db,

[web2py] Re: Form fields in DB showing a 0 value

2013-11-09 Thread raferbop
Stifan,Winvalid literal for long() with base 10: 'Montego Bay' On Saturday, November 9, 2013 4:03:15 PM UTC-5, 黄祥 wrote: > > please use format as record representation or set it on IS_IN_DB form > validation. > e.g. if you want to show city as a drop down menu in order_bus form : > db.define_table

[web2py] Re: Form fields in DB showing a 0 value

2013-11-09 Thread 黄祥
oopss, sorry didn't notice that you are using SQLFORM.widgets.autocomplete, yes, it should. basically the reference type of field is refer to primary key of the table which is 'id' field, please use it as reference base and then please use record representation (format) to show it in html form f

[web2py] Re: Form fields in DB showing a 0 value

2013-11-10 Thread raferbop
When I remove the auto complete widget, the data saves in the database is it should. On Saturday, November 9, 2013 7:34:39 PM UTC-5, 黄祥 wrote: > > oopss, sorry didn't notice that you are using > SQLFORM.widgets.autocomplete, yes, it should. > basically the reference type of field is refer to pri

[web2py] Re: Form fields in DB showing a 0 value

2013-11-10 Thread Niphlod
after two days of bashing your head to the wall, why don't you read the docs about the autocomplete widget ? You need to pass the id_field argument http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=autocomplete#Autocomplete-widget On Sunday, November 10, 2013 9:56:46

[web2py] Re: Form fields in DB showing a 0 value

2013-11-11 Thread raferbop
Niphold, thanks for that info, but this is what I have; db.define_table( 'order_bus', Field('depart_from'), Field('arrive_to'), Field('date', 'date'), Field('time', db.depature_times), # drop-down select time options Field('no_of_passengers', db.tickets), # drop-down options to s