Re: [web2py] Re: How to leverage web2py popularity and usage?

2013-09-11 Thread Michele Comitini
I hope it can be served with web2py itself! No wordpress please. 2013/9/10 Julie Bouillon > No need to reinvent the wheel ;-) Maybe just "reactivate" this one... > > > On 09/09/2013 10:21 PM, Anthony wrote: > > There was one: http://www.web2py.com.ar/planet/. Looks like it's > returning an er

Re: [web2py] Re: Newby, can't connect to a Postgresl database

2013-09-11 Thread starglider.dev
Changed to Postgresql 9.1 and it worked, also I can connect to pqsl with root user. Thank you to all. On 9 September 2013 18:48, Massimo Di Pierro wrote: > You need postgresql 8.2+. postgresql 8.1 does not allow you changing the > string escaping and, by default, it is non conform to the SQL sta

[web2py] Datetime Issue error

2013-09-11 Thread António Ramos
my db.py db.define_table('oco', Field('created_on', 'datetime', required=True,label='Data'), ... ... db.oco.created_on.requires=[IS_DATE(format=T('%Y/%m/%d %H:%M:%S'), error_message=T("Formato pretendido /mm/dd HH:MM:SS"))] I create a record with created_on set to 2013/09/25 09:54:24 I ge

[web2py] Re: check_client=True

2013-09-11 Thread Ranjith
Niphlod writes: > > > can I see how you are using check_client in your code, please ?On Wednesday, July 31, 2013 1:59:02 PM UTC+2, Vikas Gupta wrote: > I need to disable the user from logging in multiple times from different machines... If he is logged in on one machine with ip A, and he trie

[web2py] DAL reference but only a subset

2013-09-11 Thread António Ramos
Hello i have a 3 tables Companies Workers Equipments Each company has workers and equipments. Some equipments are driven by one or more workers of that company. however this line in the table equipments Field('field1',db.workers) shows in the form all workers of all companies. How do i filter

[web2py] Re: Datetime Issue error

2013-09-11 Thread Niphlod
data will always be stored in ISO format. SQLite in addition stores datetimes as strings 'cause there's no datetime native field. Did you change the field after creating it ? Does this error happen also on a clean database ? On Wednesday, September 11, 2013 10:58:56 AM UTC+2, Ramos wrote: > > m

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread António Ramos
The field was only date and i changed it to datetime afer realised i needed the time 2013/9/11 Niphlod > data will always be stored in ISO format. SQLite in addition stores > datetimes as strings 'cause there's no datetime native field. > Did you change the field after creating it ? Does this

Re: [web2py] DAL reference but only a subset

2013-09-11 Thread Vinicius Assef
In validators section in the book [1], there is an example of IS_NOT_IN_DB() using a query. It can be done in IS_IN_DB(), too. [1] http://web2py.com/books/default/chapter/29/07/forms-and-validators#Database-validators On Wed, Sep 11, 2013 at 6:22 AM, António Ramos wrote: > Hello > > i have a 3

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread Federico Ferraro
Test it and validator not error : IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:MM:SS"))("2013/09/25 09:54:24") Out[17]: (datetime.date(2013, 9, 25), None) In [18]: IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:

Re: [web2py] DAL reference but only a subset

2013-09-11 Thread Anthony
On Wednesday, September 11, 2013 7:22:36 AM UTC-4, viniciusban wrote: > In validators section in the book [1], there is an example of > IS_NOT_IN_DB() using a query. > It can be done in IS_IN_DB(), too. > That will work if you know the company id before the form is served, but if the company

[web2py] Re: SQLFORM.grid - Create from list of objects

2013-09-11 Thread Anthony
See my answer on SO: http://stackoverflow.com/a/18740517/440323 Anthony On Tuesday, September 10, 2013 8:29:05 AM UTC-4, Gliese 581 g wrote: > > Hi Anthony, > Thanks for this useful information. > I tried > searchform.process(keepvalues=True).accepted > But it evaluates to False. > While below

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread ajith c t
Hi Niphlod, I changed my .conf file a littile by reading the web2py online book, Created a new web2py-scheduler.conf file start on runlevel [2345] stop on runlevel [016] respawn limit 8 60 script exec sudo -u root python /srv/tv-fe/web2py

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread Niphlod
what you posted doesn't indicate any issues. The task is there and the worker too. What are you experiencing instead ? -- 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

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread Niphlod
this is a known issue of sqlite: you can't change the type and expect everything to work out http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Gotchas On Wednesday, September 11, 2013 1:08:46 PM UTC+2, Ramos wrote: > > The field was only date and i changed it to dateti

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread ajith c t
Sorry missed the issue, the issue is the task just doesnt get called up. I believe the scheduler_task will have the worker that picked up the task in the assigned_worker_name field. In my case it remains empty On Wednesday, 11 September 2013 17:45:11 UTC+5:30, Niphlod wrote: > > what you posted

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread Niphlod
and when you start it without using upstart it works or not ? On Wednesday, September 11, 2013 2:22:32 PM UTC+2, ajith c t wrote: > > Sorry missed the issue, the issue is the task just doesnt get called up. I > believe the scheduler_task will have the worker that picked up the task in > the assi

[web2py] Re: TypeError: %d format: a number is required, not dict

2013-09-11 Thread Massimo Di Pierro
The problem is that IS_TIME(...error_message='Formaat komt niet overeen met %d-%m-%Y')...) should be IS_TIME(...error_message='Formaat komt niet overeen met %%d-%%m-%%Y')...) or IS_TIME(...error_message='Formaat komt niet overeen met DD-MM-')...) If you want a '%' in an error message it

