[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-05 Thread Anthony
Hmm, I see that the framework does add the T translator to the Validator 
class, so validation messages should be getting translated. There is 
nothing special about Auth extra_fields -- the validators you add there are 
no different from the validators added to other fields.

Can you give an example of code using the same validator where the message 
is translated outside of extra_fields but not within extra_fields?

Also, in your example, you mentioned when setting T.force('pt'), all 
messages came out in Portuguese, even if you "change the language to 
English". What do you mean by "change the language to English" there? 
Setting T.force('pt') should force all translations to Portuguese unless 
you override the T.force('pt').

Finally, are you running/sending requests to more than one application, not 
all of which have the same translation files?

Anthony

On Friday, April 5, 2019 at 2:03:57 PM UTC-4, João Matos wrote:
>
> All my other error messages (from built-in validators) are 
> auto-translated. Including for the default auth_user fields (eg. username). 
> Only the extra_fields are not.
>
> Is there a fix?
>
>
> sexta-feira, 5 de Abril de 2019 às 18:56:10 UTC+1, Anthony escreveu:
>>
>> Note, this is due to the recent refactoring of all built-in validators 
>> (moved from web2py to pydal). Previously, all default error messages were 
>> translated, but that is no longer the case. Although the automatic 
>> translation was not documented, I would still consider this a break in 
>> backward compatibility (particularly given that all Auth error messages are 
>> still being translated automatically).
>>
>> Anthony
>>
>> On Thursday, April 4, 2019 at 3:25:10 PM UTC-4, João Matos wrote:
>>>
>>> When creating extra fields for auth_user, the validation messages for 
>>> those fields are always in English. They don't comply with the translations 
>>> available.
>>>
>>> This does not happen on the default fields.
>>>
>>>
>>> I added this to db.py
>>>
>>>
>>> auth.settings.extra_fields['auth_user'] = [Field('pagination', 'integer'
>>> , default=9, label=T('Pagination'), notnull=True, required=True, 
>>> requires=IS_INT_IN_RANGE(5, 51))] 
>>>
>>>
>>> When inserting an invalid value, the returned message is always
>>>
>>> Enter an integer between 5 and 50

>>> even when the web2py language is not English and the languages files 
>>> have the correct translation available.
>>>
>>>
>>> web2py 2.18.4
>>> Python 3.7.1 x86
>>> Firefox 66.0.2 x64
>>> Windows 7 Pro x64 SP1+all updates
>>>
>>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Thank you Web2py community - I have completed a live application, ViewBase.com, using Web2py

2019-04-05 Thread Tom Campbell
Amazing piece of work. Congratulations!

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Thank you Web2py community - I have completed a live application, ViewBase.com, using Web2py

2019-04-05 Thread junderhill
This looks fantastic.  A great example of a fantastic real-world app developed 
with Web2py.  Great job!

John

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-04-05 Thread Anthony
Though that breaks backward compatibility, as the interface for custom 
validators is provided in the official documentation.

On Friday, April 5, 2019 at 2:07:22 PM UTC-4, Leonel Câmara wrote:
>
> The way validators are in 2.18.4 you need to do it like this:
>
>
> class IS_MEMBERSHIP_YEAR_END(Validator)
> :
> def __init__(self, error_message='Not a membership year end'):
> self.error_message = error_message
>
> def validate(self, value):
> yearend = datetime.date(2018,9,30)
> if value.month==yearend.month and value.day==yearend.day:
> return value
> else:
> raise ValidationError(self.translator(self.error_message))
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-04-05 Thread Leonel Câmara
The way validators are in 2.18.4 you need to do it like this:


class IS_MEMBERSHIP_YEAR_END(Validator)
:
def __init__(self, error_message='Not a membership year end'):
self.error_message = error_message

def validate(self, value):
yearend = datetime.date(2018,9,30)
if value.month==yearend.month and value.day==yearend.day:
return value
else:
raise ValidationError(self.translator(self.error_message))

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-05 Thread João Matos
All my other error messages (from built-in validators) are auto-translated. 
Including for the default auth_user fields (eg. username). Only the 
extra_fields are not.

Is there a fix?


sexta-feira, 5 de Abril de 2019 às 18:56:10 UTC+1, Anthony escreveu:
>
> Note, this is due to the recent refactoring of all built-in validators 
> (moved from web2py to pydal). Previously, all default error messages were 
> translated, but that is no longer the case. Although the automatic 
> translation was not documented, I would still consider this a break in 
> backward compatibility (particularly given that all Auth error messages are 
> still being translated automatically).
>
> Anthony
>
> On Thursday, April 4, 2019 at 3:25:10 PM UTC-4, João Matos wrote:
>>
>> When creating extra fields for auth_user, the validation messages for 
>> those fields are always in English. They don't comply with the translations 
>> available.
>>
>> This does not happen on the default fields.
>>
>>
>> I added this to db.py
>>
>>
>> auth.settings.extra_fields['auth_user'] = [Field('pagination', 'integer', 
>> default=9, label=T('Pagination'), notnull=True, required=True, requires=
>> IS_INT_IN_RANGE(5, 51))] 
>>
>>
>> When inserting an invalid value, the returned message is always
>>
>> Enter an integer between 5 and 50
>>>
>> even when the web2py language is not English and the languages files have 
>> the correct translation available.
>>
>>
>> web2py 2.18.4
>> Python 3.7.1 x86
>> Firefox 66.0.2 x64
>> Windows 7 Pro x64 SP1+all updates
>>
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-05 Thread Anthony
Note, this is due to the recent refactoring of all built-in validators 
(moved from web2py to pydal). Previously, all default error messages were 
translated, but that is no longer the case. Although the automatic 
translation was not documented, I would still consider this a break in 
backward compatibility (particularly given that all Auth error messages are 
still being translated automatically).

Anthony

On Thursday, April 4, 2019 at 3:25:10 PM UTC-4, João Matos wrote:
>
> When creating extra fields for auth_user, the validation messages for 
> those fields are always in English. They don't comply with the translations 
> available.
>
> This does not happen on the default fields.
>
>
> I added this to db.py
>
>
> auth.settings.extra_fields['auth_user'] = [Field('pagination', 'integer', 
> default=9, label=T('Pagination'), notnull=True, required=True, requires=
> IS_INT_IN_RANGE(5, 51))] 
>
>
> When inserting an invalid value, the returned message is always
>
> Enter an integer between 5 and 50
>>
> even when the web2py language is not English and the languages files have 
> the correct translation available.
>
>
> web2py 2.18.4
> Python 3.7.1 x86
> Firefox 66.0.2 x64
> Windows 7 Pro x64 SP1+all updates
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2019-04-05 Thread David Manns
Created a ticket: https://github.com/web2py/web2py/issues/2170

On Thursday, April 4, 2019 at 4:52:37 PM UTC-4, 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())]),
>
> The custom validator is:
>
> class IS_MEMBERSHIP_YEAR_END(object):
> def __init__(self, error_message='Not a membership year end'):
> self.error_message = error_message
> def __call__(self, value):
> yearend = datetime.date(2018,9,30)
> if value.month==yearend.month and value.day==yearend.day:
> return (value, None)
> return (value, self.error_message)
>
> This works in 2.17.2
>
> I updated my test environment to 2.18.4 and it fails.
>
> On the console I see:
>
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2019
> Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
> Database drivers available: sqlite3, imaplib, pyodbc, pymysql
> please visit:
> ('\t', 'http://127.0.0.1:8000/')
> starting browser...
> Traceback (most recent call last):
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 1890, in _validate
> (value, errors) = validator(value)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\packages\dal\pydal\validators.py", line 144, in 
> __call__
> return self.validate(value), None
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\packages\dal\pydal\validators.py", line 2754, in 
> validate
> return self.other.validate(value)
> AttributeError: 'IS_MEMBERSHIP_YEAR_END' object has no attribute 'validate'
>
> The ticket shows:
>
> Error ticket for "init" Ticket ID 
>
> 127.0.0.1.2019-04-04.16-41-08.0dce185d-d8d2-4d36-9e47-8c82bc1d54f5
>  Validation error, field:Paiddate 
>  Version 
> web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54 
> Python Python 2.7.14: C:\Python27\python.exe (prefix: C:\Python27) 
> Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
>
> Traceback (most recent call last):
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\applications\init\controllers/default.py", line 1747, in 
> 
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\globals.py", line 421, in 
> self._caller = lambda f: f()
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\applications\init\models\db.py", line 109, in wrapped_f
> return f(*args)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\applications\init\controllers/default.py", line 214, in 
> memberform
> deletable = dltbl, onvalidation=setmodified, onaccept=modmember, 
> ondelete=delmember)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\tools.py", line 4322, in update
> detect_record_change=self.settings.detect_record_change):
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\sqlhtml.py", line 1758, in accepts
> **kwargs
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 2149, in accepts
> status = self._traverse(status, hideerror)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 917, in _traverse
> newstatus = self._validate()
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 1895, in _validate
> raise Exception(msg)
> Exception: Validation error, field:Paiddate  object at 0x04878048>
>
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop 

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-05 Thread João Matos


