[web2py] Re: format Date Time

2016-02-04 Thread Dave S
On Thursday, February 4, 2016 at 2:28:57 AM UTC-8, Charles tenorio wrote: > > Hi > I'm using DataStore to save my data, and the date format is -MM-DD HH: > MM: SS, the problem is that my application runs in a navgador with my > Portuguese language, in time to save this erro : "month out of

Re: [web2py] Re: format parameter not working?

2015-11-07 Thread Marvi Benedet
"format" vs "Format" solved! My lack of attention :( Really thanks Anthony Il giorno sabato 7 novembre 2015 04:07:25 UTC+1, Anthony ha scritto: > > Maybe you can explain in more detail exactly what you are observing and > what you expect instead. In general, though, you should define referenced

Re: [web2py] Re: format parameter not working?

2015-11-06 Thread Anthony
Maybe you can explain in more detail exactly what you are observing and what you expect instead. In general, though, you should define referenced tables before those that reference them (so move domini ahead of the other two) -- this was mentioned in the previous answer to this thread. Also, in

Re: [web2py] Re: format parameter not working?

2015-11-06 Thread Marvi Benedet
Very similar problem, but with an important difference: the referencing table is the "user" table, an extension of it actually... So I don't know how to resolve. by the way, the behaviour is a little randomic: it works for some fields but not for others. At the moment "dipartimenti" is working

Re: [web2py] Re: format field from m:1 table

2015-07-14 Thread Richard Vézina
You may also use : {{if request.is_local:}} {{=response.toolbar()}} {{pass}} In your view which if you click on the button will let you know all the db.request perform by your web page request... Richard On Tue, Jul 14, 2015 at 9:44 AM, Richard Vézina wrote: > Mirek, > > db.region(r.region_id

Re: [web2py] Re: format field from m:1 table

2015-07-14 Thread Richard Vézina
Mirek, db.region(r.region_id).name = db(db.region.id == id).select(db.region.name) So this is 1 request... I wasn't know r.region_id.name, so if this is perform under the houd by web2py there is no supplementary request except if this request is lazy, mean that if performs only when you call it e

[web2py] Re: format field from m:1 table

2015-07-13 Thread Mirek Zvolský
Thank you, Massimo. Great ! This works: format = lambda r: '%s - %s' % (r.name, r.region_id.name ) If region_id is None it should be handled again: format = lambda r: '%s - %s' % (r.name, r.region_id.name if r.region_id else '?') Lot of questions i

[web2py] Re: format field from m:1 table

2015-07-12 Thread Massimo Di Pierro
Thank this should have worked: db.define_table('company', ... , format = lambda r: '%s - %s' % (r.name, r.region_id.name )) r is a company and it does not have a .region, it has a .region_id which is a reference. On Sunday, 12 July 2015 15:18:44 UTC-5, Mirek Zvolský wrot

[web2py] Re: format field from m:1 table

2015-07-12 Thread Mirek Zvolský
So, I wasn't succesfull with db.define_table('company', ... , format = lambda r: '%s - %s' % (r.name, r.region.name)) I was successfull with db.define_table('company', ..., format = lambda r: '%s - %s' % (r.name, db.region(r.region_id).name) or db.define_table('company', ..., format = lambda r:

Re: [web2py] Re: format field from m:1 table

2015-07-08 Thread Richard Vézina
IS_IN_DB() does what format do, but you have to repeat it over each table in which you refer to your product table... Richard On Wed, Jul 8, 2015 at 10:51 AM, Richard Vézina wrote: > You are right about format... I am just not sure you can do what you want > with it... But with a lambda and IS_

Re: [web2py] Re: format field from m:1 table

2015-07-08 Thread Richard Vézina
You are right about format... I am just not sure you can do what you want with it... But with a lambda and IS_IN_DB() you can for sure... Richard On Wed, Jul 8, 2015 at 2:50 AM, Mirek Zvolský wrote: > I am busy now and will make experiments later. And write the results here. > > About format/re

[web2py] Re: format field from m:1 table

2015-07-07 Thread Mirek Zvolský
I am busy now and will make experiments later. And write the results here. About format/represent from the book (if I understand this properly): Format is default value for represent assigned to foreign keys which link such table -- Resources: - http://web2py.com - http://web2py.com/book (Docum

Re: [web2py] Re: format field from m:1 table

2015-07-07 Thread Richard Vézina
For the requires part, see Anthony answer here : https://groups.google.com/d/msg/web2py/QBTYaytNypU/DW2HpnT-xK0J Representation is easier : represent lambda id, row: '{0} {1} {2}'.format(row.produc_name, db.company(id).name, db.region(db.company(id).id).name) if id else T('N/A') I am not sure Ste

[web2py] Re: format field from m:1 table

2015-07-06 Thread 黄祥
please try (not tested) db.define_table('company', Field('name'), Field('region', 'reference region'), format = lambda r: '%s - %s' % (r.name, r.region.name) ) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/

[web2py] Re: Format option in extra_fields

2015-04-07 Thread 黄祥
i think the format already define it on auth.define_tables perhaps you can just do the extra fields, not the format. ref: http://web2py.com/books/default/chapter/29/09/access-control#Customizing-Auth best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

Re: [web2py] Re: format='%(name)s' )

2015-03-24 Thread Richard Vézina
You may replace Field('product', db.product), by Field('product', 'reference product'), It may help and it is a better practice. Richard On Mon, Mar 23, 2015 at 9:16 AM, KPlusPlus wrote: > Thanks for noticing that , I've fixed it , but the problem still persist > and it indecats it's in format

[web2py] Re: format='%(name)s' )

