Re: [web2py] multiple controllers

2016-08-08 Thread Richard Vézina
No prob, I create an issue about it, as I said I experiment it some time ago and it pretty annoyed me lost like 2-3 hours as I was making app upgrade, not fun at all... :) Richard On Mon, Aug 8, 2016 at 11:09 AM, icodk wrote: > Thanks Richard > I fixed it by restarting the

Re: [web2py] multiple controllers

2016-08-08 Thread icodk
Thanks Richard I fixed it by restarting the Rocket server. Sorry, not a rocket science, I should be able to figure it out. On Monday, August 8, 2016 at 3:47:55 PM UTC+2, Richard wrote: > > Can you show the whole code... I suspect you have cached the original > myfunc() and cache point to the

Re: [web2py] Re: How to check for the existence of a var in the layout.html?

2016-08-08 Thread António Ramos
:) 2016-08-08 15:24 GMT+01:00 Massimo Di Pierro : > > {{if 'f1' in globals():}} {{pass}} > > > On Monday, 8 August 2016 06:33:55 UTC-5, Ramos wrote: >> >> hello i need to check for some vars in my *layout.html* >> >> if i have in my controllers return locals() >>

[web2py] Ubuntu 16.04 - installation script stops

2016-08-08 Thread Martin Weissenboeck
I have tried to setup a new web2py server with nginx on Ubuntu 16.04 LTS I have used the script https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh The script stopped with extracting: web2py/applications/__init__.py extracting:

Re: [web2py] display git version of my own web2py project

2016-08-08 Thread icodk
OK What about removing the os.chdir("/path/to/myapp") and instead adding the path to the git command: os.system('git -C /path/to/myapp describe --abbrev=7 --dirty --always --tags > git_ver.txt') session.gitver = open('/path/to/myapp/git_ver.txt').read() On Monday, August 8, 2016 at

[web2py] Get Distinct dates

2016-08-08 Thread madhu nomula
Hello, In Web2py database we have date entries. Need to get distinct dates and bind to a dropdown control. But I am unable to get : Please find code below: Controller: myrows = db((db.Act.org_id==db.organix.id)& (db.auth_user.id==auth.user.id) ).select((db.MC.activity_date )) View:

[web2py] Re: Recommendations on where to store translation strings

2016-08-08 Thread Niphlod
uhm. a) T() just translates at the "view" level, i.e. when those are actually serialized ... passing over a module containing "choices" wouldn't ACTUALLY translate them . b) admin's management for T() strings is less than optimal with thousands of elements, and if in the need of a top-class

[web2py] Re: Query for dropdown list

2016-08-08 Thread Niphlod
first and foremost, you need to be able to have a Query that returns what you want. THEN, you can pass it to IS_IN_DB(). It's not so clear if the problem is you being unable to create such a Query or that you want a select to be dependant on a previous selection or if you have issues with

[web2py] Re: Problems with DAL and mysql

2016-08-08 Thread Niphlod
did you remember to commit() ? On Thursday, August 4, 2016 at 9:38:23 PM UTC+2, Morganti wrote: > > Hello everybody! > > I am developing using directly to Mysql. For testing with some scripts, I > was using python interpreter and defining only tables that it was needed. > But I have a problem

Re: [web2py] Re: bounty pypi

2016-08-08 Thread Niphlod
for the moment you can forget about backward compatibility: the script that "cooks" a release (and, consequently, its content) doesn't need to be a 1:1 copy of the repo. On Thursday, August 4, 2016 at 3:11:31 PM UTC+2, Richard wrote: > > As to remain backward compatible, I guess... A big

Re: [web2py] display git version of my own web2py project