[web2py] Re: SQLFORM.grid and count field (web2py 2.6.0. test)

2013-09-11 Thread Massimo Di Pierro
You cannot put expressions in grid in place of fields. On Monday, 9 September 2013 18:44:18 UTC-5, dam...@gmail.com wrote: > > Hi, > > I'm using web2py 2.6.0. test. > > on sqlhtml.py line 1916: > > columns = [f for f in fields if f.tablename in tablenames] > > > when add field count, count n

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread ajith c t
When I start directly from the web2py folder, my load balancer gives me a bad gateway error. When I run the web2py shell , I see the scheduler tables are created. ubuntu@ip-10-0-0-13:/srv/tv-fe$ sudo python web2py.py -K app web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-201

[web2py] Re: web2py course

2013-09-11 Thread Christopher
Do you have an hours per week time commitment estimate for the course? Thanks. On Tuesday, September 10, 2013 10:45:56 AM UTC-4, Massimo Di Pierro wrote: > > Shameless advertisement! > > I am teaching this certficate course: > http://www.cdm.depaul.edu/ipd/Programs/Pages/WebDevelopmentwithPython.

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread ajith c t
ubuntu@ip-10-0-0-13:/srv/trustvouch-fe$ sudo python web2py.py -K app -D 0 web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2013 Version 2.2.1 (2012-10-21 16:57:04) stable Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(pg8000), IMAP(imaplib) starting single

Re: [web2py] DAL reference but only a subset

