[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

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) -

[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

[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

[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] 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

[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).

[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

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

[web2py] Re: best practice for internal function

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

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: 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

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 leonelcam...@gmail.com: 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) -

[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

[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

[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: 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 =

[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:

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

[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

[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.

[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: Export to csv which is not taking label from model file, where Grid takes.

2015-05-13 Thread Prasad Muley
Can use colnames parameter of export_to_csv_file ? I tried to use it But got following error. type 'exceptions.AttributeError' 'Row' object has no attribute '_extra' What is the format for colnames? On Wednesday, May 13, 2015 at 1:23:33 AM UTC+5:30, Niphlod wrote: the export are for raw

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 http://slices.web2py.com? same 2nd level domain as

[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