2015-03-23 Thread KPlusPlus
The issue is in line 10 where "format='%(name)s')" , but what causes this issue ,That's why I'm asking ;) On Monday, March 23, 2015 at 4:50:01 AM UTC+3, Massimo Di Pierro wrote: > > which one is line 23? Perhaps some hidden character creeped in. > > On Sunday, 22 March 2015 20:43:08 UTC-5, KPlusP

[web2py] Re: format='%(name)s' )

2015-03-23 Thread KPlusPlus
Thanks for noticing that , I've fixed it , but the problem still persist and it indecats it's in format='%(name)s') Here is the updated code # -*- coding: utf-8 -*- #Products Table db.define_table=('product', Field('name', notnull=True, unique=True), Field('pric

[web2py] Re: format='%(name)s' )

2015-03-23 Thread Nico de Groot
It's a typing error: field is misspelled as filed... -- 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

[web2py] Re: format='%(name)s' )

2015-03-22 Thread Massimo Di Pierro
which one is line 23? Perhaps some hidden character creeped in. On Sunday, 22 March 2015 20:43:08 UTC-5, KPlusPlus wrote: > > Hello > > I'm having an issue while compiling a module file > > here is the code > > # -*- coding: utf-8 -*- > #Products Table > db.define_table=('product', >

[web2py] Re: Format clause for multiple table relationships

