[web2py] Cached select

2015-05-13 Thread Fabrice Dhenry
Hi, Is there a proper way to use cached select outside the web2py context. I'm using DAL in a desktop app development that do not require the full stack web2py framework. The cache module seems to be bound to the global object "request" and I failed to figure out how to use it. What I have trie

Re: [web2py] Re: web2py dal not creating database

2015-05-13 Thread Ivan Terreno
Ohhh...its great!!!... you fixed my problem!!! El domingo, 13 de noviembre de 2011, 20:41:53 (UTC-3), rochacbruno escribió: > > as you are using mysql. try to delete everything you has in /databases > folder (the .table files) backup it. > > then try again with table definitions and migrate=True

[web2py] Google plus login on web2py

2015-05-13 Thread Juozas Masiulis
How should the google plus login be implemented on web2py? Janrain does not work with google plus, and gluon/contrib/login_methods/oauth20_account.py provides an example only for facebook, but I have no idea on how to implement it with google. Google provides examples for flask, but they are

[web2py] Using cache outside web2py (with DAL)

2015-05-13 Thread Fabrice Dhenry
Hi, I'm looking for a way to use cached select facilities outside web2py context. I use DAL as a standalone package for a desktop application which does not require the full stack web2py framework. The cache module seems to be bound to the globals object "request". what I tired to do so far:

[web2py] Icon on input fields

2015-05-13 Thread Rafael Ribeiro
Hi, i would like to generate inputs with SQLFORM like this: Label and the define the icon "fa fa-bell-o" as a custom variable in the model is it pos

[web2py] An Existing web2py app can i upload to web2py Environment using Upload & install packed application

2015-05-13 Thread chandrabhushana rao
Hi, I have an web2py application in my local system i want to upload that application into web2py environment and run and do some modifications that application but i am trying to upload my application zip folder in to web2py environment using the Upload & install packed application option pr

Re: [web2py] Re: Export to csv which is not taking label from model file, where Grid takes.

2015-05-13 Thread Anthony
Yeah, I'm not sure you can use Rows.export_to_csv_file (at least, I don't think the colnames argument will help, as that simply specifies which columns you want to include -- it's purpose is not to rename columns). I suppose you could instead suppress the column names altogether, and then prepe

[web2py] Re: Using "for"

2015-05-13 Thread Derek
yea lets look at that... for i in hola... that sets i to 'h' then 'o' then 'l' and finally 'a' and prints each letter to the console. then 'return locals()' i will be 'a' because that's what it was set to last. get it? so if you want hola or aloha... controller: i = 'aloha' return i view: {{=i

[web2py] Give hidden form field an id attribute

2015-05-13 Thread John Lofgren
How can I assign an id attribute to a hidden form field? I've create a form with a hidden field 'interval' like this: f=SQLFORM(db.mytable, hidden=dict(interval='year')) I want to manipulate the value of that field in Javascript, so want to assign a known id to the field in order to reference i

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-13 Thread Lisandro
Ok, if you need me to try anything in the server, let me know. I will be out from office until friday, but I still can connect and do some test. Thanks again for your help! El miércoles, 13 de mayo de 2015, 15:37:38 (UTC-3), Niphlod escribió: > > there's a problem, I think. > max_empty_runs=5

[web2py] Re: AttributeError: 'DAL' object has no attribute

2015-05-13 Thread Paolo Valleri
Which web2py version are you using? Can you post a complete example that reproduces the issue? Paolo On Wednesday, May 13, 2015 at 7:14:30 PM UTC+2, goome wrote: > > hello , i have this action in defaul.py > """ > @auth.requires_login() > def lista_fornitori(): > fornitori = > legacy_db().sele

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-13 Thread Niphlod
there's a problem, I think. max_empty_runs=5 means "do 5 loops, if you didn't pick or assign any tasks, die". you said your workers are started by a cron job every 2 minutes (god knows why, but that's your choice). your instantiation doesn't touch the heartbeat parameter, which is by default 3

[web2py] Re: conditional in smartgrid that refer to the boolean type of field

2015-05-13 Thread Dave S
On Wednesday, May 13, 2015 at 1:19:31 AM UTC-7, 黄祥 wrote: > > *work* > editable = auth.has_membership('Manager') and (lambda row : > row.is_authorized == False) > > *not work (no error occured, the result is not expected)* > editable = (lambda row : row.is_authorized == False) and > auth.has_me

[web2py] AttributeError: 'DAL' object has no attribute

2015-05-13 Thread goome
hello , i have this action in defaul.py """ @auth.requires_login() def lista_fornitori(): fornitori = legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper()) return dict(fornitori = fornitori) "" and this work perfectly giving me the list of records in table '

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-13 Thread Lisandro
Sorry to bother with so many messages, but I think this is going somewhere. I've found the problem: it's the max_empty_runs parameter. I changed it to 10 (I was using it in 3) and it started working: the scheduler started executing the task accordingly to the period speficied in the task. Then

