[web2py] Re: Some beginner questions on form
On Nov 2, 7:38 pm, Jonathan Lundell wrote: > On Nov 2, 2010, at 4:09 PM, pierreth wrote: > > A tuple works fine, but zero=None isn't part of the tuple. > > IS_IN_SET(("Dr", "Dre", "M.", "Me", "Mme", "Mlle", "Mr", "Miss", "Mrs", > "hon"), zero=None) > You are right. I was wrong.
Re: [web2py] Re: Some beginner questions on form
On Nov 2, 2010, at 4:09 PM, pierreth wrote: > > OK, it works when the enumeration is in a list but not when the same > enumeration is in a tuple. A tuple works fine, but zero=None isn't part of the tuple. IS_IN_SET(("Dr", "Dre", "M.", "Me", "Mme", "Mlle", "Mr", "Miss", "Mrs", "hon"), zero=None) > > Thanks. > > On 2 nov, 18:53, Bruno Rocha wrote: >> You can try >> >> IS_IN_SET(["Dr", "Dre", "M.", "Me", "Mme", "Mlle", "Mr", "Miss", "Mrs", >> "hon"], zero=None) >> >> 2010/11/2 pierreth >> >> >> >>> I have: >> >>> IS_IN_SET("Dr", "Dre", "M.", "Me", "Mme", "Mlle", "Mr", "Miss", "Mrs", >>> "hon", zero=None) >> >>> and it changes nothing. Do you mean something else? >> >>> On 2 nov, 17:54, mdipierro wrote: IS_IN_SET(...,zero=None) >> On Nov 2, 4:44 pm, pierreth wrote: >> > I have a blank line in the menu when I use IS_IN_SET. How can I remove > it? >> >> -- >> >> http://rochacbruno.com.br
[web2py] Re: Some beginner questions on form
OK, it works when the enumeration is in a list but not when the same enumeration is in a tuple. Thanks. On 2 nov, 18:53, Bruno Rocha wrote: > You can try > > IS_IN_SET(["Dr", "Dre", "M.", "Me", "Mme", "Mlle", "Mr", "Miss", "Mrs", > "hon"], zero=None) > > 2010/11/2 pierreth > > > > > I have: > > > IS_IN_SET("Dr", "Dre", "M.", "Me", "Mme", "Mlle", "Mr", "Miss", "Mrs", > > "hon", zero=None) > > > and it changes nothing. Do you mean something else? > > > On 2 nov, 17:54, mdipierro wrote: > > > IS_IN_SET(...,zero=None) > > > > On Nov 2, 4:44 pm, pierreth wrote: > > > > > I have a blank line in the menu when I use IS_IN_SET. How can I remove > > > > it? > > -- > > http://rochacbruno.com.br
Re: [web2py] Re: Some beginner questions on form
You can try IS_IN_SET(["Dr", "Dre", "M.", "Me", "Mme", "Mlle", "Mr", "Miss", "Mrs", "hon"], zero=None) 2010/11/2 pierreth > I have: > > IS_IN_SET("Dr", "Dre", "M.", "Me", "Mme", "Mlle", "Mr", "Miss", "Mrs", > "hon", zero=None) > > and it changes nothing. Do you mean something else? > > On 2 nov, 17:54, mdipierro wrote: > > IS_IN_SET(...,zero=None) > > > > On Nov 2, 4:44 pm, pierreth wrote: > > > > > I have a blank line in the menu when I use IS_IN_SET. How can I remove > > > it? > > > > > -- http://rochacbruno.com.br
[web2py] Re: Some beginner questions on form
I have: IS_IN_SET("Dr", "Dre", "M.", "Me", "Mme", "Mlle", "Mr", "Miss", "Mrs", "hon", zero=None) and it changes nothing. Do you mean something else? On 2 nov, 17:54, mdipierro wrote: > IS_IN_SET(...,zero=None) > > On Nov 2, 4:44 pm, pierreth wrote: > > > I have a blank line in the menu when I use IS_IN_SET. How can I remove > > it? > >
[web2py] Re: Some beginner questions on form
IS_IN_SET(...,zero=None) On Nov 2, 4:44 pm, pierreth wrote: > I have a blank line in the menu when I use IS_IN_SET. How can I remove > it?
[web2py] Re: Some beginner questions on form
I have a blank line in the menu when I use IS_IN_SET. How can I remove it?
[web2py] Re: Some beginner questions on form
On 29 oct, 19:48, villas wrote: > Tuples. Even better, I didn't realise that advantage regarding > sorting. > Also in the book, please? :) Now yet in the book. A wonder that should be there!
[web2py] Re: Some beginner questions on form
On 29 oct, 19:48, villas wrote: > Tuples. Even better, I didn't realise that advantage regarding > sorting. > Also in the book, please? :) Now yet in the book. A wonder that should be there!
[web2py] Re: Some beginner questions on form
Tuples. Even better, I didn't realise that advantage regarding sorting. Also in the book, please? :) On Oct 29, 7:57 pm, mdipierro wrote: > It can also take a list of tuples. It will work like a dict of > (key,value) but preserves sorting. > > On Oct 29, 11:32 am, villas wrote: > > > >>requires=IS_IN_SET({'key1':'label1','key2':'label2','key3':'label3'}) > > > @David - thanks for reminding us of this. > > > Book editors please note... > > The fact that IS_IN_SET can accept a dict should be in the Book? > > (Please forgive me if I missed it there!). > > > -D > >
[web2py] Re: Some beginner questions on form
It can also take a list of tuples. It will work like a dict of (key,value) but preserves sorting. On Oct 29, 11:32 am, villas wrote: > >>requires=IS_IN_SET({'key1':'label1','key2':'label2','key3':'label3'}) > > @David - thanks for reminding us of this. > > Book editors please note... > The fact that IS_IN_SET can accept a dict should be in the Book? > (Please forgive me if I missed it there!). > > -D
[web2py] Re: Some beginner questions on form
>>requires=IS_IN_SET({'key1':'label1','key2':'label2','key3':'label3'}) @David - thanks for reminding us of this. Book editors please note... The fact that IS_IN_SET can accept a dict should be in the Book? (Please forgive me if I missed it there!). -D
[web2py] Re: Some beginner questions on form
On 29 oct, 03:22, David Marko wrote: > Yes, you can use dictionary to define values e.g. > Field( > > 'name',requires=IS_IN_SET({'key1':'label1','key2':'label2','key3':'label3'}) > ) > > David > I'm beginning to really like web2py I think!
Re: [web2py] Re: Some beginner questions on form
* www.ksrista.com search your life partner*
[web2py] Re: Some beginner questions on form
Yes, you can use dictionary to define values e.g. Field( 'name',requires=IS_IN_SET({'key1':'label1','key2':'label2','key3':'label3'}) ) David On 29 říj, 02:30, pierreth wrote: > On 27 oct, 23:10, mdipierro wrote: > > > > > Field('name',requires=IS_IN_SET(('value1,'value2',value3'))) > > This is cool. Can I have valuex in the db while presenting something > else to the user (I want to value in my db to be always in English but > I need to translate these values for the user) without having to do a > conversion function that will translate values send my the form to > English?
[web2py] Re: Some beginner questions on form
On 27 oct, 23:10, mdipierro wrote: > > Field('name',requires=IS_IN_SET(('value1,'value2',value3'))) This is cool. Can I have valuex in the db while presenting something else to the user (I want to value in my db to be always in English but I need to translate these values for the user) without having to do a conversion function that will translate values send my the form to English?
[web2py] Re: Some beginner questions on form
On Oct 27, 7:45 pm, pierreth wrote: > Hello, > > I am doing my first application with web2py and I don't know how to do > some things with forms. > > Like I would like to show a drop menu to show the possible values for > a text field. How can I specify this menu with define_table? > Field('name',requires=IS_IN_SET(('value1,'value2',value3'))) > Another thing that I would like to do is format postal code and phone > numbers with javascript when the user leaves a field. jQuery(document).ready(function(){ var t=jQuery('#table_field'); t.keyup(function(){t.val(format(t.val());}); }); where "table" and "field" are your table and field names. format(...) is the function that formats the input into output and you need to define it in JS. > Could you guide me on this?