2013-09-11 Thread António Ramos
I have the company id in my request.vars.emp variable So its easy IS_IN_DB(db(db.trabalhador.company==request.vars.emp), It works the request variable is amazingly powerfull thank you 2013/9/11 Anthony > On Wednesday, September 11, 2013 7:22:36 AM UTC-4, viniciusban wrote: > >>

Re: [web2py] Python Module, USB device, web2py

2013-09-11 Thread dederocks
Hi, I've done (I think) something similar to what you are trying to achieve. The way we've done it is as follows: 1. Have a separate thread with a python script that pulls the values from your USB instrument (in my case it was a serial port, don't know how to deal with a USB port) into a redis

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread Niphlod
let's solve an issue at a time. If your scheduler can't process the tasks that are in the queue when you launch it from the console, something is wrong with it and there's nothing that upstart can "fix". If you launch your scheduler from the console with web2py.py -K yourappname -D 0 what is t

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread Niphlod
so, the scheduler is working pretty fine: it just doesn't find any task to process. PS: you are on a really old release (2.2.1). That's almost a year ago! On Wednesday, September 11, 2013 4:23:07 PM UTC+2, ajith c t wrote: > > ubuntu@ip-10-0-0-13:/srv/trustvouch-fe$ sudo python web2py.py -K app

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread ajith c t
Thanks for the support. Yeah I will workout the steps you said one by one and breakdown the problem. Just a doubt, " ok. the scheduler from the console runs right. Now you have to test if queuing a task from web2py gets the task processed. " Since I am having a load balancer, and the web2py

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread Niphlod
> Just a doubt, > > " ok. the scheduler from the console runs right. Now you have to test if > queuing a task from web2py gets the task processed. " > > Since I am having a load balancer, and the web2py folder is in another > server, when running directly, I believe I will have to queue the

[web2py] Re: TypeError: %d format: a number is required, not dict

2013-09-11 Thread Annet
Massimo, Thanks for figuring out what the problem was, it didn't cross my mind that the error messages were the problem. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/we

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread ajith c t
sorry I am not executing the code in the load balancer. Let me say once more, so it will be clear. I dont have any web2py code in the load balancer. What I meant is I have my code in another server(say X) , to which the user is redirected by the load balancer(say Y). when I execute the webp

[web2py] Re: SQLFORM.grid and count field (web2py 2.6.0. test)

2013-09-11 Thread damufo
Hi, I followed this example with your answer. https://groups.google.com/forum/#!topic/web2py/FwWJGn6LGH8 I add (your "bad hack"): submenus = db.menus.with_alias('menusoptions') query = (db.menus.parent_id == 0) count = submenus.id.count() # bad hack

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread ajith c t
Agreed on the first point. Here the tasks are not getting assigned because I am calling the queue_task from the controller. I believe the controller function 'index' didn't not load as app cannot be opened in the browser. And the second point, yes the web2py version is a bit old, I had a little

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread Niphlod
ok. the scheduler from the console runs right. Now you have to test if queuing a task from web2py gets the task processed. Then you can do the same thing with the scheduler started by upstart, and verify that it's working. Next is to verify that you can queue tasks from the web2py web server st

[web2py] Re: SQLFORM.grid and count field (web2py 2.6.0. test)

2013-09-11 Thread damufo
Now work!! the code is: submenus = db.menus.with_alias('menusoptions') query = (db.menus.parent_id == 0) count = submenus.id.count() # bad hack count.tablename = 'menus' count.readable = True count.represent = False count.formatter

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread António Ramos
i have this output in[3]: IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:MM:SS"))("2013/09/25 09:54:24") Out[17]: (datetime.date(2013, 9, 25), None) In [4] : IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:MM:SS"))("20

[web2py] Re: Scheduler as upstart job

2013-09-11 Thread Niphlod
On Wednesday, September 11, 2013 5:44:00 PM UTC+2, ajith c t wrote: > > sorry I am not executing the code in the load balancer. Let me say once > more, so it will be clear. > > I dont have any web2py code in the load balancer. > > What I meant is I have my code in another server(say X) , to wh

[web2py] Uwsgi-error: ImportError: No module named 'globals'

2013-09-11 Thread Johann Spies
I have (as far as I can see) identical configurations on two debian computers. On one nginx with uwsgi works. On the other, however, I get the following uwsgi-error in the logs: Wed Sep 11 22:36:40 2013 - *** Operational MODE: preforking *** Wed Sep 11 22:36:40 2013 - added /home/www-data/web2py

[web2py] Re: How to leverage web2py popularity and usage?

2013-09-11 Thread Derek
I looked at web2py stats on some webpage (i forget now) and it shows 6 main developers. However, looking further, they are all Massimo connecting from various computers. It would be nice if that was cleaned up. On Friday, September 6, 2013 3:57:36 PM UTC-7, Diego Carvallo wrote: > > I think that

[web2py] Re: How to leverage web2py popularity and usage?

2013-09-11 Thread Derek
found it... Ohloh... https://www.ohloh.net/p/web2py/contributors/summary So it shows the amount of developers going up and up... But look at the top 6... Massimo Di Pierro, mdipierro, mdipierro@massimo-di-pierros-macbook2.local, mdipierro@massimo-di-pierros-macbook.local, Massimo DiPierro, and...

[web2py] Address format for all countries

2013-09-11 Thread Alex Glaros
I’d like help in building a universal address function for all countries. I’m hoping that it would prove useful to other programmers so it could be posted to Slices. The data model is finished, just need help with controller. BACKGROUND Different countries have different geo-political division

Re: [web2py] Re: How to leverage web2py popularity and usage?

2013-09-11 Thread Mariano Reingart
On Mon, Sep 9, 2013 at 5:21 PM, Anthony wrote: > There was one: http://www.web2py.com.ar/planet/. Looks like it's returning > an error ticket now. > Fixed the planet, althougth it needs to be updated and get some improvements... The source code is at: https://code.google.com/p/planet-web2py/ B

Re: [web2py] Re: Datetime Issue error

2013-09-11 Thread António Ramos
sorry the copy paste i have this output In [18]: IS_DATE(format=T('%Y/%m/%d %H:%M:%S'),error_message=T("Formato pretendido /mm/dd HH:MM:SS"))("2013/09-25 09:54:24") Out[18]: ('2013/09-25 09:54:24', 'Formato pretendido /mm/dd HH:MM:SS') and this In [8] : IS_DATE(format=T('%Y/%m/%d %H:%M:

Re: [web2py] Invalid request with special chars in URL

2013-09-11 Thread Wonton
Hello! Sorry for answering myself, but I've been working on this problem without success. This time I've tried with this post: https://groups.google.com/forum/#!msg/web2py/JZSL1R9J-C0/qsZ32kVfhGAJ Following Massimo advise in that post I've done this: This is my Routes.py: #!/usr/bin/python #

[web2py] Re: web2py course

2013-09-11 Thread Massimo Di Pierro
3 hrs for watching lectures. 6hrs for homework. On Wednesday, 11 September 2013 09:09:57 UTC-5, Christopher wrote: > > Do you have an hours per week time commitment estimate for the course? > > Thanks. > > On Tuesday, September 10, 2013 10:45:56 AM UTC-4, Massimo Di Pierro wrote: >> >> Shameless a

[web2py] Re: Uwsgi-error: ImportError: No module named 'globals'

2013-09-11 Thread Massimo Di Pierro
In both cases print the sys.path. On Wednesday, 11 September 2013 16:11:07 UTC-5, Johann Spies wrote: > > I have (as far as I can see) identical configurations on two debian > computers. On one nginx with uwsgi works. On the other, however, I get > the following uwsgi-error in the logs: > > We

[web2py] Transforming db data to json in web2py for visualization with flot.js

2013-09-11 Thread Sergio R.
I'm having problem to get a valid json string for flot.js visualisation from db data in web2py. This is my controller action: def getdata(): return dict(data=db().select(db.realtimedata.id, db.realtimedata.FlowRate, limitby=(0, 3), orderby=~db.realtimedata.id)) Generic json view returns

[web2py] Re: Transforming db data to json in web2py for visualization with flot.js

2013-09-11 Thread Massimo Di Pierro
rows=db().select(db.realtimedata.id, db.realtimedata.FlowRate, limitby=(0, 3), orderby=~db.realtimedata.id) data = [[row.id,row.FlowRate] for row in rows]] return json.dumps(data) On Wednesday, 11 September 2013 18:57:48 UTC-5, Sergio R. wrote: > > I'm having problem to get a valid json str

[web2py] upload and a process file using SQLFORM.grid

2013-09-11 Thread P T
Hello All, Just started to learn web2py and here is an idea that I am trying to implement. Users creates scenarios, which includes an uploaded file. After the new scenario is created, the uploaded file should be processed and computed values written to results table. So far, I am successful in