2015-01-02 Thread Gary Cowell
On Friday, 2 January 2015 20:12:31 UTC, Massimo Di Pierro wrote: > > I think you are asking about this: > > db.define_table( > 'manufacturer', > Field('name'), > format = '%(name)s') > > db.define_table( > 'model', > Field('manufacturer', db.manufacturer), > Field('model')

[web2py] Re: Format clause for multiple table relationships

2015-01-02 Thread Massimo Di Pierro
I think you are asking about this: db.define_table( 'manufacturer', Field('name'), format = '%(name)s') db.define_table( 'model', Field('manufacturer', db.manufacturer), Field('model'), format=lambda r: '%s %s' % (r.manufacturer.name, r.model)) # one hidden query db.

[web2py] Re: format does not work for SQLFORM

2014-12-28 Thread t_glezakos via web2py-users
Thanks Niphlod for guidance! Tom -- 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 Group

[web2py] Re: format does not work for SQLFORM

2014-12-28 Thread Niphlod
and that lambda row: is a function, exactly as foretold. -- 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 subscri

[web2py] Re: format does not work for SQLFORM

2014-12-28 Thread t_glezakos via web2py-users
Well, in the representation format of the 'hardware' table I did this: Instead of format='%(typeOfItem.hwType)s, %(manufacturer)s, %(productSeries)s, %(model)s, %(serialNo)s' I put: format=lambda row: '%s %s %s %s %s' % (row.typeOfItem.hwType, row.manufacturer, row.productSeries, row.mod

[web2py] Re: format does not work for SQLFORM

2014-12-27 Thread Niphlod
IMHO you can't have a format definition that needs values from different tables to be represented you need a separate function to do that. On Saturday, December 27, 2014 12:14:50 AM UTC+1, t_gle...@yahoo.com wrote: > > My application manages debits of hardware to personnel > > Here is my mode

[web2py] Re: Format specification for chained one to many

2014-10-31 Thread Anthony
On Friday, October 31, 2014 11:26:02 AM UTC-4, Ron McOuat wrote: > > Thanks Anthony, that worked. For some reason lambdas still confuse me, I > need to work on that. > Note, it doesn't have to be a lambda -- you can write a separate function: def address_format(row): return '%s %s' % (row.st

[web2py] Re: Format specification for chained one to many

2014-10-31 Thread Ron McOuat
Thanks Anthony, that worked. For some reason lambdas still confuse me, I need to work on that. In terms of the model I didn't show all the fields, there are mid block addresses as well. I am thinking the best way forward is to denormalize the road table into the address table and put the values

[web2py] Re: Format specification for chained one to many

2014-10-30 Thread Anthony
> # Road table, some winding roads are both street and avenue > db.define_table('road', > Field('name', 'string', length=32, unique=True, required=True, > notnull=True, label='Road Name'), > Field('is_street', 'boolean', default=False), > Field('is_avenue', 'boolean', default=False),

[web2py] Re: Format dropdown list generated from a database table with OPTION helper

2014-09-20 Thread Massimo Di Pierro
Your format is a function therefore db.t_birthplace._format % row should be db.t_birthplace._format(row) On Wednesday, 17 September 2014 22:00:37 UTC-5, Fei Zhao wrote: > > I would like to generate a dropdown list dynamically according to the > records of a table, which refers to other tables

[web2py] Re: Format date after selecting field from database

2013-12-09 Thread Massimo Di Pierro
print row.comment_date.strftime('%d/%m/%Y') On Monday, 9 December 2013 08:42:42 UTC-6, Simon Carr wrote: > > I have this line > > > comment_RS = self.db(self.db.aol_comments.aol_id == item.text(0)).select( > orderby=~self.db.aol_comments.comment_date) >

[web2py] Re: format and represent on table

2013-03-28 Thread 黄祥
nope, it just the futsal app the one that is similar to hotel management appliance. the room in the the hotel management appliance i rename it into court for futsal court. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe fr

[web2py] Re: format and represent on table

2013-03-27 Thread Alex Glaros
just curious Steve, are you writing a court app for government? Alex Glaros On Tuesday, March 26, 2013 10:43:53 PM UTC-7, 黄祥 wrote: > > hi, > > i've already define format in table but it seems return the id instead of > the format i've define, when i define represent on the field of the other

[web2py] Re: format and represent on table

2013-03-27 Thread 黄祥
a, i c, thank you so much for your detail explaination, massimo. -- --- 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 m

[web2py] Re: format and represent on table

2013-03-27 Thread Massimo Di Pierro
The problem is that table._format is used to build field.represent only for references only when format is a string. In your case it is a function which performs a nested query. That is very expensive. Web2py wants you to be explicit before using it that to build a dropdown. It works (in the fi

Re: [web2py] Re: Format of Start Time in scheduler_task

2012-09-16 Thread Martin Weissenboeck
Checked again - no errors, Thanky you! 2012/9/16 Massimo Di Pierro > I made a change but forgot to inport the validator. The IS_DATETIME should > be there for compatibility. > > > On Sunday, 16 September 2012 13:41:10 UTC-5, mweissen wrote: > >> I have checked it. I have got >> >> File: "...\sc

Re: [web2py] Re: Format of Start Time in scheduler_task

2012-09-16 Thread Massimo Di Pierro
I made a change but forgot to inport the validator. The IS_DATETIME should be there for compatibility. On Sunday, 16 September 2012 13:41:10 UTC-5, mweissen wrote: > > I have checked it. I have got > > File: "...\scheduler.py", line 458, in define_table > requires = IS_DATETIME()), > NameError:

Re: [web2py] Re: Format of Start Time in scheduler_task

2012-09-16 Thread Martin Weissenboeck
I have checked it. I have got File: "...\scheduler.py", line 458, in define_table requires = IS_DATETIME()), NameError: global name 'IS_DATTIME' is not defined Sorry, I am not shure whether this line comes from the trunk or from my tries. Without this line it works perfect. 2012/9/16 Massimo

[web2py] Re: Format of Start Time in scheduler_task

2012-09-16 Thread Massimo Di Pierro
I think this is now fixed. Can you please check trunk? On Sunday, 16 September 2012 01:54:00 UTC-5, mweissen wrote: > > A minor problem: > > Looking at a row of db.scheduler_task using admin shows: > > Start Time: > Next Run Time: > Stop Time: > "Next Run Time" and "Stop Time" use the format "%

[web2py] Re: format attribute in Record Representation

2012-08-01 Thread lyn2py
That worked! Thanks Anthony! bfdy4 On Thursday, August 2, 2012 4:20:39 AM UTC+8, Anthony wrote: > > You have to remove the entire "requires" attribute. Try defining the > health table after the types and tabs tables: > > db.define_table('types', > Field('name','string',length=255,requires=IS_

[web2py] Re: format attribute in Record Representation

2012-08-01 Thread Anthony
You have to remove the entire "requires" attribute. Try defining the health table after the types and tabs tables: db.define_table('types', Field('name','string',length=255,requires=IS_NOT_EMPTY()), Field('description','text',requires=IS_NOT_EMPTY()), format='%(name)s (%(description)s

[web2py] Re: format attribute in Record Representation

2012-08-01 Thread lyn2py
I'm trying to understand... Do you mean that if I leave out the validator, i.e. make it requires=IS_IN_DB(db,'sometable.id') or do you mean to remove the whole "requires" attribute? Yes, they are exactly the same (the format attributes in table and in the reference), and I don't wish to repeat

[web2py] Re: format attribute in Record Representation

2012-08-01 Thread Anthony
> > Do you mean like: > > requires=IS_IN_DB(db,'sometable.id','%(name)s (%(description)s)') > > If so, yes I have them there. The purpose is to create the drop down > menu... unless I'm doing it wrong? Or is there another way about it so that > the references will appear per the manual? > Yes,

[web2py] Re: format attribute in Record Representation

2012-08-01 Thread lyn2py
Do you mean like: requires=IS_IN_DB(db,'sometable.id','%(name)s (%(description)s)') If so, yes I have them there. The purpose is to create the drop down menu... unless I'm doing it wrong? Or is there another way about it so that the references will appear per the manual? Thanks Anthony! On We

[web2py] Re: format attribute in Record Representation

2012-08-01 Thread Anthony
Have you explicitly set any validators for the field (e.g., IS_IN_DB)? I believe you only get the default represent attribute when you don't explicitly set a validator (perhaps that should be changed). Anthony On Wednesday, August 1, 2012 11:17:24 AM UTC-4, lyn2py wrote: > > I refer to http://w

[web2py] Re: Format representation in foreign table.

2012-05-20 Thread Anthony
On Sunday, May 20, 2012 11:49:41 AM UTC-4, rahulserver wrote: > > Thanks Anthony! > > I did as u said but now i get the following error: > 'NoneType' object has no attribute > 'Account' > > Here is the line which was found erroraneous(in pink): > > def viewreport(): > form=SQLFORM.factory(Fi

[web2py] Re: Format representation in foreign table.

2012-05-20 Thread rahulserver
Thanks Anthony! I did as u said but now i get the following error: 'NoneType' object has no attribute 'Account' Here is the line which was found erroraneous(in pink): def viewreport(): form=SQLFORM.factory(Field('TID',requires=IS_IN_DB(db, db.Transaction_Master.id, lambda r: '%s %s %

[web2py] Re: Format representation in foreign table.

2012-05-20 Thread Anthony
> > db.define_table('Account_Master',Field('Account',requires=IS_NOT_EMPTY()),Field('Sewadari1'),Field('Mb1'),Field('Sewadari2'),Field('Mb2'),Field('City'),Field('District'),Field('State'),Field('Email'),Field('Remark'),format='%(Account)s > > %(State)s ') > > db.define_table('Transaction_Master

Re: [web2py] Re: format parameter not working?

2011-12-23 Thread Thomas Dall'Agnese
Correct! It works now, thanks! [image: Screenshot at 2011-12-24 00:29:10.png] Best Regards, Thomas On Sat, Dec 24, 2011 at 12:26 AM, Anthony wrote: > In order for the validators for a reference field to be created > automatically, I think the referenced tables have to be defined first > (ot

[web2py] Re: format parameter not working?

2011-12-23 Thread Anthony
In order for the validators for a reference field to be created automatically, I think the referenced tables have to be defined first (otherwise the validators cannot be defined because they refer to the referenced table). So, try defining db.comment after the other tables that it references.

[web2py] Re: format parameter not working?

2011-12-23 Thread Thomas Dall'Agnese
Sure. db.define_table('comment', Field('user', type='reference auth_user', label=T('User')), Field('date_added', type='datetime', label=T('Date Added')), Field('error_type', type='reference error_type', label=T('Error Type')), Field('balise', type='ref

[web2py] Re: format parameter not working?

2011-12-23 Thread Anthony
Can you show your code? On Friday, December 23, 2011 6:08:25 AM UTC-5, Thomas Dall'Agnese wrote: > > Hi, > > I set the format of a table to a given field, and reference it in another > table. > Unfortunately, the format seems to be ignored and instead of a combobox > there is a textfield where I

[web2py] Re: format=

2011-11-16 Thread annet
Jim and Richard, Thanks for your replies, problem solved. Kind regards, Annet.

[web2py] Re: format strings and multiple levels of indirection [SOLVED]

2011-02-14 Thread rocket
I think I've found the solution here: http://groups.google.com/group/web2py/browse_thread/thread/1d94e9bfc9877769 format=lambda r: r.f_tbte_project_number + r.f_client.f_name +r.f_name On Feb 14, 1:58 pm, rocket wrote: > Hi, > > I have two tables defined like this: > > db.define_table('t_c

[web2py] Re: format vs represent vs IS_IN_DB(..., label='', ...)

2010-12-09 Thread mr.freeze
Represent functions are used to control the display of a field's value for output in forms: db.thing.id.represent = lambda value: A(value,_href=URL('show',args=value)) Widget functions are used to control the input of a field's value in forms: db.thing.name.widget = lambda field,value: SQLFORM.wid

[web2py] Re: format problem, please help

2010-11-25 Thread mdipierro
If you just do this it should do what you ask: db.define_table('target', Field('name', required=True), Field('address', required=True), Field('comment', default=''), format='%(name)s') db.define_table('pac', Field('name', required=True), Field('comment', default=''), Field

[web2py] Re: format=

2010-10-08 Thread andrej burja
is it ok if i see only id in the drop-down filed writing db.tecaj.oseba.requires=IS_IN_DB(db,'oseba.id') and ime priimek when db.tecaj.oseba.requires=IS_IN_DB(db,'oseba.id','%(ime)s %(priimek)s') On Oct 4, 4:20 pm, mdipierro wrote: > This > >    db.tecaj.oseba.requires=IS_IN_DB(db,'oseba.id'

[web2py] Re: format=

2010-10-04 Thread mdipierro
This db.tecaj.oseba.requires=IS_IN_DB(db,'oseba.id','%(ime)s % (priimek)s') is automatic for all referencing fields when you do db.define_table('oseba',...,format='%(ime)s %(priimek)s') You do the former manually only if you need a more complex requirement. On Oct 4, 9:14 am, andrej bur

[web2py] Re: Format= ?

2010-09-25 Thread Johann Spies
represent=lambda id:db_auth_user(id).username does also not make a difference. Johann --  May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord!  His divine power has given us everything we need for life and godliness through the full knowledge of the

[web2py] Re: format zero IS_IN_DB

2010-02-05 Thread villas
If I've understood the arguments correctly, I think there are 3 good reasons to keep as-is: 1. We should assume the average user to be as lazy as possible and make as few clicks as they can. This means that with default=None the first option will often be passively selected. i.e. many of your u

[web2py] Re: format zero IS_IN_DB

2010-02-05 Thread Iceberg
I also support zero=None, and it is not difficult for me to decide. 1. From the logical point of view, when saying IS_IN_DB(...) or IS_IN_SET(...), it should generate a list that actually is in the set/ db, and nothing more. Besides, this is the way it worked before zero=something is initially inv

Re: [web2py] Re: format zero IS_IN_DB

2010-02-04 Thread Thadeus Burgess
This is a difficult to decide. For me it is both ways. Since half of my forms require zero=None and the other half require zero='', either way it goes there will be no option that is more "convenient" for my development. I stand in support of zero=None. Web2py is a data/business logic oriented fra

Re: [web2py] Re: format zero IS_IN_DB

2010-02-04 Thread Jonathan Lundell
On Feb 4, 2010, at 7:34 AM, mdipierro wrote: > Mind that currently zero='' should be interpreted as zero='(please > choose a value)'. the value '' is not in the db and will not pass > validation. It s just a place holder. Only if > IS_NULL_OR(IS_IN_DB(...zero='')) then the value '' can pass > vali

[web2py] Re: format zero IS_IN_DB

2010-02-04 Thread mdipierro
Mind that currently zero='' should be interpreted as zero='(please choose a value)'. the value '' is not in the db and will not pass validation. It s just a place holder. Only if IS_NULL_OR(IS_IN_DB(...zero='')) then the value '' can pass validation. On Feb 4, 9:25 am, Jonathan Lundell wrote: > O

Re: [web2py] Re: format zero IS_IN_DB

2010-02-04 Thread Jonathan Lundell
On Feb 4, 2010, at 7:08 AM, mdipierro wrote: > I do not really have an opinion on this. I am only reluctant to > changes in behavior. > Anyway, I am prepared to make this change (zero=None by default). I > would like to know that all major contributors are on board so that > you can answer the ema

[web2py] Re: format zero IS_IN_DB

2010-02-04 Thread mdipierro
I do not really have an opinion on this. I am only reluctant to changes in behavior. Anyway, I am prepared to make this change (zero=None by default). I would like to know that all major contributors are on board so that you can answer the emails when users complain instead of me. ;-) Anybody who

[web2py] Re: format zero IS_IN_DB

2010-02-04 Thread DenesL
Any more pros/cons on this? Now is the time to weigh in your opinion. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr..

[web2py] Re: format zero IS_IN_DB

2010-02-02 Thread DenesL
^bump^ -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http:

Re: [web2py] Re: format zero IS_IN_DB

2010-01-30 Thread Thadeus Burgess
Excellent suggestion on adding the comments with a link to the discussion thread Iceberg -Thadeus On Sat, Jan 30, 2010 at 2:07 AM, Iceberg wrote: > When saying "some people ask for zero=None, some for zero='', some for > zero='Please choose a value'", ok, I am the one who once suggest the >

[web2py] Re: format zero IS_IN_DB

2010-01-30 Thread Iceberg
When saying "some people ask for zero=None, some for zero='', some for zero='Please choose a value'", ok, I am the one who once suggest the recent zero='' change, in this thread: https://groups.google.com/group/web2py/browse_frm/thread/7a5154c377c9eec3 But hey, I think I made myself clear in tha

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread mdipierro
I think the point is: is it better to generate a validation error message when a choice is not selected or, by default, select always the first choice? Are you sure that the problem is with the presence of a blank option and not with the wrong error associated to it? On Jan 29, 9:55 am, Thadeus Bu

Re: [web2py] Re: format zero IS_IN_DB

2010-01-29 Thread Thadeus Burgess
+1 supporting DenesL argument. (but we already know this) note. default. breaks app. we like the feature but it shouldn't break an app no reason to have to specifically DISABLE something that hasn't existed in web2py before ( you know, the empty select or "please choose a value" breaks my app

Re: [web2py] Re: format zero IS_IN_DB

2010-01-29 Thread Jonathan Lundell
Yes, the option is important. But the case for a default of None is pretty convincing. On 1/29/10, mdipierro wrote: > Let's hear a few more opinions. I don't just want to say no. The > problem is that we had this discussion already and people insisted > such option should be there. > > Massimo >

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread mdipierro
Let's hear a few more opinions. I don't just want to say no. The problem is that we had this discussion already and people insisted such option should be there. Massimo On Jan 29, 9:31 am, DenesL wrote: > I must insist. > The point is that IS_IN_DB and IS_IN_SET now show a spurious empty > optio

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread DenesL
I must insist. The point is that IS_IN_DB and IS_IN_SET now show a spurious empty option by default. The keyword here is default. If you want to introduce a 'choose a value" option you should do it explicitly and 'at your own risk', the risk being that it creates an option that when selected will

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread mdipierro
There is no way to please everybody here. some people ask for zero=None, some for zero='', some for zero='Please choose a value'. There is no right or wrong. I think we should leave the default as is ('', we changed it twice already) and you configure it as needed. Massimo On Jan 29, 9:00 am, Den

[web2py] Re: format zero IS_IN_DB

2010-01-29 Thread DenesL
-- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://grou

Re: [web2py] Re: format zero IS_IN_DB

2010-01-28 Thread Thadeus Burgess
My thoughts exactly :) -Thadeus On Thu, Jan 28, 2010 at 12:55 PM, DenesL wrote: > Thanks, I've seen it. > > The problem with format and IS_IN_DB can be easily fixed in sql.py but > I would be against setting the default of zero to '' in IS_IN_DB and > IS_IN_SET if it creates an empty option

[web2py] Re: format zero IS_IN_DB

2010-01-28 Thread DenesL
Thanks, I've seen it. The problem with format and IS_IN_DB can be easily fixed in sql.py but I would be against setting the default of zero to '' in IS_IN_DB and IS_IN_SET if it creates an empty option in the dropdown. zero seems to have been introduced to display a "choose a value" kind of messa

[web2py] Re: format = lambda ... give error

2010-01-17 Thread KMax
Ok! 1.74.6 helps. My linux instalation was not updated, while windows is update date which confuse me. On 17 янв, 19:02, KMax wrote: > my fall, > I'l make better samble (missed ",") > > On 17 янв, 18:45, KMax wrote: > > > Please find test code below > > If i remove format = lambda x: from defi

[web2py] Re: format = lambda ... give error

2010-01-17 Thread KMax
my fall, I'l make better samble (missed ",") On 17 янв, 18:45, KMax wrote: > Please find test code below > If i remove format = lambda x: from defining db.a, no error appears > > Error traceback > Traceback (most recent call last): >   File "gluon/restricted.py", line 171, in res