[web2py] Re: Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-25 Thread 'Annet' via web2py-users
I don't understand the use of field 'groups' and function 'get_groups() I think you should use web2py's built in auth_ functionality: drop field 'groups' in both tables, link users and groups (each hotel its own group) in the auth_membership table, and use this table to create a list of options

[web2py] Re: Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-25 Thread mostwanted
How do I set it as a default if the form is not open by a link redirection? The form is opened directly by the main-menu. If it were opened through the link then it'd be easy to set the hotel as a default coz all i'd do would be: *hotel=db(db.hotel_profile(request.args(0,

[web2py] Re: LOAD in py4web

2020-02-25 Thread RHC
Just to confirm, will that call to foo(0 return the html generated using that function and it's template? My view on the various follow up questions about LOAD is that we should use existing frameworks where possible rather than complicating py4web. The appeal of py4web is that it has less of

[web2py] Re: Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-25 Thread villas
Set the default hotel value in the SQLFORM field. You could also 'force' the hotel you want by using SQLFORM onvalidation On Tuesday, 25 February 2020 07:28:31 UTC, mostwanted wrote: > > I have 2 tables

[web2py] Re: web2py represent_none in SQLFORM.smartgrid in combination with date field throws exception

2020-02-25 Thread villas
I've never used represent_none, but it seems like a bug. Workaround: I guess you can try setting the field individually. Something like this.. db.mytable.somedate.represent = lambda v,r: v.strftime('%d %b %Y') if v else 'No Date' -- Resources: - http://web2py.com -

Re: [web2py] Re: LOAD in py4web

2020-02-25 Thread Christian Varas
I think it can be usefull if you use another template not based in vue. Cheers. El El lun, 24 de feb. de 2020 a la(s) 03:31, Massimo Di Pierro < massimo.dipie...@gmail.com> escribió: > We can add it in utils. But before we do. Do other peopl find it useful? > Is that a pattern we should

[web2py] web2py represent_none in SQLFORM.smartgrid in combination with date field throws exception

2020-02-25 Thread David Zejda
Hi, I found out that SQLFORM.smartgrid(db.table_name, represent_none="") with a table table_name containing a field with date datatype throws the exception: File "/opt/web2py3/gluon/packages/dal/pydal/validators.py", line 2335, in formatter year = value.year AttributeError: 'str' object has

[web2py] Re: unexpected end of stream - py4web

2020-02-25 Thread Edoardo Torrini
Hi Dave, thanks for the reply, but I have notice that the code is wrong, I will explain. Since I need three function in task I used another one to collector and after I redirect by an if statement. So I have the funtion: my_task(func, filtri, *argv) and the function produzione(dbnow, filtri,

Re: [web2py] Setting a default reference value as that of a specific group the logging in user is a member of

2020-02-25 Thread AGRogers
I am interested in the best practice way to do this as well. On Tue, 25 Feb 2020, 13:58 mostwanted, wrote: > I have 2 tables about a hotel, one table registers the hotel itself & the > other is about meals that are offered at the hotel but the idea is that > only group members of each hotel