I have confirmed that it is indeed a bug in web2py.
If I add
T.force('pt')


before

auth.settings.extra_fields['auth_user'] = [ Field('pagination', 'integer', 
default=9, label=T('Pagination'), notnull=True, required=True, requires=
IS_INT_IN_RANGE(5, 51), ), ] 


the validation messages all come out in Portuguese (even if I change the 
language to English).

So the problem is that the code for the extra_fields is not language 
independent.


sexta-feira, 5 de Abril de 2019 às 16:43:35 UTC+1, João Matos escreveu:
>
> No, I think it is a web2py bug. I reported it in Git.
>
> sexta-feira, 5 de Abril de 2019 às 15:57:30 UTC+1, Kevin Keller escreveu:
>>
>> Wow that must be annoying. 
>>
>> Did you find any workaround? 
>>
>> On Thursday, 4 April 2019 21:25:10 UTC+2, João Matos wrote:
>>>
>>> When creating extra fields for auth_user, the validation messages for 
>>> those fields are always in English. They don't comply with the translations 
>>> available.
>>>
>>> This does not happen on the default fields.
>>>
>>>
>>> I added this to db.py
>>>
>>>
>>> auth.settings.extra_fields['auth_user'] = [Field('pagination', 'integer'
>>> , default=9, label=T('Pagination'), notnull=True, required=True, 
>>> requires=IS_INT_IN_RANGE(5, 51))] 
>>>
>>>
>>> When inserting an invalid value, the returned message is always
>>>
>>> Enter an integer between 5 and 50

