Re: [web2py] Custom validator that avoids saving duplicate / similar values on a database with custom forms

2019-05-20 Thread mostwanted
I wanna use a custom validator with a more relevant message, the message with IS_NOT_IN_DB() reads* "Value already in database or empty", *how can i change the message to what i want it to be? Mostw On Monday, May 20, 2019 at 9:36:32 AM UTC+2, Lovedie JC wrote: > > IS_NOT_IN_DB() > > On Mon, 2

Re: [web2py] Custom validator that avoids saving duplicate / similar values on a database with custom forms

2019-05-20 Thread mostwanted
I wanna use a custom validator with a more relevant message, the message with IS_NOT_IN_DB() reads* "Value already in database or empty", *how can i change the message to what i want it to be? Mostwanted On Monday, May 20, 2019 at 9:36:32 AM UTC+2, Lovedie JC wrote: > > IS_NOT_IN_DB() > > On M

Re: [web2py] Custom validator that avoids saving duplicate / similar values on a database with custom forms

2019-05-20 Thread Lovedie JC
IS_NOT_IN_DB() On Mon, 20 May 2019, 10:07 mostwanted wrote: > I have a custom form that allows users to save information on what they > are selling but the problem is that at times customers save similar items > names and during a search by buyers the buyer gets a duplicate name > results, what

[web2py] Custom validator that avoids saving duplicate / similar values on a database with custom forms

2019-05-20 Thread mostwanted
I have a custom form that allows users to save information on what they are selling but the problem is that at times customers save similar items names and during a search by buyers the buyer gets a duplicate name results, what i want is to disable registering clients from saving the same item n

Re: [web2py] Custom validator broken in 2.18.4, working in 2.17.2

2019-04-05 Thread Kevin Keller
Could you create a ticket for this please? https://github.com/web2py/web2py/issues Thanks! On Thu, Apr 4, 2019 at 10:52 PM David Manns wrote: > The table in question has a field: > > Field('Paiddate', 'date', requires = [IS_EMPTY_OR(IS_DATE()), > IS_EMPTY_OR(IS_MEMBERSHIP_YEAR_END())]), > >

[web2py] Custom validator broken in 2.18.4, working in 2.17.2

2019-04-04 Thread David Manns
The table in question has a field: Field('Paiddate', 'date', requires = [IS_EMPTY_OR(IS_DATE()), IS_EMPTY_OR(IS_MEMBERSHIP_YEAR_END())]), The custom validator is: class IS_MEMBERSHIP_YEAR_END(object): def __init__(self, error_message='Not a membership year end'): self.error_mess

RE: [web2py] CUSTOM VALIDATOR

2015-12-14 Thread Saifuddin Rangwala
: [web2py] CUSTOM VALIDATOR Hi i have created a custom validator in the the directory modules customvalidators.py class COUNT_TEXT(): def __call__(self, value): size = 25 error = None try: if len(value.split()) > size: error="too mu

[web2py] CUSTOM VALIDATOR

2015-12-14 Thread Laurent Lc
Hi i have created a custom validator in the the directory modules *customvalidators.py* class COUNT_TEXT(): def __call__(self, value): size = 25 error = None try: if len(value.split()) > size: error="too much words" except:

[web2py] custom validator error

2015-09-10 Thread Anthony
Can we see the full traceback? Where is that error being thrown? -- 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

Re: [web2py] custom validator error

2015-09-10 Thread Manuele Pesenti
Il 06/09/15 22:25, kvthie0 ha scritto: > Hello all, > > I'm learning the inner workings of web2py and try to make a custom > validator called IS_TIME_IN_RANGE (based on the IS_DATE_IN_RANGE > validator). I suggest you to test the validator in a web2py console before using it... in case of errors y

[web2py] custom validator error

2015-09-07 Thread kvthie0
Hello all, I'm learning the inner workings of web2py and try to make a custom validator called IS_TIME_IN_RANGE (based on the IS_DATE_IN_RANGE validator). I saved the next code in : *www-data/web2py/applications/my_app/modules/customvalidators.py : * *from gluon.validators import IS_TIME*

[web2py] Custom validator - pass record id to validator for update operations

2014-12-01 Thread clara
Hello all, I am developing a web2py application and I am writing the logic to control stock of certain items. To that end, I wrote a custom validator which is working fine when creating new "sale" items. Now the problem arises when updating these sale items, because I would need to know the act

[web2py] Custom Validator IS_NOT_EMPTY_IF_NOT_OTHER

2013-11-30 Thread Francisco Costa
I've found this validator IS_NOT_EMPTY_IF_OTHER : http://www.web2pyslices.com/slice/show/1586/obligate-a-field-just-in-case-another-one-has-value Do we have a custom validator for IS_NOT_EMPTY_IF_NOT_OTHER ? The logic is that a Field can't be Empty if another Field is already Empty -- Resourc

[web2py] custom validator _and in IS_IN_DB doesn't get called

2010-09-15 Thread dustin.b
hi my secound stupid beginner question but i cant get behind it. i have a list:ref.. to choose multiple values but i need it to be not empty. the problem when i use the IS_NOT_EMPTY validator is that the field is not empty but "||" for an empty list i think (thats what i have in database in this c

[web2py] Custom validator apparently not being called

2010-07-16 Thread MikeEllis
I've got a controller that presents the user with a ckeditor field that lets them use a limited set of html markup. The editor returns an empty paragraph if they press Submit without typing anything, ie, '' , and my app needs to reject that. So I wrote a custom validator as follows: _striptags

[web2py] custom validator undefined

2010-07-01 Thread Jacques van der Merwe
greetings all, i've just written a custom validator which has been placed into gluon/ validators.py. the strange thing is that i'm getting an undefined error when trying to call it from db.py. i can call any of the other validators defined in validators.py and so i'm a little boggled as to why thi