2016-08-08 Thread Niphlod
np. and BTW, never ever ever use chdir, NOR os.system (nor everything starting a different process) in an app served via web. EVER. On Thursday, August 4, 2016 at 9:04:48 AM UTC+2, icodk wrote: > > Thanks for the tip Niphold(I didn't know that) > > On Wednesday, August 3, 2016 at 10:37:15 PM

[web2py] Re: Form custom input errors

2016-08-08 Thread Ron Chatterjee
you can right a custom validator. For example. if form.process().accepted: email_you_entered = form.vars.email() and then run the IS_EMAIL on that variable. If true. you process further. False, you error and go back. On Monday, August 8, 2016 at 3:51:53 PM UTC-4, Gael Princivalle wrote: >

[web2py] Re: select() and iterselect()

2016-08-08 Thread 黄祥
thanks simone for detail explaination, as i thought the iterselect() is notreusable, the error disappear when i just it once (for looping). thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: select() and iterselect()

2016-08-08 Thread Niphlod
yep. if you use it once, iterselect() is more memory-savvy, although a BIT slower. For millions-rows sets, it's quite indispensable. On Monday, August 8, 2016 at 10:57:30 PM UTC+2, 黄祥 wrote: > > thanks simone for detail explaination, as i thought the iterselect() is > notreusable, the error

[web2py] Re: select() and iterselect()

2016-08-08 Thread Niphlod
the point in using iterselect() is that you have a SINGLE shot at iterating the results: speed comes from using the results returned as an iterator vs returning the big fat list. An iterator is inherently not reusable. tl;dr: if select() and iterselect() matched in functionality, why should we

[web2py] Re: Form custom input errors

2016-08-08 Thread Niphlod
doesn't form.errors[fieldname] store the error ? On Monday, August 8, 2016 at 9:51:53 PM UTC+2, Gael Princivalle wrote: > > Hello. > > Is it possible in a custom form to display the individual input errors > like "Invalid email", if in the field of a table we have the validator > IS_EMAIL ? > >

[web2py] Re: Ubuntu 16.04 - installation script stops

2016-08-08 Thread Niphlod
as soon as I get some free time this should become the new (and only) "official" script. Or as soon as somebody else takes that responsibility. https://gist.github.com/niphlod/8a13025001363657f0201b2a15dad41c On Monday, August 8, 2016 at 6:39:51 PM UTC+2, mweissen wrote: > > I have tried to

[web2py] Form custom input errors

2016-08-08 Thread Gael Princivalle
Hello. Is it possible in a custom form to display the individual input errors like "Invalid email", if in the field of a table we have the validator IS_EMAIL ? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Email not working

2016-08-08 Thread Valdeck Rowe
Hi I've never gotten the smtp interface in web2py to work either. It just simply does not appear to work with Google or with Mailgun. I always end up using the mailgun api. I'm not sure what I'm missing but its a bit frustrating, especially considering that I'm trying to sell them on web2py

Re: [web2py] Re: Improvements for DevOps

2016-08-08 Thread Niphlod
using the --branch parameter doesn't really pose an issue on trunk being somewhat "broken". I just re-ran the command and had no issue on a clean system (with or without --shallow-submodules) I'd say it's a relatively old git subsystem the part to blame here. BTW: that is the "way" to save

[web2py] Re: Email not working

2016-08-08 Thread Niphlod
the "usual" issues are: - gmail's newer "secure apps" enabled by default which requires a two-step verification, which smtplib can't handle - tls or ssl enabled (or disabled) and the smtp endpoint not "in tune" with web2py's settings I'm also pretty sure that the traceback kinda steers towards

[web2py] Re: Get Distinct dates

2016-08-08 Thread Niphlod
select(whatever, distinct=True) should seal the deal. On Monday, August 8, 2016 at 8:21:58 PM UTC+2, madhu nomula wrote: > > Hello, > > In Web2py database we have date entries. Need to get distinct dates and > bind to a dropdown control. But I am unable to get : > > Please find code below: >

Re: [web2py] display git version of my own web2py project

2016-08-08 Thread Niphlod
still "breaks" the "don't launch any external processes in a web app" dogma :-P On Tuesday, August 9, 2016 at 12:02:35 AM UTC+2, icodk wrote: > > OK > What about removing the os.chdir("/path/to/myapp") > > and instead adding the path to the git command: > > os.system('git -C /path/to/myapp

[web2py] Passing multiple data to ajax call.

2016-08-08 Thread Ron Chatterjee
In controller, I have a user class {u'test': <__restricted__.User object at 0x099D8F98>} >From the view I tried the ajax call and not being able to pass the users. 'url' : '{{=URL("put")}}/{{=uid}}/{{=room}}/{{=users}}', It doesnt work. I tried.

[web2py] Re: Anyone willing to help out with Paypal

2016-08-08 Thread Ron Chatterjee
Haven't had too much luck with this lately. Does anyone has any updates? On Friday, December 3, 2010 at 7:30:37 PM UTC-5, c h wrote: > > Michael, > > while i have not tested it, i would expect all of it to work except > for the crypt() methods. You can post un-encrypted forms to paypal >

[web2py] Re: How can I get a single link to redirect to a view based on user group?

2016-08-08 Thread Anthony
Wherever you are creating the link: href="{{=URL('fsr', 'bondsmanProfile' if auth.has_membership('bondsman') else 'publicProfile')}}" Also, the @auth.requires_membership() decorator already requires login by default, so there is no need to precede it with the @auth.requires_login() decorator.

[web2py] Re: MySQL DAL questions

2016-08-08 Thread Dave S
On Saturday, August 6, 2016 at 12:12:45 AM UTC-7, Massimo Di Pierro wrote: > > The raw names can include "." but the web2py names cannot possibly contain > a "." in the name. > Yes, I'm trying the rname feature. At the moment, I'm still in the "setting the table" stage, but I hope to get a

[web2py] Re: How can I get a single link to redirect to a view based on user group?

2016-08-08 Thread Anthony
On Monday, August 8, 2016 at 4:47:00 AM UTC-4, 黄祥 wrote: > > pls try (not tested) > models/db.py > > has_membership_bondsman = auth.has_membership('bondsman') > is_logged_in = auth.is_logged_in() > > if has_membership_bondsman: > return redirect(URL('fsr', 'bondsmanProfile') ) > elif is_logged_in:

[web2py] How can I get a single link to redirect to a view based on user group?

2016-08-08 Thread Kevin Reilley
I'd have two user types public and bondsman. I'd like for an href on the home page to redirect to a different view depending on the group that the user is a part of. If they are logged in as public the redirect should go to fsr/publicProfile and if they are logged in as a bondsman it should

[web2py] Re: Improvements for DevOps

2016-08-08 Thread bunnyhero
I just tried git clone --depth=1 --branch=R-2.14.6 --recursive --shallow-submodules https://github.com/web2py/web2py.git and I got this error: error: no such remote ref 60e97e7cfd1da98f3cf38b2023965226d42e5e5b Fetched in submodule path 'gluon/packages/dal', but it did not contain

[web2py] Re: How can I get a single link to redirect to a view based on user group?

2016-08-08 Thread 黄祥
pls try (not tested) models/db.py has_membership_bondsman = auth.has_membership('bondsman') is_logged_in = auth.is_logged_in() if has_membership_bondsman: return redirect(URL('fsr', 'bondsmanProfile') ) elif is_logged_in: return redirect(URL('fsr', 'publicProfile') ) else: return

[web2py] multiple controllers

2016-08-08 Thread icodk
Trying to embrace the multi controller approach, I put the function* myfunc()* in a new controller: *myctl.py* However, entering in a browser: *http://mydomain/myapp/myctl/myfunc* results *invalid function (default/myfunc)* Also adding a menu item: response.menu += [(T('Test menu'), False,

[web2py] convert plain html to web2y HTML Helpers

2016-08-08 Thread António Ramos
How do i convert this BlaBlaBla 23 Abril 2016 to using A(_href=URL(...).etc?) Thank you António -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] How to check for the existence of a var in the layout.html?

2016-08-08 Thread António Ramos
hello i need to check for some vars in my *layout.html* if i have in my controllers return locals() i can then in the view do {{if var1 in locals():0}} ... {{pass}} however some of my views need a function from the controller so i do def f1() return "something" def index() ... return

[web2py] Re: convert plain html to web2y HTML Helpers

2016-08-08 Thread António Ramos
Found it {{=A( I(_class='menu-icon fa fa-file bg-white'), DIV( H4('file.pdf',_class="control-sidebar-subheading"), P('23 Abril 2016'), _class="menu-info"), _href="")}} 2016-08-08 11:53 GMT+01:00 António

Re: [web2py] multiple controllers

2016-08-08 Thread Richard Vézina
Can you show the whole code... I suspect you have cached the original myfunc() and cache point to the default controller... It happen once to me in the past and it was really anoying... I guess we can improve error message in order to notice the user to think about look if the function is cached

Re: [web2py] Re: Improvements for DevOps

2016-08-08 Thread Richard Vézina
Maybe trunk is broken... On Sun, Aug 7, 2016 at 12:25 AM, bunnyhero wrote: > I just tried > > git clone --depth=1 --branch=R-2.14.6 --recursive --shallow-submodules > https://github.com/web2py/web2py.git > > and I got this error: > > error: no such remote ref

Re: [web2py] Weird

2016-08-08 Thread Richard Vézina
Do you have an "id" field defined? Richard On Sat, Aug 6, 2016 at 6:31 AM, Vic Ding wrote: > I created the table initially without the virtual field 'amount' and added > it lately. > When I use a string or number in the lambda like: lambda row: 'test', it > works fine. >

[web2py] Re: How to check for the existence of a var in the layout.html?

2016-08-08 Thread Massimo Di Pierro
{{if 'f1' in globals():}} {{pass}} On Monday, 8 August 2016 06:33:55 UTC-5, Ramos wrote: > > hello i need to check for some vars in my *layout.html* > > if i have in my controllers return locals() > > i can then in the view do > > {{if var1 in locals():0}} > > ... > {{pass}} > > however