[web2py] Re: list:reference and SQLFORM.grid

2018-06-25 Thread Anthony
The default search widget does not support list:reference fields. You can create a custom search widget via the "search_widget" argument, and also specify a custom search query generator via the "searchable" argument. See the SQLFORM.search_menu and SQLFORM.build_query static methods to see how

[web2py] Re: list:reference and SQLFORM.grid

2018-06-25 Thread Paulo
I have the exact same question and can't find an easy solution in the web :/ Fields of the type list:reference with multiple choices don't show up in the smartgrid search engine. Any easy fix for this? Example in: http://cehum.ilch.uminho.pt/microrrelatos_xaquinnunez (The "Repertorio" field is a

[web2py] Re: list:reference how to show option popup instead of plain id's?

2016-05-18 Thread villas
If you specify more than one validator, e.g. [IS_NOT_EMPTY(), IS_IN_DB()] then you suppress the drop-down. From memory, you can simply re-specify the multiple widget with .widget In any case, this... > I have workaround: IS_IN_DB(, multiple=(1,999)) means you are asking to select at lea

[web2py] Re: list:reference how to show option popup instead of plain id's?

2016-05-12 Thread Mirek Zvolský
oops, when I remove requires= completly, i.e. when I run with default IS_IN_DB validator, then I see a different widget (probably a proper one): all choices listed, and I can choose more rows using Ctrl+click. So probably I should write better requires= When I replace: [IS_NOT_EMPTY(), IS_IN

[web2py] Re: list:reference - Input Data

2016-04-28 Thread 黄祥
please try: db.movies.category.requires = IS_IN_DB(db, 'categories.title', db.categories._format, multiple = True) ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators#Validators best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Re: list:reference, multiple=True, validation error

2016-03-09 Thread villas
I just saw that issue no. 1203 has been addressed by a new commit. I did a quick test and the bug seems to have been resolved. Many thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/we

[web2py] Re: list:reference, multiple=True, validation error

2016-03-09 Thread villas
On Tuesday, 8 March 2016 18:12:07 UTC, Leonel Câmara wrote: > > Do you have multiple=True as a keyword argument to your IS_IN_DB validator? > My entire test code is as stated in this thread. I invite anyone who wishes to reproduce the bug to use that code. Make sure your web2py is using the la

[web2py] Re: list:reference, multiple=True, validation error

2016-03-08 Thread Leonel Câmara
Do you have multiple=True as a keyword argument to your IS_IN_DB validator? -- 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 beca

[web2py] Re: list:reference, multiple=True, validation error

2016-03-08 Thread villas
As I would like to get this fixed (and cannot do so myself), I raised this as an issue on Github (issue 1203 ) where I hope someone will be able to look at it. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://git

[web2py] Re: list:reference, multiple=True, validation error

2016-03-07 Thread villas
Could someone please assist to resolve this bug? I am not sure what to do to fix it. Please note that this bug is in the latest source. I believe that it is in the IS_IN_DB validator. Thanks to anyone who might be able to help. To replicate, please do this: > 1. Make a new app. > 2. P

[web2py] Re: list:reference, multiple=True, validation error

2016-03-04 Thread villas
Did you update to latest Web2py? I mean 'git pull'. On Friday, 4 March 2016 14:40:37 UTC, eric cuver wrote: > > I teste it on my web2py it work > > Le vendredi 4 mars 2016 15:24:39 UTC+1, villas a écrit : >> >> Hi Eric, Thanks for your interest. I believe that this is a bug in >> IS_IN_DB

[web2py] Re: list:reference, multiple=True, validation error

2016-03-04 Thread eric cuver
I teste it on my web2py it work Le vendredi 4 mars 2016 15:24:39 UTC+1, villas a écrit : > > Hi Eric, Thanks for your interest. I believe that this is a bug in > IS_IN_DB validator. I am surprised that more users have not reported it. > Try this to replicate. > > 1. Make a new app. > 2.

[web2py] Re: list:reference, multiple=True, validation error

2016-03-04 Thread villas
Hi Eric, Thanks for your interest. I believe that this is a bug in IS_IN_DB validator. I am surprised that more users have not reported it. Try this to replicate. 1. Make a new app. 2. Paste this at the bottom of models/db.py db.define_table('tag', Field('name'), Field('descr',len

[web2py] Re: list:reference, multiple=True, validation error

2016-03-04 Thread eric cuver
you can paste your code ? -- 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 "web

[web2py] Re: list:reference does not apply notnull=True

2015-11-03 Thread 黄祥
thank you so much for detail explanation, Anthony. what i want to achieve is maximum number of allowed values same like total counted record that store in reference table e.g. count_test1 = db(db.test1.id > 0).count() db.define_table('test0', Field('test1', 'list:reference test1'), format = '%(t

[web2py] Re: list:reference does not apply notnull=True

2015-11-03 Thread Anthony
multiple = (1, db.test1.id) The second value of the tuple should be an integer representing the maximum number of allowed values. It cannot be a Field object, and I'm not sure what you are trying to achieve with that. Anthony On Tuesday, November 3, 2015 at 7:59:07 PM UTC-5, 黄祥 wrote: > > just

[web2py] Re: list:reference does not apply notnull=True

2015-11-03 Thread 黄祥
just confirmation : is this right (the example : multiple = (1, x) ) ? e.g. when try to use x in above example it return an error NameError: global name 'x' is not defined db.define_table('test0', Field('test1', 'list:reference test1'), format = '%(test1)s') db.test0.test1.requires = IS_IN_DB(db

[web2py] Re: list:reference with SQLFORM.grid

2015-05-25 Thread villas
>> Have you updated web2py (and pydal) properly? Hi Paolo, Many thanks for looking into this. I updated earlier this weekend with git pull. How would I do it 'properly', do I have to use the recursive every time? Cheers, D -- Resources: - http://web2py.com - http://web2py.com/book (Docum

[web2py] Re: list:reference with SQLFORM.grid

2015-05-24 Thread Paolo Valleri
This issue has been already fixed https://github.com/web2py/pydal/commit/2172b776b9c41884717902e68900b41c105e0364#diff-114ce07f361177e0669ec9a374ef7d6a Have you updated web2py (and pydal) properly? Paolo On Monday, May 25, 2015 at 7:37:35 AM UTC+2, Mark Graves wrote: > > I seem to be having th

[web2py] Re: list:reference with SQLFORM.grid

2015-05-24 Thread Mark Graves
I seem to be having the same problem. On Sunday, May 24, 2015 at 6:58:26 PM UTC-5, villas wrote: > > Hi All, > > Can someone see what the problem is please? > > db.define_table('tag', Field('name')) > db.define_table('test',Field('name'),Field('tags','list:reference tag')) > > def test():

[web2py] Re: list:reference

2014-05-13 Thread Jesse Ferguson
On Tuesday, May 13, 2014 12:52:24 PM UTC-7, Jesse Ferguson wrote: > > anthony copy Mandar's Code exactly and then jus go and add a few parents > then try to add a child with two parents, you will encounter this error.. > Traceback > > 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8. > 9. > 10. > 11. > 12.

[web2py] Re: list:reference

2014-05-13 Thread Jesse Ferguson
anthony copy Mandar's Code exactly and then jus go and add a few parents then try to add a child with two parents, you will encounter this error.. Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File "C:\Users\User\Desktop\web2py\gluon\restricted.py", li

[web2py] Re: list:reference

2014-05-13 Thread Anthony
That bug was fixed almost two years ago, so it's definitely not still in trunk only. Could be a different bug. Please show all of your code as well as the full traceback. Anthony On Monday, May 12, 2014 11:27:10 PM UTC-4, Jesse Ferguson wrote: > > > https://groups.google.com/forum/#!searchin/we

[web2py] Re: list:reference

2014-05-13 Thread Mandar Vaze
On Tuesday, May 13, 2014 5:06:52 AM UTC+5:30, Michael Beller wrote: > > I haven't used 'list:reference' before, what are the advantages or use > cases for your approach rather than add a reference field such as > Field('daily', 'reference daily') on the post table? > Generic use case (I could

[web2py] Re: list:reference

2014-05-12 Thread Jesse Ferguson
https://groups.google.com/forum/#!searchin/web2py/list$3Areference/web2py/pXBj0EhX3iA/vamglS5txQsJ seems this may be a bug in web2py... Does anyone know if this bugfix is still only in trunk or if it has been put into stable? -- Resources: - http://web2py.com - http://web2py.com/book (Documenta

[web2py] Re: list:reference

2014-05-12 Thread Jesse Ferguson
ok so it actually doesnt work which is really strange. it works on console however when i do it in a scheduled task it jacks up the database somehow, i think I may be inserting the references incorrectly... I will investigate this tonight and try to give everyone an answer -- Resources: -

[web2py] Re: list:reference

2014-05-12 Thread Michael Beller
I haven't used 'list:reference' before, what are the advantages or use cases for your approach rather than add a reference field such as Field('daily', 'reference daily') on the post table? On Monday, May 12, 2014 2:06:01 AM UTC-4, Jesse Ferguson wrote: > > I FIgured it out, I was missing the fi

[web2py] Re: list:reference

2014-05-12 Thread Dave S
On Sunday, May 11, 2014 11:06:01 PM UTC-7, Jesse Ferguson wrote: > > I FIgured it out, I was missing the field name when trying to add values i > was doing row.update(data) instead of row.update(posts=data) > Glad you got it working. Now I can search for this post when I get puzzled. /dps

[web2py] Re: list:reference

2014-05-11 Thread Jesse Ferguson
I FIgured it out, I was missing the field name when trying to add values i was doing row.update(data) instead of row.update(posts=data) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2p

[web2py] Re: list:reference does not apply notnull=True

2014-03-02 Thread Anthony
Values in list:-type fields are stored delimited by "|" characters, so when you insert an empty list, "||" is what actually gets inserted in the database. Because notnull is enforced by the database, entering an empty list does not generate an error because "||" is a string and therefore not nu

[web2py] Re: list:reference does not apply notnull=True

2014-03-02 Thread André Kablu
just found the answer multiple=(1,x) anyway would be good if the notnull param works Em domingo, 2 de março de 2014 16h34min35s UTC-3, André Kablu escreveu: > > I am using version 2.9.1 beta > > When creating a db, if I use this: > > Field('product_ids', 'list:reference product') > > Does

[web2py] Re: list:reference or many-to-many

2014-01-17 Thread Najtsirk
Thanks, Massimo. On Friday, 17 January 2014 19:12:00 UTC+1, Massimo Di Pierro wrote: > > list:reference is faster for finding referenced fields > many-to-many are faster for finding referencing fields. > > Usually categories are nested. I assume you want tags instead of > categories (it is more g

[web2py] Re: list:reference or many-to-many

2014-01-17 Thread Massimo Di Pierro
P.S. the custom validator makes the tags work great with this: https://github.com/xoxco/jQuery-Tags-Input On Friday, 17 January 2014 12:12:00 UTC-6, Massimo Di Pierro wrote: > > list:reference is faster for finding referenced fields > many-to-many are faster for finding referencing fields. > > Usu

[web2py] Re: list:reference or many-to-many

2014-01-17 Thread Massimo Di Pierro
list:reference is faster for finding referenced fields many-to-many are faster for finding referencing fields. Usually categories are nested. I assume you want tags instead of categories (it is more general). I usually use both approaches and de-normalize it. Below there is class Tag (which is

Re: [web2py] Re: list:reference painfull to fill

2013-12-14 Thread Richard Vézina
I forget... Don' forget to surround with tag... {{=XML(your_pass_js_script)}} On Sat, Dec 14, 2013 at 3:17 PM, Richard Vézina wrote: > In the view something like that : > > $( document ).ready(function() { > $('input#id').bsmselect(...); > }); > > It can be pass to the view from the con

Re: [web2py] Re: list:reference painfull to fill

2013-12-14 Thread Richard Vézina
In the view something like that : $( document ).ready(function() { $('input#id').bsmselect(...); }); It can be pass to the view from the controller, as you want... So you will need to do something like that : {{=XML(your_pass_js_script)}} :) Richard On Fri, Dec 13, 2013 at 6:38 PM, Jesse

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Jesse Ferguson
sorry to hop in and ask a silly question but, when you say init the js on the field how is that supposed to be done in web2py? Is it done in the view? would it be ideal to put the js in the template and then pass params? any named optional attribute is passed to the tag > > for ex

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Richard Vézina
You init the js on the field!! Richard On Fri, Dec 13, 2013 at 10:20 AM, Kevin Bethke wrote: > Well actually I got one more question: How do you change the standard form > from web2py, to use the bsmselect form? > > > On Fri, Dec 13, 2013 at 4:18 PM, Kevin Bethke wrote: > >> Thanks it explains

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Kevin Bethke
Well actually I got one more question: How do you change the standard form from web2py, to use the bsmselect form? On Fri, Dec 13, 2013 at 4:18 PM, Kevin Bethke wrote: > Thanks it explains a lot. I will try to work on it as soon as I got the > time. Unfortunatly we got a deadline at work which i

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Kevin Bethke
Thanks it explains a lot. I will try to work on it as soon as I got the time. Unfortunatly we got a deadline at work which is Christmas. So I will probably not work on it till than. On Fri, Dec 13, 2013 at 3:53 PM, Richard Vézina wrote: > I am sorry about that... > > Web2py default behavior for

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Richard Vézina
I am sorry about that... Web2py default behavior for list:reference or reference is a HTML Select and option... This is ordered by the navigator base on the spelling of the element... So when you edit your form if you want to maintain the preexisting order (the one that were there when you select

Re: [web2py] Re: list:reference painfull to fill

2013-12-13 Thread Kevin Bethke
thanks but to be honest now I'm even more confused. why do you need a piece of jquery code in a javascript variable. I sopose you included the entire jquery library. Why do you do the ordering with javascript and not with python is there a special reason for this? I think I just explained the last

Re: [web2py] Re: list:reference painfull to fill

2013-12-12 Thread Richard Vézina
It's a bit hacky but it works... :) Richard On Thu, Dec 12, 2013 at 9:48 AM, Richard Vézina wrote: > Don't bother with the php thing... > > Just look the data structure of the select... > > Here what I do to restore proper order on update form : > > controller_view_js += """ > var ordered_val

Re: [web2py] Re: list:reference painfull to fill

2013-12-12 Thread Richard Vézina
Don't bother with the php thing... Just look the data structure of the select... Here what I do to restore proper order on update form : controller_view_js += """ var ordered_values = ''%s''; $(document).ready(function() { if(ordered_values != "None") { $.each(ordered_values, functio

[web2py] Re: list:reference painfull to fill

2013-12-12 Thread BlueShadow
thanks for your offer I'm working my way through the example code but my biggest problem is that php site. I don't know php. But from what I get from the php code is that all the sample cities need to be in an unordered list environment ... but this form part of the bsmselect example really conf

Re: [web2py] Re: list:reference + multiple=True, how to format in edit selection listbox?

2013-07-11 Thread Richard Vézina
requires for dropbox control representation (in you requires : '%(name)s' is what determine what are you option format) represent for representation on select Richard On Thu, Jul 11, 2013 at 4:18 PM, Michael Nagy wrote: > Ok, figured it out. The format specifier in the 'requires' is the magi

[web2py] Re: list:reference + multiple=True, how to format in edit selection listbox?

2013-07-11 Thread Michael Nagy
Ok, figured it out. The format specifier in the 'requires' is the magic one, not the one in the 'represent'. So my original: db.script.configs.requires = IS_IN_DB(db, db.config, '%(name)s', multiple=True) Became: db.script.configs.requires = IS_IN_DB(db, db.config, lambda r: format_conf

[web2py] Re: list:reference + multiple=True, how to format in edit selection listbox?

2013-07-10 Thread Michael Nagy
Left out the 'name' field in the 'script' file when I boiled down my example. Doesn't affect the issue at hand, but just to be clear: db.define_table('script', Field('name'), Field('configs', 'list:reference config'), format='%(name)s') - Michael On Wednesday, July

[web2py] Re: list:reference requires is not empty

2013-06-09 Thread Anthony
Use IS_IN_DB(..., multiple=(1, 1000)). The "multiple" argument to IS_IN_DB can be a tuple specifying the minimum and maximum number of items to be selected (note, you should set the maximum to a value you know will be above the maximum number of items in the list, unless you want to restrict i

[web2py] Re: list:reference requires is not empty

2013-06-09 Thread BlueShadow
I tried the IS_LIST_OF validator and I can't get ist to work. when I have no validator I got all names in my refrenced table. And I can select as much as I like, but when I use any validators the list disappears and I get an input for a string. I tried IS_LENGTH(minsize=1) as well as IS_LIST_OF

[web2py] Re: list:reference requires is not empty

2013-06-02 Thread Massimo Di Pierro
The IS_NOT_EMPTY validator is not compatible with a list:string field. A list can have zero elements. What you want it IS_LIST_OF(other_validator_for_elements, minimum, maximum) On Sunday, 2 June 2013 07:14:19 UTC-5, BlueShadow wrote: > > when one has a database field with a list:reference type

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-04-03 Thread Ricardo Cárdenas
Massimo, Yes, it works. The DAL now generates the following SQL, which does bring back the results I was expecting: I should mention that when I tested this model with the default SQLite driver, I got an error ticket. It is probably unrelated to this commit, but here it is just in case: no

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-04-01 Thread Ricardo Cárdenas
@niphlod - indeed, the use of expressions rather than values is not mentioned specifically in Ch. 6, though it is also not discounted. The added functionality would seem useful in many situations, while retaining the use of fixe

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-04-01 Thread Niphlod
@ricardo: this is done under the assumption that contains() takes a field it's nowhere documented in the book that this should work. contains() (just a few moments before the latest commit by Massimo) was supposed to take a "fixed" value, not a column. On Monday, April 1, 2013 4:31

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-04-01 Thread Massimo Di Pierro
Fixed in trunk. Please check it out. On Monday, 1 April 2013 08:59:20 UTC-5, Ricardo Cárdenas wrote: > > Hi, I think I've run into this problem too (Web2py 2.4.5-stable, > PostgreSQL 9.1.8.). > > I have a list of movies; each may be tagged with one or more genres. Each > user in the system may s

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-04-01 Thread Ricardo Cárdenas
Hi, I think I've run into this problem too (Web2py 2.4.5-stable, PostgreSQL 9.1.8.). I have a list of movies; each may be tagged with one or more genres. Each user in the system may show interest in one or more genres: db.define_table('genre', Field('name'), format='%(name)s') db.define_table('

[web2py] Re: list:reference widget depends on order of define_table statements

2013-03-20 Thread Anthony
In SQLFORM, a field with an IS_IN_DB or IS_IN_SET validator with multiple=True gets the multiple options widget. When you create a list:reference field, by default the field automatically gets assigned an IS_IN_DB validator (if you don't explicitly assign a validator). However, that is only pos

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-01-22 Thread Massimo Di Pierro
I understand the problem. Please open a ticket with a a request for improvement. On Tuesday, 22 January 2013 07:53:58 UTC-6, pablo@uam.es wrote: > > person = db(db.person.name='').select().first() >>> papers = db.paper.authors.contains(person.id).select() >>> >> >> Sorry, I didn't read ca

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-01-22 Thread pablo . angulo
> > person = db(db.person.name='').select().first() >> papers = db.paper.authors.contains(person.id).select() >> > > Sorry, I didn't read carefully enough. That's not what I need, I need to perform a join. My real-world query is rather like: db.define_table('person', Field('name', unique

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-01-22 Thread pablo . angulo
El lunes, 21 de enero de 2013 22:47:41 UTC+1, Massimo Di Pierro escribió: > > Now I understand the problem. You want to pass an expression where a value > is expected. I do not believe we can support this. INSTR does not solve the > problem because it would not be correct to looks for substring

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-01-21 Thread Massimo DiPierro
Now I understand the problem. You want to pass an expression where a value is expected. I do not believe we can support this. INSTR does not solve the problem because it would not be correct to looks for substrings. In fact paper.authors may contain '|12|13|' and it would incorrectly return that

[web2py] Re: 'list:reference', contains, Mysql, instr

2013-01-21 Thread Massimo Di Pierro
Before we attempt to fix this. It works for me as it is with sqlite. Why does doesn't it wirk with mysql? MySQL has a LIKE operator. Wat error do you get? I can see why using the INSTR operator on MySQL may be better but do we know it is faster? Massimo On Monday, 21 January 2013 08:55:40 UTC

Re: [web2py] Re: list:reference database selection

2012-09-20 Thread villas
Always good to help :) On Thursday, September 20, 2012 5:46:01 PM UTC+1, Andrew Evans wrote: > > OMG You are a genius! > > That worked and worked beautifully > > thank you so much > > *cheers > > Andrew > > On Thu, Sep 20, 2012 at 9:43 AM, villas >wrote: > >> Not sure I read your question care

Re: [web2py] Re: list:reference database selection

2012-09-20 Thread Andrew Evans
OMG You are a genius! That worked and worked beautifully thank you so much *cheers Andrew On Thu, Sep 20, 2012 at 9:43 AM, villas wrote: > Not sure I read your question carefully enough, but maybe you need > something like: > > query = db.listing.region.contains(region) > > Anyhow, contain

[web2py] Re: list:reference database selection

2012-09-20 Thread villas
Not sure I read your question carefully enough, but maybe you need something like: query = db.listing.region.contains(region) Anyhow, contains has a special usage for list fields. On Thursday, September 20, 2012 5:07:46 PM UTC+1, Andrew Evans wrote: > > I have since added format='%(title)s

[web2py] Re: list:reference database selection

2012-09-20 Thread Andrew Evans
I have since added format='%(title)s %(id)s' to the region table but the listing is not being selected Is it because it is a list? I have entered multiple region entries for a single listing any idea how to select that listing in each of those regions when using the region search method? *cheers

[web2py] Re: list:reference and crud.create a form in a form or a popup (django style) recipe ?

2012-03-18 Thread bussiere adrien
i've found that one : http://www.web2pyslices.com/slice/show/1446/widget-select-or-add-option I will try to make a generic adaptatin of that one. Regards Bussiere Le dimanche 18 mars 2012 11:31:23 UTC+1, Alan Etkin a écrit : > > I think that by default that table definition should show the >

[web2py] Re: list:reference and crud.create a form in a form or a popup (django style) recipe ?

2012-03-18 Thread Alan Etkin
I think that by default that table definition should show the multiselect widget in CRUD forms. If not, it should be possible to set it explicitly: db.mytable.myfield.widget = SQLFORM.widgets.multiple.widget And you can also create your own custom widgets by declaring a function that receives fie

[web2py] Re: list:reference validation

2011-12-18 Thread Anthony
It does: min <= len(values) < max Note it's a strict less than for the max, so if you want <= 2 values, that is equivalent to < 3. Basically, it's an inclusive min but an exclusive max. Anthony On Sunday, December 18, 2011 7:40:10 PM UTC-5, ニコノコ wrote: > > Anthony, could you elaborate a bit on

[web2py] Re: list:reference validation

2011-12-18 Thread Nik Go
Anthony, could you elaborate a bit on that notation? multiple=(0,3) I wanted a maximum of two items and yet I need to write "3". In the book, I've seen something similar with the limitby argument for DAL select: >>>for row in db().select(db.person.ALL, limitby=(0, 2)): print row.name which fetche

[web2py] Re: list:reference validation

2011-12-15 Thread Joseph Jude
There should be an option in google groups to like a reply which brings a bit of smile :-)

[web2py] Re: list:reference validation

2011-12-15 Thread Anthony
Shhh! It's a secret. Actually, it has been added to the new 4th edition, which should be available online soon. Anthony On Thursday, December 15, 2011 7:06:21 PM UTC-5, ニコノコ wrote: > > Thanks Anthony. I don't think I've seen that in the docs. > > On Thursday, December 15, 2011, Anthony wrote: >

[web2py] Re: list:reference validation

2011-12-15 Thread Nik Go
Thanks Anthony. I don't think I've seen that in the docs. On Thursday, December 15, 2011, Anthony wrote: > Try > > IS_IN_DB(..., multiple=(0, 3)) > > The "multiple" argument to IS_IN_SET and IS_IN_DB can be a list or tuple > specifying a minimum and maximum number of items to be selected (strictl

[web2py] Re: list:reference validation

2011-12-14 Thread Anthony
Try IS_IN_DB(..., multiple=(0, 3)) The "multiple" argument to IS_IN_SET and IS_IN_DB can be a list or tuple specifying a minimum and maximum number of items to be selected (strictly less than on the max, so set the max to 3 to make sure there are no more than 2). Anthony On Wednesday, Decemb

Re: [web2py] Re: list:reference , reprensent not working : potential issue

2011-09-08 Thread Richard Vézina
I forgot that I had create it [?], here it is : http://code.google.com/p/web2py/issues/detail?id=382&q=list Thanks to taking care... Richard On Thu, Sep 8, 2011 at 11:51 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Please open a ticket. > > On Sep 8, 8:57 am, Richard Vézina wr

[web2py] Re: list:reference , reprensent not working : potential issue

2011-09-08 Thread Massimo Di Pierro
Please open a ticket. On Sep 8, 8:57 am, Richard Vézina wrote: > PING > > Richard > > On Wed, Aug 17, 2011 at 4:43 PM, Richard Vézina > > > > > > > > wrote: > > Ok, forget notice, I think, I just should use something like this : > > > db.table2.linked_self.requires=\ > >     IS_EMPTY_OR(IS_IN_DB

[web2py] Re: list:reference update

2011-01-12 Thread dederocks
Great, thank you! On 12 jan, 23:03, Massimo Di Pierro wrote: > The update should be > > db(db.groupe.id==1).update(groupusers=[1,2]) > > or one of the following > > db.groupe[1].update_record(groupusers=[1,2]) > db.groupe(1).update_record(groupusers=[1,2]) > db.groupe(id=1).update_record(groupuse

[web2py] Re: list:reference update

2011-01-12 Thread Massimo Di Pierro
The update should be db(db.groupe.id==1).update(groupusers=[1,2]) or one of the following db.groupe[1].update_record(groupusers=[1,2]) db.groupe(1).update_record(groupusers=[1,2]) db.groupe(id=1).update_record(groupusers=[1,2]) db.groupe(db.groupe.id==1).update_record(groupusers=[1,2]) but NOT

[web2py] Re: list:reference update

2011-01-12 Thread dederocks
Hi Kenneth, Thanks a lot for getting back. Actualy, to my understanding, the 'list:reference' provides a way to bypass the third table, and most importantly the joins that don't work on GAE. A list of records is represented as a string with the ids separated by '¦'. E.g. in my example, the groupus

[web2py] Re: list:reference problem?

2011-01-06 Thread dederocks
To follow-up, switching from Sqlite to Postgresql gets this similar error, which I believe comes from dal (MATERIAU should be without "()"): Traceback (most recent call last): File "C:\Users\Andre\Documents\web2py\gluon\restricted.py", line 188, in restricted exec ccode in environment File

[web2py] Re: list:reference and orderby

2010-11-18 Thread mdipierro
No problem. Did not take long. Could have been a serious issue. On Nov 19, 1:37 am, Johann Spies wrote: > On 19 November 2010 09:28, mdipierro wrote: > > > oops. > > > requires = IS_IN_DB('instansie.id','%(naam)s',multiple= True,orderby = > > 'instansie.naam') > > > should be > > > requires = IS

Re: [web2py] Re: list:reference and orderby

2010-11-18 Thread Johann Spies
On 19 November 2010 09:28, mdipierro wrote: > oops. > > requires = IS_IN_DB('instansie.id','%(naam)s',multiple= True,orderby = > 'instansie.naam') > > should be > > requires = IS_IN_DB(db,'instansie.id','%(naam)s',multiple= > True,orderby = 'instansie.naam') > >

[web2py] Re: list:reference and orderby

2010-11-18 Thread mdipierro
oops. requires = IS_IN_DB('instansie.id','%(naam)s',multiple= True,orderby = 'instansie.naam') should be requires = IS_IN_DB(db,'instansie.id','%(naam)s',multiple= True,orderby = 'instansie.naam') On Nov 19, 1:26 am, Johann Spies wrote: > On 18 November 2010 14:07, mdipierro wrote: > > > > >

Re: [web2py] Re: list:reference and orderby

2010-11-18 Thread Johann Spies
On 18 November 2010 14:07, mdipierro wrote: > What is your requires statement? > > It was included in my previous post: > > > The model: > > > > db.define_table('instansie_nuwename', > > Field('nuutste', db.instansie, > > requires = IS_IN_DB(db, 'instansie.i

[web2py] Re: list:reference issue

2010-11-18 Thread mdipierro
I believe this issue is fixed in trunk. Please check it. Your sample code now works for me. On Nov 17, 11:49 am, Richard Vézina wrote: > Hello, > > The list:reference issue I discribed last week is still in trunk. I joint a > demo app with which it is possible to reproduce the issue. > > If the d

[web2py] Re: list:reference and orderby

2010-11-18 Thread mdipierro
What is your requires statement? On Nov 18, 1:53 am, Johann Spies wrote: > On 17 November 2010 16:48, mdipierro wrote: > > > IS_IN_DB(...,orderby=...) > > Thanks.  Now I get > > Traceback > > 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8. > 9. > > Traceback (most recent call last): >   File "/home/js/web

Re: [web2py] Re: list:reference and orderby

2010-11-17 Thread Johann Spies
On 17 November 2010 16:48, mdipierro wrote: > IS_IN_DB(...,orderby=...) > > Thanks. Now I get Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call last): File "/home/js/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/js/web2py/app

Re: [web2py] Re: list:reference issue

2010-11-17 Thread Richard Vézina
Thanks You are involved in a lot of dev... I understand the delay, no problem. It is just a kind of reminder ;-) Richard On Wed, Nov 17, 2010 at 2:31 PM, mdipierro wrote: > will look into this asap. > > On Nov 17, 11:49 am, Richard Vézina > wrote: > > Hello, > > > > The list:reference issue I

[web2py] Re: list:reference issue

2010-11-17 Thread mdipierro
will look into this asap. On Nov 17, 11:49 am, Richard Vézina wrote: > Hello, > > The list:reference issue I discribed last week is still in trunk. I joint a > demo app with which it is possible to reproduce the issue. > > If the date validator is triggered and the id of the referenced record is

[web2py] Re: list:reference and orderby

2010-11-17 Thread mdipierro
IS_IN_DB(...,orderby=...) On Nov 17, 2:08 am, Johann Spies wrote: > How can I get an ordered list in the dropdown when using list:reference > (something like IS_IN_DB's orderby = ...)? > > Regards > Johann > > -- >  May grace and peace be yours in abundance through the full knowledge of God > and

[web2py] Re: list:reference issue

2010-11-08 Thread mdipierro
This db.define_table('person', Field('office', db.office, requires = IS_IN_DB(db, 'office.id', '% (name)s', multiple=True)), Field('name')) should be db.define_table('person', Field('office', 'list:reference office), Field('name')) On Nov 8, 6:32 am, villas wro

[web2py] Re: list:reference issue

2010-11-08 Thread toan75
Thank villas. I get one more error: http://127.0.0.1:8000/init/appadmin/select/db?query=db.person.id%3E0 Traceback (most recent call last): File "E:\web2py-XDCB\gluon\restricted.py", line 188, in restricted exec ccode in environment File "E:/web2py-XDCB/applications/init/views/appadmin.ht

[web2py] Re: list:reference issue

2010-11-08 Thread villas
Hi toan75, You have a few problems here. My advice would be to get it working and then make changes from there, after reading the book. Maybe use this to begin: db.define_table('office', Field('name','string',length = 128), Field('description','text'), Field('pos','integer

[web2py] Re: list:reference issue

2010-11-08 Thread toan75
It's correct in my model? db.define_table('office', Field('name','string',length = 128,requires=ne), Field('description','text'), Field('pos','integer',default=100)) db.define_table('person', Field('office', db.office, requires = IS_IN_DB(db, 'office.id', '% (name)

Re: [web2py] Re: list:reference issue

2010-11-05 Thread Richard Vézina
I just test it still there... Richard On Fri, Nov 5, 2010 at 4:18 PM, Richard Vézina wrote: > I will during the weekend. > > Thank you Massimo > > Richard > > > On Fri, Nov 5, 2010 at 4:09 PM, mdipierro wrote: > >> I believe this problem was fixed in trunk a few days ago. Did you try >> trunk?

Re: [web2py] Re: list:reference issue

2010-11-05 Thread Richard Vézina
I will during the weekend. Thank you Massimo Richard On Fri, Nov 5, 2010 at 4:09 PM, mdipierro wrote: > I believe this problem was fixed in trunk a few days ago. Did you try > trunk? > > Massimo > > On Nov 5, 2:11 pm, Richard Vézina wrote: > > Oups! > > > > I start with tablelist I forgot to

[web2py] Re: list:reference issue

2010-11-05 Thread mdipierro
I believe this problem was fixed in trunk a few days ago. Did you try trunk? Massimo On Nov 5, 2:11 pm, Richard Vézina wrote: > Oups! > > I start with tablelist I forgot to correct it. > > It solves the problem default multiselect view un broswer... And banko! We > can reproduce the first proble

Re: [web2py] Re: list:reference issue

2010-11-05 Thread Richard Vézina
No widget. On Fri, Nov 5, 2010 at 2:30 PM, Bruno Rocha wrote: > What widget is that used in your Capture.png? > > 2010/11/4 Richard Vézina > > More input on the problem. >> >> It happen when the date validator is activated. The refresh form not >> expose the normal list field. I reproduce the p

[web2py] Re: list:reference issue

2010-11-05 Thread mdipierro
I do not understand: db.define_table('userlist', Field('fname','string',notnull=True), Field('lname','string',notnull=True), format='%(fname)s %(lname)s (%(id)s)') db.define_table('name', Field('name','string',notnull=True), Field('date','date',notnull=True), Field('userse

Re: [web2py] Re: list:reference issue

2010-11-05 Thread Bruno Rocha
What widget is that used in your Capture.png? 2010/11/4 Richard Vézina > More input on the problem. > > It happen when the date validator is activated. The refresh form not expose > the normal list field. I reproduce the problem with Chrome and Firefox > systematically when the date is forgot an

  1   2   >