[web2py] Re: how to change the default auth.navbar controller

2017-04-10 Thread Rudy
Hi Marlysson, thanks so much for the links you shared, they are very helpful. I actually read your previous post to another user suggesting to look into tools.py, i did, now i understand better after looking into the web2py.readthedocs API reference. Thanks much Anthony, Marlysson. On Monday,

[web2py] Re: "Show_if" and Field Validation

2017-04-10 Thread Joe Barnhart
Oh boy. And it just keeps growing hair -- in this case to spoof the "options" portion of the validator. Well, this worked for me... class OR(Validator): def __init__(self, first, second, multiple=False): self.first = first if isinstance(first,(list,tuple)) else [first] self.

Re: [web2py] Re: Restricting access to auth action and issues with overriding the default user actions

2017-04-10 Thread Richard Vézina
NOTE : To the reader of this thread it appears that section pointed out "Settings-and-messages" is now name "Auth-Settings-and-messages" : http://web2py.com/books/default/chapter/29/9#Auth-Settings-and-messages On Mon, May 21, 2012 at 10:14 PM, Anthony wrote: > On Monday, May 21, 2012 9:32:04 PM

[web2py] Re: "Show_if" and Field Validation

2017-04-10 Thread Joe Barnhart
This is one of those head-scratchers Marcelo. Note the "onvalidation" function is called AFTER the validation is done on the form. By then it's too late to prevent the validators from being run on the hidden fields. I could monkey around with the added "error" stuff after the fact, but that's

Re: [web2py] Re: lack of documentation

2017-04-10 Thread António Ramos
Andrea do you see what i see ? http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer Its only the DAL chapter... 2017-04-10 12:07 GMT+01:00 Marlysson Silva : > Do you are speaking about a couple of examples of "How to" ? > > > Em domingo, 9 de abril de 2017 11:35:

[web2py] Re: "Show_if" and Field Validation

2017-04-10 Thread Joe Barnhart
Well, I'm not sure there's a nice general solution to this one. Since "show_if" is kind of an add-on to Field and isn't really a part of Expression or Validator or anything else. Here's what I came up with... First I created my set of "show_if" fields and set their validators to the existing

Re: [web2py] Re: use memcache

2017-04-10 Thread 黄祥
*change gluon/contrib/memcache/__init__.py* class MemcacheClientObj(Client): def initialize(self): pass *start web2py* python ~/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000 *create new webapp and add code on top of models/db.py* from gluon.contrib.memcache import Mem

[web2py] -i vs GUI

2017-04-10 Thread Dave S
On one of my Linux systems, I was starting web2py (2.14.6) from the command line with the usual -i 0.0.0.0, and the automatic visit via the local browser worked just fine, but I couldn't get there over the wire. Not a firewall problem, because I could run a different server (nodejs based) on t

Re: [web2py] Re: add items in navbar .. mode=dropdown

2017-04-10 Thread Richard Vézina
Nevermind, I have extract header of every layout I have anyway into header.html that I include back in each layout so, my app stay DRY. I am glad I had issue with selecting navbar jquery injected element that I can't select with selenium/splinter as it allow me to figure an new way to include my t

Re: [web2py] Re: add items in navbar .. mode=dropdown

2017-04-10 Thread Richard Vézina
Hello Anthony, Is there a way to manipulate auth.navbar content from model file somehow avoiding repeat this in every layout file I have? Thanks Richard On Sun, May 24, 2015 at 9:55 AM, Neeraj Shukla wrote: > Thanks Anthony... > > > On Sunday, 24 May 2015 03:16:00 UTC+5:30, Anthony wrote: >>

Re: [web2py] Re: use memcache

2017-04-10 Thread Paolo Valleri
Have you restarted web2py after the change? Paolo 2017-04-10 0:02 GMT+02:00 黄祥 : > after adding the code, still got the same error : AttributeError: > 'MemcacheClientObj' object has no attribute 'initialize' > *e.g.* > class MemcacheClientObj(Client): > def initialize(self): > pass

[web2py] Re: Web2py multiple request variables to filter database output

2017-04-10 Thread Scorpa
it just a bunch of ids that's taken from URI. So it's list of id like [1L,2L,3L] and so on. It's working when i'm searching throught table, for example db(db.t_filter.id.belongs(ids)).select() But wont work with list:reference. can i fix it somehow ? понедельник, 10 апреля 2017 г., 21:11:49 UTC+

[web2py] Re: "Show_if" and Field Validation

2017-04-10 Thread Anthony
> > This might be as simple as emptying out the "requires" attribute if the > "show_if" causes the field to be visible. But I don't change core code -- > I don't want the hassle of departing from the stock distro of web2py. > You could change the core code and submit a pull request. ;-) --