>>> even when the web2py language is not English and the languages files 
>>> have the correct translation available.
>>>
>>>
>>> web2py 2.18.4
>>> Python 3.7.1 x86
>>> Firefox 66.0.2 x64
>>> Windows 7 Pro x64 SP1+all updates
>>>
>>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Thank you Web2py community - I have completed a live application, ViewBase.com, using Web2py

2019-04-05 Thread William
Just writing to thank Massimo and the Web2py community, for answering all 
my questions here and also building this awesome framework. 

I'm proud to say my application, https://www.viewbase.com, is live! I was a 
total beginner and literally learnt everything about web development while 
building this project. I was and still am amazed by how user-friendly and 
well thought out this web framework is. 

Cheers to the community and hope we will continue to see more success in 
future. 

Regards,
William

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-05 Thread João Matos
No, I think it is a web2py bug. I reported it in Git.

sexta-feira, 5 de Abril de 2019 às 15:57:30 UTC+1, Kevin Keller escreveu:
>
> Wow that must be annoying. 
>
> Did you find any workaround? 
>
> On Thursday, 4 April 2019 21:25:10 UTC+2, João Matos wrote:
>>
>> When creating extra fields for auth_user, the validation messages for 
>> those fields are always in English. They don't comply with the translations 
>> available.
>>
>> This does not happen on the default fields.
>>
>>
>> I added this to db.py
>>
>>
>> auth.settings.extra_fields['auth_user'] = [Field('pagination', 'integer', 
>> default=9, label=T('Pagination'), notnull=True, required=True, requires=
>> IS_INT_IN_RANGE(5, 51))] 
>>
>>
>> When inserting an invalid value, the returned message is always
>>
>> Enter an integer between 5 and 50
>>>
>> even when the web2py language is not English and the languages files have 
>> the correct translation available.
>>
>>
>> web2py 2.18.4
>> Python 3.7.1 x86
>> Firefox 66.0.2 x64
>> Windows 7 Pro x64 SP1+all updates
>>
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to disable _next when auto-logout? Or how do I make it maintain the var _signature?