Re: [web2py] Re: web2ruby possible?

2015-05-13 Thread José Ricardo Borba
+1. web2py rocks... 2015-05-13 8:36 GMT-03:00 Leonel Câmara : > I want whatever it is you guys are smoking! > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Repo

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-13 Thread Lisandro
Recreating the scheduler tables doesn't work. I've found a little difference between the logs on the server (where scheduler doesn't work) and the logs on localhost (where it does work). This line is present only on the server log: DEBUG:pyDAL:Your database version does not support the JSON dat

[web2py] Re: Customizing registration fields for linkedin login

2015-05-13 Thread John Costantino
Yes, that is correct. I added extra fields using the auth.settings.extra_fields['']. So the table is able to support the extra ones I need. My issue is more so with making sure that when logging with the linkedin API. I need to be sure to get the rest of the information from the API, such as th

Re: [web2py] Re: Export to csv which is not taking label from model file, where Grid takes.

2015-05-13 Thread Prasad Muley
Hi Anthony, I've used the custom CSV exporter. I tried to use *colnames* parameters of export_to_csv_file But got an error (mentioned earlier). Am I missing anything in following code?? class CSVExporter(object): """This class is used when grid's table contains reference key id.

[web2py] Re: Export to csv which is not taking label from model file, where Grid takes.

2015-05-13 Thread Anthony
You can create your own CSV exporter: SQLFORM.grid(..., exportclasses=dict(csv=(MyExporterCSV, 'CSV', T('Comma-separated export of visible columns.' The MyExporterCSV class can inherit from gluon.sqlhtml.ExporterCSV

[web2py] Re: best practice for internal function

2015-05-13 Thread Anthony
>From the book : *Functions that take arguments or start with a double underscore are not publicly exposed and can only be called by other functions*. So

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-13 Thread Lisandro
Niphlod, I really appreciate your time on this. I left the task queued and I went to sleep. The same only task that the previous example (I only changed the period to 300 seconds instead of 30, and left repeats=0 to make it loop). The worker is starting every 2 minutes (from linux cron). Thi

Re: [web2py] Re: best practice for internal function

2015-05-13 Thread Manuele Pesenti
Il 13/05/15 12:52, Alex ha scritto: > perfect! This seems like a good solution. In most cases I have at > least one parameter anyway. Another option is to put them inside a model sub-directory called with the same name as the controller. The content of this folder will be read only calling that con

[web2py] Re: web2ruby possible?

2015-05-13 Thread Leonel Câmara
I want whatever it is you guys are smoking! -- 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 Go

[web2py] Re: best practice for internal function

2015-05-13 Thread Alex
perfect! This seems like a good solution. In most cases I have at least one parameter anyway. -- 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 receive

[web2py] Re: best practice for internal function

2015-05-13 Thread Niphlod
> > that this function is also available from outside (ajax) and not just > within my controllers def testfunction(dummy=None): return dict() in a controller can't be called as a function from a web request. tl;dr: a function defined with any number of arguments isn't callable in a web

[web2py] best practice for internal function

2015-05-13 Thread Alex
Hi, sometimes I need a function which I only use in one controller (file) and nowhere else (e.g. a function for form validation). Are there any recommendations where I could/should put those functions? Previously I put them in a model file but this is probably not optimal since the model file

Re: [web2py] web2ruby possible?

2015-05-13 Thread John
+1 воскресенье, 11 сентября 2011 г., 23:35:56 UTC+3 пользователь rochacbruno написал: > > I am more interested in some web2go http://golang.org/ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/

[web2py] Re: What's the proper way of using scheduler for multiple apps with one only db?

2015-05-13 Thread Niphlod
the scheduler doesn't depend on nginx, uwsgi and such. it's an external process that communicates with the app with the database as the only mean of communication. If you queue something and you verify that is in the scheduler_task table, and the scheduler doesn't see it, it's because it's poin

[web2py] Re: conditional in smartgrid that refer to the boolean type of field

2015-05-13 Thread 黄祥
*work* editable = auth.has_membership('Manager') and (lambda row : row.is_authorized == False) *not work (no error occured, the result is not expected)* editable = (lambda row : row.is_authorized == False) and auth.has_membership('Manager') why the first is work yet the second result is not exp

Re: [web2py] Re: web2pyslices down

2015-05-13 Thread Philip Kilner
+1 If the original domain is on sale for a sensible sum, it might be worth buying and redirecting, but using a sub-domain seems a better solution in the long term. On 11/05/15 10:36, Michele Comitini wrote: why not using slices.web2py.com ? same 2nd level domain as