[web2py] Re: Web2py multiple request variables to filter database output

2017-04-10 Thread Dave S
On Monday, April 10, 2017 at 4:49:01 AM UTC-7, Scorpa wrote: > > Yes, that's what i'm trying to achive. > > For now i have three tables: ingredients, tags and data. > Data table defined with - Field('ingredients', 'list:reference tag_ingr'), > > > tags - db.define_table('tag_ingr', > >

[web2py] Re: how to change the default auth.navbar controller

2017-04-10 Thread Marlysson Silva
There are this places.. https://github.com/web2py/web2py/blob/master/gluon/tools.py#L1487 http://web2py.readthedocs.io/en/latest/tools.html?highlight=auth#gluon.tools.Auth Em domingo, 9 de abril de 2017 13:16:31 UTC-3, Rudy escreveu: > > Sorry Anthony, i just checked, your suggestion works when

[web2py] Re: "Show_if" and Field Validation

2017-04-10 Thread Marcelo Huerta
Maybe creating a validation function which checks the different values and depending on them fills the form.errors values when a validation error happens? Take a look to http://web2py.com/books/default/chapter/29/07/forms-and-validators#onvalidation -- Resources: - http://web2py.com - http:/

[web2py] Re: pdf output of web2py-book app

2017-04-10 Thread Marlysson Silva
Here have some files to do that https://github.com/web2py/web2py/tree/master/gluon/contrib/markmin Do you tried use them ? Em sábado, 8 de abril de 2017 11:49:11 UTC-3, alex escreveu: > > I have downloaded and used the book app > https://github.com/web2py/web2py-book to write some documentation

Re: [web2py] How do i make a field NOT required when using IS_IN_SET() ?

2017-04-10 Thread Karoly Kantor
Thank you, it works, you saved me the time for lunch :-) On Monday, April 10, 2017 at 2:14:12 PM UTC+2, Marvix wrote: > > tried this? > requires=IS_EMPTY_OR(IS_IN_SET(...)) > > 2017-04-10 14:07 GMT+02:00 Karoly Kantor >: > >> I have a picklist type of field where the user selects from a set of >>

Re: [web2py] How do i make a field NOT required when using IS_IN_SET() ?

2017-04-10 Thread Marvi Benedet
tried this? requires=IS_EMPTY_OR(IS_IN_SET(...)) 2017-04-10 14:07 GMT+02:00 Karoly Kantor : > I have a picklist type of field where the user selects from a set of > predefined values. I am using IS_IN_SET(list_of_values) in the Field > constructor. > The form cannot be saved unless a value is sel

[web2py] How do i make a field NOT required when using IS_IN_SET() ?

2017-04-10 Thread Karoly Kantor
I have a picklist type of field where the user selects from a set of predefined values. I am using IS_IN_SET(list_of_values) in the Field constructor. The form cannot be saved unless a value is selected, i.e. the field is essentially a required field. I would like to allow the user NOT to selec

[web2py] Re: Is there any way to undo impersonation?

2017-04-10 Thread Anthony
On Sunday, April 9, 2017 at 11:03:21 PM UTC-4, Alfonso Serra wrote: > > I have implemented an admin impersonating users successfully, but was > wondering if theres any way to go back to the admin while impersonating > without having to manually logout - loging. > Just post user_id=0 to the /impe

[web2py] Re: Web2py multiple request variables to filter database output

2017-04-10 Thread Scorpa
// This moderation is really useless For the sake of this question, i implemented this thing in that way: User select image via IMG tag: Then JavaScript comes in hand: $('.fruits-main').click(function() { if ($(this).hasClass("selected")) { $(this).removeClass('select

[web2py] Re: Web2py multiple request variables to filter database output

2017-04-10 Thread Scorpa
Yes, that's what i'm trying to achive. For now i have three tables: ingredients, tags and data. Data table defined with - Field('ingredients', 'list:reference tag_ingr'), tags - db.define_table('tag_ingr', Field('name', type='string'), format='%(name)s') And in

[web2py] Re: Auth change password confirmation

2017-04-10 Thread Anthony
On Sunday, April 9, 2017 at 10:57:08 PM UTC-4, Alfonso Serra wrote: > > Thanks Anthony, but thats the matter, redirection is not optional. It will > happen regardless. I would like not to redirect to make use of form.errors, > form.accepted to style the view. > The redirect happens only if the f

[web2py] Re: lack of documentation

2017-04-10 Thread Marlysson Silva
Do you are speaking about a couple of examples of "How to" ? Em domingo, 9 de abril de 2017 11:35:04 UTC-3, Andrea Fae' escreveu: > > Web2py is wonderful, but it has a big challenge. No documentation. Or at > least no complete documentation. It's all based on the book and some site > that can gi