2019-04-05 Thread João Matos
Found a solution (more a kludge).

Added
next = '/'

to login function in tools.py
Line 2831
# next = replace_id(next, form)
next = '/'
redirect(next, client_side=settings.client_side

quarta-feira, 3 de Abril de 2019 às 15:59:28 UTC+1, João Matos escreveu:
>
> Hello,
>
> How to disable _next when auto-logout occurs? Or how do I make it maintain 
> the var _signature?
>
> I have this problem.
> If a user leaves the application open, for eg. in a record editing page 
> with this URL
>
> http:
> //jmatos-p:8000/client/index/edit/client/2?_signature=b691de6ea83a3e24bb9b7f5324531406b0a6643a
>
> and the expiration time occurs, the user is logged out and shown this URL
>
> http://jmatos-p:8000/user/login?_next=/client/index/edit/client/2
>
> where web2py removed the var _signature.
>
>
> When the user logs in he receives an "Not authorized" error message 
> (session.flash) and gets redirected to URL
>
> http:
> //jmatos-p:8000/client?_signature=6b1c6d06db156eaca5aa5ecf51bf2351a97e3d53
>
> which is the parent of the original URL.
>
> I had a solution I found while searching this forum, which was to add
>
> request.vars._next = None
>
> before the auth declaration in the db.py file.
>
> That worked until I used a language changing solution given to me on 
> another topic, which is this
> db1.py file
> LANGUAGES = ('pt', 'en')
>
>
> def set_language():
> # type: () -> str
> """Set language.
>
> https://groups.google.com/forum/#!topic/web2py/6ceuUoISWGU
>
> :return: Language code.
> """
> lang_code = session.lang or 'pt'  # T.accepted_language[:2]
> if lang_code in LANGUAGES:
> T.force(lang_code)
> return lang_code
> else:
> T.force('pt')
> return 'pt'
>
>
> LANG = set_language()
>
>
> and in the block footer section of layout.html
>   
>  href="{{=URL('default', 
> 'language', args='pt', vars={'_next':URL(args=request.args, 
> vars=request.vars, user_signature=True)})}}">PT
>  href="{{=URL('default', 
> 'language', args='en', vars={'_next':URL(args=request.args, 
> vars=request.vars, user_signature=True)})}}">EN
>   
>
> Is there any way to disable the _next without using the above 
> request.vars._next = None ?
> Is there any way the _next could maintain the original var _signature?
> Any other ideas on how to solve this?
>
> Thanks,
>
> JM
>
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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())]),
>
> The custom validator is:
>
> class IS_MEMBERSHIP_YEAR_END(object):
> def __init__(self, error_message='Not a membership year end'):
> self.error_message = error_message
> def __call__(self, value):
> yearend = datetime.date(2018,9,30)
> if value.month==yearend.month and value.day==yearend.day:
> return (value, None)
> return (value, self.error_message)
>
> This works in 2.17.2
>
> I updated my test environment to 2.18.4 and it fails.
>
> On the console I see:
>
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2019
> Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
> Database drivers available: sqlite3, imaplib, pyodbc, pymysql
> please visit:
> ('\t', 'http://127.0.0.1:8000/')
> starting browser...
> Traceback (most recent call last):
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web
> Site\OxCamNE.2.1\gluon\html.py", line 1890, in _validate
> (value, errors) = validator(value)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web
> Site\OxCamNE.2.1\gluon\packages\dal\pydal\validators.py", line 144, in
> __call__
> return self.validate(value), None
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web
> Site\OxCamNE.2.1\gluon\packages\dal\pydal\validators.py", line 2754, in
> validate
> return self.other.validate(value)
> AttributeError: 'IS_MEMBERSHIP_YEAR_END' object has no attribute 'validate'
>
> The ticket shows:
>
> Error ticket for "init" Ticket ID
>
> 127.0.0.1.2019-04-04.16-41-08.0dce185d-d8d2-4d36-9e47-8c82bc1d54f5
>  Validation error, field:Paiddate
>  Version
> web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54
> Python Python 2.7.14: C:\Python27\python.exe (prefix: C:\Python27)
> Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
> 28.
> 29.
> 30.
>
> Traceback (most recent call last):
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\applications\init\controllers/default.py", line 1747, in 
> 
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\globals.py", line 421, in 
> self._caller = lambda f: f()
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\applications\init\models\db.py", line 109, in wrapped_f
> return f(*args)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\applications\init\controllers/default.py", line 214, in 
> memberform
> deletable = dltbl, onvalidation=setmodified, onaccept=modmember, 
> ondelete=delmember)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\tools.py", line 4322, in update
> detect_record_change=self.settings.detect_record_change):
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\sqlhtml.py", line 1758, in accepts
> **kwargs
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 2149, in accepts
> status = self._traverse(status, hideerror)
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 910, in _traverse
> newstatus = c._traverse(status, hideerror) and newstatus
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 917, in _traverse
> newstatus = self._validate()
>   File "C:\Users\David\Google Drive\Oxcamne Archive\Web 
> Site\OxCamNE.2.1\gluon\html.py", line 1895, in _validate
> raise Exception(msg)
> Exception: Validation error, field:Paiddate  object at 0x04878048>
>
> --
> 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
> "web2py-users" group.
> To unsubscribe from this 

[web2py] Re: Validation messages of extra fields in auth_user don't comply with available translations

2019-04-05 Thread Kevin Keller
Wow that must be annoying. 

Did you find any workaround? 

On Thursday, 4 April 2019 21:25:10 UTC+2, João Matos wrote:
>
> When creating extra fields for auth_user, the validation messages for 
> those fields are always in English. They don't comply with the translations 
> available.
>
> This does not happen on the default fields.
>
>
> I added this to db.py
>
>
> auth.settings.extra_fields['auth_user'] = [Field('pagination', 'integer', 
> default=9, label=T('Pagination'), notnull=True, required=True, requires=
> IS_INT_IN_RANGE(5, 51))] 
>
>
> When inserting an invalid value, the returned message is always
>
> Enter an integer between 5 and 50
>>
> even when the web2py language is not English and the languages files have 
> the correct translation available.
>
>
> web2py 2.18.4
> Python 3.7.1 x86
> Firefox 66.0.2 x64
> Windows 7 Pro x64 SP1+all updates
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: New International Telegram Support Group

2019-04-05 Thread Kevin Keller
Good group, really helped me to advance my proeject so much quicker. In 
fact, couldnt have gotten here without them. Thanks!

On Thursday, 4 April 2019 22:40:51 UTC+2, Ari Lion BR Sp wrote:
>
> Hey, Carlos, thanks for having created this group. Now I can solve my 
> questions Live 
>
> :-)
>
>
>
> Em segunda-feira, 25 de março de 2019 18:44:01 UTC-3, Ari Lion BR Sp 
> escreveu:
>>
>> That's great
>>
>> Good live discussions at the Group.
>>
>> Em segunda-feira, 25 de março de 2019 09:20:29 UTC-3, Vlad escreveu:
>>>
>>> Joined!
>>> Very nice & interactive - 
>>> There is some beauty in messenger group interaction vs. traditionally 
>>> organized groups...
>>>
>>> On Tuesday, March 19, 2019 at 2:49:34 PM UTC-4, Ari Lion BR Sp wrote:

 Oh, Great 

 Now I see a new link to this group:
 https://t.me/web2py_world


 Great I joined.
 That's great that Leonel Camara also joined the group!
 Now we can be sure that no doubt we have will be unanswered :-)


 Thanks!


 Em terça-feira, 19 de março de 2019 12:26:09 UTC-3, Carlos Costa 
 escreveu:
>
> we noticied this group has no administrator, so we are moving to a new 
> one, here is the link https://t.me/joinchat/DYZrfBT-bIsVhwLZc1hG8Q
>
> Em terça-feira, 19 de março de 2019 12:14:17 UTC-3, Carlos Costa 
> escreveu:
>>
>> We have had a good experience with the brazilian telegram group 
>> dedicated to to support web2py users.
>>
>> But the english speaking group is not used at.
>>
>> Here is the link to join it: https://t.me/web2py_en
>>
>> Also, here is the link to the Brazilian group (portuguese speaking 
>> and some portunhol allowed too :D ): https://t.me/web2pybrasil
>>
>

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] database queries

2019-04-05 Thread learthurjoly


Hello everybody. 

I ask you because I can’t make queries in my database with the DAL as I 
wish.

Here my context. I have two tables like this:

 

db.define_table(‘spare_parts’,

Field('name',…),

Field(‘best_price’,…)

Field(‘best_delay’,…)

 

db.define_table(‘supplier_choice’,

Field(‘parts’,…) #reference to spare parts id from table ‘spare_parts’

Field(‘supplier’,…),

Field(‘price’, 'decimal(10,2)' ,…),

Field(‘Delay’, 'integer' ,…),

 

In the ‘spare_parts’ table I define all my spare parts individually. There 
are normally no duplicates.

In the ‘supplier_choice’ table I define a ‘supplier’, a ‘price’ and a 
‘delay’ for each ‘parts’. But I can create as many lines as I want to 
define as many ‘suppliers’ ‘price’ or ‘delay’ for the same ‘part’.

 

What I want to do is a function which, for each id of the field 'parts' of 
'supplier_choice', select all the lines with this id and find the 
‘supplier’ with the lowest ‘price’ and the ‘supplier’ who has the shortest 
‘delay’. Then, the idea is to update the 'best_price' field of the 
'spare_parts' table with the name of the best price 'supplier' just find 
before and in the same way update the ‘best_delay’.

 

It's been 2 weeks since I try lots of things but all I managed to do is 
create bugs.

If anyone could help me do this, it would be fantastic !!

Thanks in advance.

 

Arthur

-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] CSS button alignment

2019-04-05 Thread Maurice Waka
I have this html code for a page. My buttons appear at the center bottom.
I would like them to appear elsewhere such as bottom corners.
How do I do this?





  {{=A('Proceed', _class='btn btn-large 
btn-info',_style="font-family: 'Audiowide';font-size: 22px; font-size:1em; 
border-style: solid white; background:#26e45c; color: black; padding:7px 
7px; border-radius:30px", _href=URL('exercise page'))}}

  
{{=A('Review', _class='btn btn-large 
btn-info',_style="font-family: 'Audiowide';font-size: 22px; font-size:1em; 
border-style: solid white; background:#d60506; color: black; padding:7px 
7px; border-radius:30px", _href=URL('start_page'))}}
  
  


-- 
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 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.