[web2py] sqlform.grid custom single row view

2013-11-28 Thread Gael Princivalle
Hi.

I've saw here how is it possible to customize a single row view from a 
sqlform.grid:
https://groups.google.com/forum/#!search/single$20datable$20record$20formatting/web2py/jZ1nkcIUcKc/EpvAuAL_VXYJ

What I don't know is how calling single row data.
For example you have this sqlform.grid in the controller:
def products_listing():
fields = 
(db.products.code,db.products.description,db.products.brand,db.products.pdf_path)
grid = SQLFORM.grid(db.products, fields=fields)
return dict(grid=grid)

And in the view:
{{if request.args and request.args[-3] == 'view':}} #So here is my single 
row view
#How can I call fields ?
  db.products.code
  db.products.description
  db.products.brand
  db.products.pdf_path
{{else:}}
{{=grid}}
{{pass}}

Thanks.

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py 2.8.1 is OUT

2013-11-28 Thread Tim Richardson
I confirm this, albeit I get it via the scheduler:

URL/accpac_web_orders/default/monitor_jobs/view/scheduler_run/586 
Traceback (most recent call last): File d:\web2py2x\gluon\scheduler.py, 
line 218, in executor _env = env(a=a, c=c, import_models=True) File 
d:\web2py2x\gluon\shell.py, line 134, in env ip = 
global_settings.cmd_options.ip AttributeError: 'NoneType' object has no 
attribute 'ip' 

On Thursday, November 28, 2013 7:31:05 AM UTC+11, Massimo Di Pierro wrote:

 Changelog


 - no more winservice (use nssm instead)
 - better imap support in DAL
 - db().select().as_tree()
 - bootstrap 2.3.2
 - codemirror 3.19
 - virtual fields in grid
 - improved  mongoDB support, thanks Alan
 - support for wiki custom render function
 - Wiki(...groups=['x','y']) allows bypassing default permissions
 - fixed websocket_messaging.py to support newer Tornado
 - NDB support for GAE, thanks Quint
 - fixed major concurrecy issue with MEMDB
 - blocked generic.jsonp for security reasons
 - many bug fixes, thanks Niphlod, Michele, Anthony, Tim, and many others.


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Model and Controller with Web2Py, View with Excel ??

2013-11-28 Thread Ykä Marjanen
I don't think you can use a web based application without a server. 
However, the local server is already there without additional installation, 
so if you want an application that has a browser interface, then you don't 
need to do any extra.

You can use the webpy current architecture directly and just generate the 
excel file in a controller and pass it to view (or generate it in the 
view). I think you can even view/edit the xls file in the browser with a 
browser plugin, or then let it automatically open the results in excel.

I think you can use DAL in your local script without server and do the 
controller-part also in normal Python functions, but then you wouldn't have 
browser UI or web support.

Ykä

On Wednesday, November 27, 2013 6:22:25 PM UTC+2, Py Dev wrote:

 Hi,

 the combination web2py-DAL with python code (controller) and Excel to 
 manipulate and chart table data would be wonderful.

 That would mean rapid prototyping with a lot of databases and the option 
 to go to web later.

 So, is it possible to use „only“ the model and controller level from 
 web2py and use Mircosoft Excel as view with for example pyxll or datanitro?

 (see http://www.pyxll.com  and https://datanitro.com )

 Is it possible to use web2py-DAL locally without a webserver?

 Would it be possible to use a debugger with this combination?

 Cheers!

 pd


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Very intersting article about a radio station web2py

2013-11-28 Thread Ruud Schroen
Great story! I really like the part where he explains the solution for 
fetching random records in a large database.

On Thursday, November 28, 2013 1:56:51 AM UTC+1, Massimo Di Pierro wrote:


 http://www.reddit.com/r/Python/comments/1rlcwl/scaling_stereodose_a_web2py_internet_radio_station/


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: disk cache problem

2013-11-28 Thread szimszon
In 2.8.1 I still have a problem.

Now another one too:

Ticket ID 
192.168.7.29.2013-11-28.11-31-21.11f4e653-5c83-4b57-8615-c88eba04fffd 
__len__() should return = 0 Version web2py(tm) Version 
2.8.1-stable+timestamp.2013.11.27.13.52.50 Traceback 
Traceback (most recent call last):
File /home/gyszabolcs/fejlesztes/web2py/gluon/restricted.py, line 217, in 
restricted
exec ccode in environment
File 
/home/gyszabolcs/fejlesztes/web2py/applications/eszkoz/controllers/autocomplete.py
 
(https://w2p-dev.primerate.lan/admin/default/edit/eszkoz/controllers/autocomplete.py),
 
line 462, in 
File /home/gyszabolcs/fejlesztes/web2py/gluon/globals.py, line 372, in 
self._caller = lambda f: f()
File /home/gyszabolcs/fejlesztes/web2py/gluon/tools.py, line 3239, in f
return action(*a, **b)
File 
/home/gyszabolcs/fejlesztes/web2py/applications/eszkoz/controllers/autocomplete.py
 
(https://w2p-dev.primerate.lan/admin/default/edit/eszkoz/controllers/autocomplete.py),
 
line 110, in qrcode_strAC
select(db.device.qrcode, distinct=True , cache=(cache.disk, 120))
File /home/gyszabolcs/fejlesztes/web2py/gluon/dal.py, line 10335, in 
select
return adapter.select(self.query,fields,attributes)
File /home/gyszabolcs/fejlesztes/web2py/gluon/dal.py, line 1831, in select
return self._select_aux(sql,fields,attributes)
File /home/gyszabolcs/fejlesztes/web2py/gluon/dal.py, line 1805, in 
_select_aux
rows = cache_model(key,_select_aux2,time_expire)
File /home/gyszabolcs/fejlesztes/web2py/gluon/cache.py, line 365, in 
__call__
self._close_shelve_and_unlock()
File /home/gyszabolcs/fejlesztes/web2py/gluon/cache.py, line 255, in 
_close_shelve_and_unlock
if self.storage:
File /usr/lib/python2.7/shelve.py, line 104, in __len__
return len(self.dict)
ValueError: __len__() should return = 0

2013. november 27., szerda 10:53:05 UTC+1 időpontban szimszon a következőt 
írta:

 Hello!


 Nobody has problem with disk cache?

 2013. november 26., kedd 9:16:31 UTC+1 időpontban szimszon a következőt 
 írta:

 http://code.google.com/p/web2py/issues/detail?id=1791thanks=1791ts=1385453629

 I have an app with lot of disk cache usage in selects after 2.7 - don't know 
 exactly the exact version :( - I got a lot of trouble with it, sometimes the 
 app just wait and if I try disk. Or if I make a cache.disk.flush() I got 
 this:

 Ticket ID

 192.168.7.29.2013-11-18.14-42-35.394acb31-76b9-4204-8695-c5f9ee84a87a
 class '_bsddb.DBNotFoundError' (-30988, 'DB_NOTFOUND: No matching key/data 
 pair found')
 Version
 web2py(tm)   Version 2.7.4-stable+timestamp.2013.11.03.22.45.08
 Traceback

 Traceback (most recent call last):
   File /usr/local/share/web2py/gluon/restricted.py, line 217, in restricted
 exec ccode in environment
   File applications/eszkoz/compiled/controllers.bevetel.szamla.py, line 
 1090, in module
   File /usr/local/share/web2py/gluon/globals.py, line 372, in lambda
 self._caller = lambda f: f()
   File /usr/local/share/web2py/gluon/tools.py, line 3240, in f
 return action(*a, **b)
   File applications/eszkoz/compiled/controllers.bevetel.szamla.py, line 
 415, in szamla
   File /usr/local/share/web2py/gluon/tools.py, line 3948, in create
 **attributes
   File /usr/local/share/web2py/gluon/tools.py, line 3899, in update
 callback(onaccept, form, table._tablename)
   File /usr/local/share/web2py/gluon/tools.py, line 76, in callback
 [action(form) for action in actions]
   File /usr/local/share/web2py/gluon/tools.py, line 3240, in f
 return action(*a, **b)
   File applications/eszkoz/compiled/controllers.bevetel.szamla.py, line 
 65, in send_mail_to_penzugy
   File applications/eszkoz/compiled/controllers.bevetel.szamla.py, line 
 52, in flush_cache
   File /usr/local/share/web2py/gluon/cache.py, line 336, in clear
 storage.clear()
   File /usr/lib/python2.6/UserDict.py, line 124, in clear
 del self[key]
   File /usr/lib/python2.6/shelve.py, line 136, in __delitem__
 del self.dict[key]
   File /usr/lib/python2.6/bsddb/__init__.py, line 285, in __delitem__
 _DeadlockWrap(wrapF)  # del self.db[key]
   File /usr/lib/python2.6/bsddb/dbutils.py, line 68, in DeadlockWrap
 return function(*_args, **_kwargs)
   File /usr/lib/python2.6/bsddb/__init__.py, line 284, in wrapF
 del self.db[key]
 DBNotFoundError: (-30988, 'DB_NOTFOUND: No matching key/data pair found')

 In file: 
 /usr/local/share/web2py/applications/eszkoz/compiled/controllers.bevetel.szamla.pyc

  code object module at 0xfbc8b068, file 
 applications/eszkoz/compiled/controllers.bevetel.szamla.py, line 1

 I need to manually del the content of the cache dir.

 The very some app is running good with 2.6.4.

 I use apache frontend with wsgi in both case.



-- 
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 Google Groups 
web2py-users group.
To 

[web2py] FORM / SQLFORM spinner

2013-11-28 Thread Gael Princivalle
Hi.

I would like to had a quantity field in a form, controlled by a spinner.
With a standard HTML form I can use some Jquery spinners, but if I would 
like to generate the form with FORM or SQLFORM, is it possible to associate 
a spinner to this input field ?

Thanks.

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Cron job every 30 seconds

2013-11-28 Thread Javier Pepe
You can add cron job which sleep

* * * * * sleep  0;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 10;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 20;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 30;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 40;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py
* * * * * sleep 50;/usr/local/apps/web2py/applications/sipacweb/private/run
procesos.py

This process run every ten seconds.





On Wed, Nov 27, 2013 at 11:20 PM, Brian M bmere...@gmail.com wrote:

 web2py's scheduler will let you set the repeat period in seconds so you
 could probably do 30 seconds that way.

 On Tuesday, November 26, 2013 2:55:16 PM UTC-6, melmg wrote:

 Is is possible to set up a cron job to run every 30 seconds instead of a
 minute? I have a function that does an HTTP GET request to retrieve some
 values from another server (a small server running on a microcontroller)
 and then saves those values in the database. I want to run this function
 every 30 seconds in the background.

 Thank you for the help!

  --
 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 Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] web2py 2.8.1 - What would db().select().as_tree()? Has example?

2013-11-28 Thread Meir
Hello!

Someone could inform the purpose and use of the db()select()as_tree()?

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py 2.8.1 - What would db().select().as_tree()? Has example?

2013-11-28 Thread LightDot
This was announced in this thread:

https://groups.google.com/d/msg/web2py/bsGZ4lp-gz4/4olaBq6t7qQJ

Regards

On Thursday, November 28, 2013 12:26:28 PM UTC+1, Meir wrote:

 Hello!

 Someone could inform the purpose and use of the db()select()as_tree()?


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py 2.8.1 is OUT

2013-11-28 Thread Tim Richardson
It's due to the commit for issue 1760, according to my bisect.
I'll update that issue.



On Thursday, November 28, 2013 7:28:53 PM UTC+11, Tim Richardson wrote:

 I confirm error reported by Martin above: I get it via the scheduler:

 URL/accpac_web_orders/default/monitor_jobs/view/scheduler_run/586 
 Traceback (most recent call last): File d:\web2py2x\gluon\scheduler.py, 
 line 218, in executor _env = env(a=a, c=c, import_models=True) File 
 d:\web2py2x\gluon\shell.py, line 134, in env ip = 
 global_settings.cmd_options.ip AttributeError: 'NoneType' object has no 
 attribute 'ip' 

 On Thursday, November 28, 2013 7:31:05 AM UTC+11, Massimo Di Pierro wrote:

 Changelog


 - no more winservice (use nssm instead)
 - better imap support in DAL
 - db().select().as_tree()
 - bootstrap 2.3.2
 - codemirror 3.19
 - virtual fields in grid
 - improved  mongoDB support, thanks Alan
 - support for wiki custom render function
 - Wiki(...groups=['x','y']) allows bypassing default permissions
 - fixed websocket_messaging.py to support newer Tornado
 - NDB support for GAE, thanks Quint
 - fixed major concurrecy issue with MEMDB
 - blocked generic.jsonp for security reasons
 - many bug fixes, thanks Niphlod, Michele, Anthony, Tim, and many others.



-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Form self-submit broken after redirection

2013-11-28 Thread Anthony
Can you attach a minimal app that reproduces the problem?

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Model and Controller with Web2Py, View with Excel ??

2013-11-28 Thread Tim Richardson
Excel macros can retrieve data from websites, although built-in support is 
primitive (HTML or XML). So you'd use web2py as a webservice basically (as 
documented in the book). This is the quickest and dirtiest way,  I think. 
Stackoverflow has example of fetching json via VBA.

Then your spreadsheet would draw its charts based on this raw data which is 
saved to a data tab. I do this a fair bit, although to be honest mainly 
with SQL sent to server.
You can also generate spreadsheets in python, although for spreadsheet 
where you want to encourage manipulation and charting I think it's better 
just to import data via a macro (see above). 

There are also web-clients ways to draw charts (I wrote a plugin for google 
charts, on web2pyslices), but these may be too static.

There are javascript libraries for data manipulation and charting (d3.js). 
Depends on how long you want to spend learning new things. If you're going 
to be doing this a bit, a javascript client approach seems much better.







On Thursday, November 28, 2013 8:32:12 PM UTC+11, Ykä Marjanen wrote:

 I don't think you can use a web based application without a server. 
 However, the local server is already there without additional installation, 
 so if you want an application that has a browser interface, then you don't 
 need to do any extra.

 You can use the webpy current architecture directly and just generate the 
 excel file in a controller and pass it to view (or generate it in the 
 view). I think you can even view/edit the xls file in the browser with a 
 browser plugin, or then let it automatically open the results in excel.

 I think you can use DAL in your local script without server and do the 
 controller-part also in normal Python functions, but then you wouldn't have 
 browser UI or web support.

 Ykä

 On Wednesday, November 27, 2013 6:22:25 PM UTC+2, Py Dev wrote:

 Hi,

 the combination web2py-DAL with python code (controller) and Excel to 
 manipulate and chart table data would be wonderful.

 That would mean rapid prototyping with a lot of databases and the option 
 to go to web later.

 So, is it possible to use „only“ the model and controller level from 
 web2py and use Mircosoft Excel as view with for example pyxll or datanitro?

 (see http://www.pyxll.com  and https://datanitro.com )

 Is it possible to use web2py-DAL locally without a webserver?

 Would it be possible to use a debugger with this combination?

 Cheers!

 pd



-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: sqlform.grid custom single row view

2013-11-28 Thread Massimo Di Pierro
{{if grid.view_form:}} # So here is my single row view
# How can I call fields ? Like this:
  grid.view_form.record.code
  grid.view_form.record.description
  grid.view_form.record.brand
  grid.view_form.record.pdf_path
{{else:}}
{{=grid}}
{{pass}}

On Thursday, 28 November 2013 02:08:48 UTC-6, Gael Princivalle wrote:

 Hi.

 I've saw here how is it possible to customize a single row view from a 
 sqlform.grid:

 https://groups.google.com/forum/#!search/single$20datable$20record$20formatting/web2py/jZ1nkcIUcKc/EpvAuAL_VXYJ

 What I don't know is how calling single row data.
 For example you have this sqlform.grid in the controller:
 def products_listing():
 fields = 
 (db.products.code,db.products.description,db.products.brand,db.products.pdf_path)
 grid = SQLFORM.grid(db.products, fields=fields)
 return dict(grid=grid)

 And in the view:
 {{if request.args and request.args[-3] == 'view':}} #So here is my single 
 row view
 #How can I call fields ?
   db.products.code
   db.products.description
   db.products.brand
   db.products.pdf_path
 {{else:}}
 {{=grid}}
 {{pass}}

 Thanks.


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Cron job every 30 seconds

2013-11-28 Thread Massimo Di Pierro
Please use the scheduler, not cron. Cron must die. 

On Thursday, 28 November 2013 05:22:28 UTC-6, Javier Pepe wrote:

 You can add cron job which sleep 

 * * * * * sleep  
 0;/usr/local/apps/web2py/applications/sipacweb/private/run procesos.py 
 * * * * * sleep 
 10;/usr/local/apps/web2py/applications/sipacweb/private/run procesos.py 
 * * * * * sleep 
 20;/usr/local/apps/web2py/applications/sipacweb/private/run procesos.py 
 * * * * * sleep 
 30;/usr/local/apps/web2py/applications/sipacweb/private/run procesos.py 
 * * * * * sleep 
 40;/usr/local/apps/web2py/applications/sipacweb/private/run procesos.py 
 * * * * * sleep 
 50;/usr/local/apps/web2py/applications/sipacweb/private/run procesos.py 

 This process run every ten seconds.





 On Wed, Nov 27, 2013 at 11:20 PM, Brian M bmer...@gmail.com javascript:
  wrote:

 web2py's scheduler will let you set the repeat period in seconds so you 
 could probably do 30 seconds that way.

 On Tuesday, November 26, 2013 2:55:16 PM UTC-6, melmg wrote:

 Is is possible to set up a cron job to run every 30 seconds instead of a 
 minute? I have a function that does an HTTP GET request to retrieve some 
 values from another server (a small server running on a microcontroller) 
 and then saves those values in the database. I want to run this function 
 every 30 seconds in the background. 

 Thank you for the help!

  -- 
 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 Google Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: sqlform.grid custom single row view

2013-11-28 Thread Gael Princivalle
Thanks a lot Massimo, web2py for president. Ciao.

Il giorno giovedì 28 novembre 2013 14:31:56 UTC+1, Massimo Di Pierro ha 
scritto:

 {{if grid.view_form:}} # So here is my single row view
 # How can I call fields ? Like this:
   grid.view_form.record.code
   grid.view_form.record.description
   grid.view_form.record.brand
   grid.view_form.record.pdf_path
 {{else:}}
 {{=grid}}
 {{pass}}

 On Thursday, 28 November 2013 02:08:48 UTC-6, Gael Princivalle wrote:

 Hi.

 I've saw here how is it possible to customize a single row view from a 
 sqlform.grid:

 https://groups.google.com/forum/#!search/single$20datable$20record$20formatting/web2py/jZ1nkcIUcKc/EpvAuAL_VXYJ

 What I don't know is how calling single row data.
 For example you have this sqlform.grid in the controller:
 def products_listing():
 fields = 
 (db.products.code,db.products.description,db.products.brand,db.products.pdf_path)
 grid = SQLFORM.grid(db.products, fields=fields)
 return dict(grid=grid)

 And in the view:
 {{if request.args and request.args[-3] == 'view':}} #So here is my single 
 row view
 #How can I call fields ?
   db.products.code
   db.products.description
   db.products.brand
   db.products.pdf_path
 {{else:}}
 {{=grid}}
 {{pass}}

 Thanks.



-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: FORM / SQLFORM spinner

2013-11-28 Thread Ruud Schroen
You can still use SQLFORM, but have standard html inputs.

Example:

{{=form.custom.begin}}

..enter your html input here with attribute: *name**=NAME OF YOUR FIELD*

{{=form.custom.end}}


You can find more info about custom forms 
herehttp://www.web2py.com/book/default/chapter/07#Custom-forms

On Thursday, November 28, 2013 11:59:44 AM UTC+1, Gael Princivalle wrote:

 Hi.

 I would like to had a quantity field in a form, controlled by a spinner.
 With a standard HTML form I can use some Jquery spinners, but if I would 
 like to generate the form with FORM or SQLFORM, is it possible to associate 
 a spinner to this input field ?

 Thanks.


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] web2py 2.8.2 is OUT

2013-11-28 Thread Massimo Di Pierro
It is the same as 2.8.1 but fixes the two bugs which had been reported 
yesterday.

Happy Thanksgiving.

Massimo

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] web2py 2.8.2 is OUT

2013-11-28 Thread Martin Weissenboeck
Thanks, Massimo! My problem has gone, 2.8.2 works.


2013/11/28 Massimo Di Pierro massimo.dipie...@gmail.com

 It is the same as 2.8.1 but fixes the two bugs which had been reported
 yesterday.

 Happy Thanksgiving.

 Massimo

 --
 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 Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Add version number to include javascript files

2013-11-28 Thread Eric
Hi,

This nice one-liner is adding a version number to css and js paths:

response.static_version = true

When including files like this:

{{
response.files.append(URL('static','css/normalize.css'))
}}

With the compression option to true all the files in the sample above will 
be combined, same with JS files. In some situations we want files to add 
.js files to the bottom of the page without adding them to the compressed 
version so we add them like this:

script src={{=URL('static','js/example.js')}}/script

And let the be placed at the bottom. That works great, but is there also an 
option to add the version number to path? That would be even better :)

I have the idea that you've created something for it, but I can't find it...

Hope you can help :)

Tnx!

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: FORM / SQLFORM spinner

2013-11-28 Thread Richard Vézina
Spin.js works well :

http://fgnass.github.io/spin.js/


On Thu, Nov 28, 2013 at 9:02 AM, Ruud Schroen r...@formatics.nl wrote:

 You can still use SQLFORM, but have standard html inputs.

 Example:

 {{=form.custom.begin}}

 ..enter your html input here with attribute: *name**=NAME OF YOUR FIELD*

 {{=form.custom.end}}


 You can find more info about custom forms 
 herehttp://www.web2py.com/book/default/chapter/07#Custom-forms

 On Thursday, November 28, 2013 11:59:44 AM UTC+1, Gael Princivalle wrote:

 Hi.

 I would like to had a quantity field in a form, controlled by a spinner.
 With a standard HTML form I can use some Jquery spinners, but if I would
 like to generate the form with FORM or SQLFORM, is it possible to associate
 a spinner to this input field ?

 Thanks.

  --
 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 Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: FDB (firebird) adapter can't store blobs greater than 64k

2013-11-28 Thread Raul Monares
I think the solution is to use streamed blobs (from FDB documentation):

# Insertion:cur.execute(insert into blob_test values (?), 
(StringIO('abcdef'),))

# Retrieval using the file-like methods of BlobReader:

cur.execute(select a from blob_test)cur.set_stream_blob('A') # Note the 
capital letter
readerA = cur.fetchone()[0]

value = readerA.read()


On Tuesday, November 26, 2013 2:16:12 PM UTC-7, Jose wrote:

 Hi,

 I was watching this. I have a little dizzy with the code. Now I can not 
 prove. The solution is to redefine represent_exceptions in 
 FireBirdAdapter? It is that way?

 José


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Cron job every 30 seconds

2013-11-28 Thread Leonel Câmara
Is the time critical? Do you have control/can program the server in the 
microcontroller?

It seems to me as this should be reversed. Instead of you polling the 
microcontroller, the microcontroller should be sending you new data, either 
when it receives it or in batches.

Terça-feira, 26 de Novembro de 2013 20:55:16 UTC, melmg escreveu:

 Is is possible to set up a cron job to run every 30 seconds instead of a 
 minute? I have a function that does an HTTP GET request to retrieve some 
 values from another server (a small server running on a microcontroller) 
 and then saves those values in the database. I want to run this function 
 every 30 seconds in the background. 

 Thank you for the help!


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: FORM / SQLFORM spinner

2013-11-28 Thread Niphlod
I think spinners that gael is referring to are not the ones generated by 
spin.js. I think he means number spinners...

@gael: code your own widget, it's very easy to do so


On Thursday, November 28, 2013 4:46:43 PM UTC+1, Richard wrote:

 Spin.js works well :

 http://fgnass.github.io/spin.js/


 On Thu, Nov 28, 2013 at 9:02 AM, Ruud Schroen ru...@formatics.nljavascript:
  wrote:

 You can still use SQLFORM, but have standard html inputs.

 Example:

 {{=form.custom.begin}}

 ..enter your html input here with attribute: *name**=NAME OF YOUR 
 FIELD*

 {{=form.custom.end}}


 You can find more info about custom forms 
 herehttp://www.web2py.com/book/default/chapter/07#Custom-forms

 On Thursday, November 28, 2013 11:59:44 AM UTC+1, Gael Princivalle wrote:

 Hi.

 I would like to had a quantity field in a form, controlled by a spinner.
 With a standard HTML form I can use some Jquery spinners, but if I would 
 like to generate the form with FORM or SQLFORM, is it possible to associate 
 a spinner to this input field ?

 Thanks.

  -- 
 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 Google Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Add version number to include javascript files

2013-11-28 Thread Niphlod
nope, there isn't . a PR has been raised for this but has been turned down 
(for good reason)
If you need static versioning for files not included in response.files  
use URL('static', '_1.2.3/js/example.js')

BTW, let other tools compress and optimize your big chunk of javascript

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Add version number to include javascript files

2013-11-28 Thread Eric Christiaanse
Okay, that's clear reaction and tip, tnx!

I was thinking about the proposed solution, but many times I've found that
Web2Py had build in solutions for my 'problems'. That's my I asked :)


2013/11/28 Niphlod niph...@gmail.com

 nope, there isn't . a PR has been raised for this but has been turned down
 (for good reason)
 If you need static versioning for files not included in response.files
  use URL('static', '_1.2.3/js/example.js')

 BTW, let other tools compress and optimize your big chunk of javascript

 --
 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 a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/HfNz_j6zRz0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Can't migate an App to a new WS2k8R2 box

2013-11-28 Thread Dick Schrauwen
I'm trying to migrate a web2py application to a new box.
Source:
 WS2k8 
 http://gutsup.com
 = http://95.211.128.165/openbrief
 web2py: _w2p_246
 using MySQL5.5 

Target:
 WS2k8 R2
 http://37.48.64.183   = welcome
 http://37.48.64.183/openbrief = crash
 _web2py281
 mySQL 5.6

What did i do?
 I transferred the database (w2pyopenbrief) from source to target using 
workbench (export/import)
 Defined the same user /password in target mySQL (web2py / / DBA)
 Downloaded new Web2Py (281)
 Packed openbrief app in source, read it in target

QUESTION: What did i do wrong?




 ERROR ==

Error ticket for openbrief
Ticket ID
37.48.64.183.2013-11-28.19-01-02.5f015402-2f6b-4724-a2e8-b82886f49038

class 'gluon.contrib.pymysql.err.InternalError' (1071, u'Specified key 
was too long; max key length is 767 bytes')

Version
web2py™ Version 2.8.1-stable+timestamp.2013.11.27.20.07.10
Traceback
Traceback (most recent call last):
  File /home/mdipierro/make_web2py/web2py/gluon/restricted.py, line 217, 
in restricted
  File S:/_web2py281/web2py/applications/openbrief/models/db.py, line 89, 
in module
format='%(content)s') 

#NOTE, this error is in this fragment ie the first define_table statement
# TESTIT
# db.define_table('testit',
#  Field('content','string',notnull=True,unique=True),
#  format='%(content)s')

  File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 8139, in 
define_table
  File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 8176, in 
lazy_define_table
  File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1086, in 
create_table
  File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1194, in 
migrate_table
  File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1916, in 
execute
  File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1910, in 
log_execute
  File 
/home/mdipierro/make_web2py/web2py/gluon/contrib/pymysql/cursors.py, line 
117, in execute
  File 
/home/mdipierro/make_web2py/web2py/gluon/contrib/pymysql/connections.py, 
line 202, in defaulterrorhandler
InternalError: (1071, u'Specified key was too long; max key length is 767 
bytes')
In file: S:\_web2py281\web2py\applications\openbrief\models\db.py

# -*- coding: utf-8 -*-

#
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#

## if SSL/HTTPS is properly configured and you want all HTTP requests to
## be redirected to HTTPS, uncomment the line below:
# request.requires_https()

if not request.env.web2py_runtime_gae:
## if NOT running on Google App Engine use SQLite or other DB
db = DAL('mysql://web2py:1616359wp@127.0.0.1:3306/w2popenbrief')
else:
## connect to Google BigTable (optional 'google:datastore://namespace')
db = DAL('google:datastore')
## store sessions and tickets there
session.connect(request, response, db = db)
## or store session in Memcache, Redis, etc.
## from gluon.contrib.memdb import MEMDB
## from google.appengine.api.memcache import Client
## session.connect(request, response, db = MEMDB(Client()))

## by default give a view/generic.extension to all actions from localhost
## none otherwise. a pattern can be 'controller/function.extension'
response.generic_patterns = ['*'] if request.is_local else []
## (optional) optimize handling of static files
# response.optimize_css = 'concat,minify,inline'
# response.optimize_js = 'concat,minify,inline'

#
## Here is sample code if you need for
## - email capabilities
## - authentication (registration, login, logout, ... )
## - authorization (role based authorization)
## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)
## - old style crud actions
## (more options discussed in gluon/tools.py)
#


from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
auth = Auth(db)
crud, service, plugins = Crud(db), Service(), PluginManager()

## create all tables needed by auth if not custom tables
auth.define_tables(username=False, signature=False)

## configure email
mail=auth.settings.mailer
mail.settings.server = 'logging' or 'smtp.gmail.com:587'
mail.settings.sender = 'y...@gmail.com'
mail.settings.login = 'username:password'

## configure auth policy
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True

## if you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, etc.
## register with janrain.com, write your domain:api_key in 
private/janrain.key
from gluon.contrib.login_methods.rpx_account import use_janrain

Re: [web2py] Re: FORM / SQLFORM spinner

2013-11-28 Thread Gael Princivalle
Yes you're right Niphlod, I've made a number touch-spin modifying this 
number spinner:
http://www.jqueryscript.net/form/Input-Number-Spinner-with-jQuery-Bootstrap-Spinner.html

Thanks everybody with the Ruud answer I'm ok, works fine.

Il giorno giovedì 28 novembre 2013 18:09:34 UTC+1, Niphlod ha scritto:

 I think spinners that gael is referring to are not the ones generated by 
 spin.js. I think he means number spinners...

 @gael: code your own widget, it's very easy to do so


 On Thursday, November 28, 2013 4:46:43 PM UTC+1, Richard wrote:

 Spin.js works well :

 http://fgnass.github.io/spin.js/


 On Thu, Nov 28, 2013 at 9:02 AM, Ruud Schroen ru...@formatics.nl wrote:

 You can still use SQLFORM, but have standard html inputs.

 Example:

 {{=form.custom.begin}}

 ..enter your html input here with attribute: *name**=NAME OF YOUR 
 FIELD*

 {{=form.custom.end}}


 You can find more info about custom forms 
 herehttp://www.web2py.com/book/default/chapter/07#Custom-forms

 On Thursday, November 28, 2013 11:59:44 AM UTC+1, Gael Princivalle wrote:

 Hi.

 I would like to had a quantity field in a form, controlled by a spinner.
 With a standard HTML form I can use some Jquery spinners, but if I 
 would like to generate the form with FORM or SQLFORM, is it possible to 
 associate a spinner to this input field ?

 Thanks.

  -- 
 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 Google 
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] request.user_agent().is_mobile

2013-11-28 Thread mr.freeze
Did request.user_agent() change from a Storage object to dict? 
request.user_agent().is_mobile is throwing errors for me on the latest bits 
(2.8.2):
AttributeError: 'dict' object has no attribute 'is_mobile'. 
Happy Thanksgiving!

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: request.user_agent().is_mobile

2013-11-28 Thread szimszon
I had that with 2.7.x too. I changed all my app to 
user_agent()['is_mobile'] :-o

2013. november 28., csütörtök 20:55:14 UTC+1 időpontban mr.freeze a 
következőt írta:

 Did request.user_agent() change from a Storage object to dict? 
 request.user_agent().is_mobile is throwing errors for me on the latest bits 
 (2.8.2):
 AttributeError: 'dict' object has no attribute 'is_mobile'. 
 Happy Thanksgiving!


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py 2.8.1 is OUT

2013-11-28 Thread Tim Richardson
To remove existing sessions try cleaning the application via the admin 
application.

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Globals.py Bad Request

2013-11-28 Thread Leonardo Pires Felix
Sorry for my english.
Hi there, i've this simple sqlform.grid:
@auth.requires_membership(secretaria)
def turmas():
campos = [db.alunos.id,db.alunos.nome,db.alunos.nome_responsavel,db.
alunos.serie_turma]
form = SQLFORM.grid(db.alunos,fields=campos,deletable=False,orderby=
alunos.nome)

I've used the pc on the school to try to update one field of the row, It 
raises the error. Add a row give me the same error. 
When i came home and used my personal pc everything went smooth.

The error wasn't tracked by the web2py, only the apache error log.
Error stack:

[Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] Traceback (most 
recent call last):
[Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10]   File 
/home/leonardo/homes/web2py/gluon/main.py, line 532, in wsgibase
[Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] if request.body:
[Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10]   File 
/home/leonardo/homes/web2py/gluon/globals.py, line 252, in body
[Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] raise HTTP(400, 
Bad Request - HTTP body is incomplete)
[Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] HTTP: 400 BAD REQUEST


I want to know if, it is a browser/system problem on the request, or 
something else. I didn't found any glue about this.
On the school, i've tried to use both chrome and IE 7 or . The OS is 
windows xp.
On my home, everything worked, I'm using win 7 with both ie 11 and firefox 
25. And Debian 7 with iceweasel and chromium.

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: request.user_agent().is_mobile

2013-11-28 Thread Massimiliano
Have you tried to delete sessions?


On Thu, Nov 28, 2013 at 9:32 PM, szimszon szims...@gmail.com wrote:

 I had that with 2.7.x too. I changed all my app to
 user_agent()['is_mobile'] :-o

 2013. november 28., csütörtök 20:55:14 UTC+1 időpontban mr.freeze a
 következőt írta:

 Did request.user_agent() change from a Storage object to dict?
 request.user_agent().is_mobile is throwing errors for me on the latest bits
 (2.8.2):
 AttributeError: 'dict' object has no attribute 'is_mobile'.
 Happy Thanksgiving!

  --
 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 Google Groups
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
Massimiliano

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: request.user_agent().is_mobile

2013-11-28 Thread mr.freeze
Yes, same error unfortunately and request.user_agent() still returns a 
dict. I could swear it used to return a Storage object.

On Thursday, November 28, 2013 3:26:10 PM UTC-6, Massimiliano wrote:

 Have you tried to delete sessions?


 On Thu, Nov 28, 2013 at 9:32 PM, szimszon szim...@gmail.com javascript:
  wrote:

 I had that with 2.7.x too. I changed all my app to 
 user_agent()['is_mobile'] :-o

 2013. november 28., csütörtök 20:55:14 UTC+1 időpontban mr.freeze a 
 következőt írta:

 Did request.user_agent() change from a Storage object to dict? 
 request.user_agent().is_mobile is throwing errors for me on the latest bits 
 (2.8.2):
 AttributeError: 'dict' object has no attribute 'is_mobile'. 
 Happy Thanksgiving!

  -- 
 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 Google Groups 
 web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to web2py+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




 -- 
 Massimiliano 


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Model and Controller with Web2Py, View with Excel ??

2013-11-28 Thread Andrew Buchan
Hi, do you mean using the DAL without running a web server?

If so, look at this http://www.web2py.com/AlterEgo/default/show/215

I reckon you could use that in combination with pyxll. 
If you're looking for another way, you *may* be able to use ExcelDNA (
https://exceldna.codeplex.com/) and create an IronPython project which 
imports the DAL libraries...Don't take my word on that, perhaps someone a 
bit more informed than me know of a reason why this wouldn't work..
You can debug that too, but you're working in .Net if that's not a 
problem...

I'd be very interested in finding out how you get on!

On Wednesday, November 27, 2013 4:22:25 PM UTC, Py Dev wrote:

 Hi,

 the combination web2py-DAL with python code (controller) and Excel to 
 manipulate and chart table data would be wonderful.

 That would mean rapid prototyping with a lot of databases and the option 
 to go to web later.

 So, is it possible to use „only“ the model and controller level from 
 web2py and use Mircosoft Excel as view with for example pyxll or datanitro?

 (see http://www.pyxll.com  and https://datanitro.com )

 Is it possible to use web2py-DAL locally without a webserver?

 Would it be possible to use a debugger with this combination?

 Cheers!

 pd


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: request.user_agent().is_mobile

2013-11-28 Thread Tim Richardson
To fix this, you need to clear sessions.
The easiest way to do this is via the admin app.
Find the application causing problems, and from the menu of actions per 
application, choose Clean

This will fix the problem.



On Friday, 29 November 2013 08:52:29 UTC+11, mr.freeze wrote:

 Yes, same error unfortunately and request.user_agent() still returns a 
 dict. I could swear it used to return a Storage object.

 On Thursday, November 28, 2013 3:26:10 PM UTC-6, Massimiliano wrote:

 Have you tried to delete sessions?


 On Thu, Nov 28, 2013 at 9:32 PM, szimszon szim...@gmail.com wrote:

 I had that with 2.7.x too. I changed all my app to 
 user_agent()['is_mobile'] :-o

 2013. november 28., csütörtök 20:55:14 UTC+1 időpontban mr.freeze a 
 következőt írta:

 Did request.user_agent() change from a Storage object to dict? 
 request.user_agent().is_mobile is throwing errors for me on the latest 
 bits 
 (2.8.2):
 AttributeError: 'dict' object has no attribute 'is_mobile'. 
 Happy Thanksgiving!

  -- 
 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 Google 
 Groups web2py-users group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




 -- 
 Massimiliano 



-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py 2.8.1 is OUT

2013-11-28 Thread Massimo Di Pierro
It is fixed in 2.8.2


On Thursday, 28 November 2013 05:46:14 UTC-6, Tim Richardson wrote:

 It's due to the commit for issue 1760, according to my bisect.
 I'll update that issue.



 On Thursday, November 28, 2013 7:28:53 PM UTC+11, Tim Richardson wrote:

 I confirm error reported by Martin above: I get it via the scheduler:

 URL/accpac_web_orders/default/monitor_jobs/view/scheduler_run/586 
 Traceback (most recent call last): File d:\web2py2x\gluon\scheduler.py, 
 line 218, in executor _env = env(a=a, c=c, import_models=True) File 
 d:\web2py2x\gluon\shell.py, line 134, in env ip = 
 global_settings.cmd_options.ip AttributeError: 'NoneType' object has no 
 attribute 'ip' 

 On Thursday, November 28, 2013 7:31:05 AM UTC+11, Massimo Di Pierro wrote:

 Changelog


 - no more winservice (use nssm instead)
 - better imap support in DAL
 - db().select().as_tree()
 - bootstrap 2.3.2
 - codemirror 3.19
 - virtual fields in grid
 - improved  mongoDB support, thanks Alan
 - support for wiki custom render function
 - Wiki(...groups=['x','y']) allows bypassing default permissions
 - fixed websocket_messaging.py to support newer Tornado
 - NDB support for GAE, thanks Quint
 - fixed major concurrecy issue with MEMDB
 - blocked generic.jsonp for security reasons
 - many bug fixes, thanks Niphlod, Michele, Anthony, Tim, and many others.



-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Globals.py Bad Request

2013-11-28 Thread Massimo Di Pierro
I think your action is missing a return value:

@auth.requires_membership(secretaria)
def turmas():
campos = [db.alunos.id,db.alunos.nome,db.alunos.nome_responsavel,db.
alunos.serie_turma]
form = SQLFORM.grid(db.alunos,fields=campos,deletable=False,orderby=
alunos.nome)
return dict(form=form)

I am not sure whether this is causing your problem. Something else may be 
going on.


On Thursday, 28 November 2013 14:55:50 UTC-6, Leonardo Pires Felix wrote:

 Sorry for my english.
 Hi there, i've this simple sqlform.grid:
 @auth.requires_membership(secretaria)
 def turmas():
 campos = [db.alunos.id,db.alunos.nome,db.alunos.nome_responsavel,db.
 alunos.serie_turma]
 form = SQLFORM.grid(db.alunos,fields=campos,deletable=False,orderby=
 alunos.nome)

 I've used the pc on the school to try to update one field of the row, It 
 raises the error. Add a row give me the same error. 
 When i came home and used my personal pc everything went smooth.

 The error wasn't tracked by the web2py, only the apache error log.
 Error stack:

 [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] Traceback (most 
 recent call last):
 [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10]   File 
 /home/leonardo/homes/web2py/gluon/main.py, line 532, in wsgibase
 [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] if request.body:
 [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10]   File 
 /home/leonardo/homes/web2py/gluon/globals.py, line 252, in body
 [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] raise HTTP(400, 
 Bad Request - HTTP body is incomplete)
 [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] HTTP: 400 BAD 
 REQUEST


 I want to know if, it is a browser/system problem on the request, or 
 something else. I didn't found any glue about this.
 On the school, i've tried to use both chrome and IE 7 or . The OS is 
 windows xp.
 On my home, everything worked, I'm using win 7 with both ie 11 and firefox 
 25. And Debian 7 with iceweasel and chromium.



-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Creating a navigation bar

2013-11-28 Thread Massimo Di Pierro
You appear to be calling the action with .xml but the data returned by the 
action is not serializable in xml.



On Thursday, 28 November 2013 17:19:24 UTC-6, isi_jca wrote:

 Hi!!!

 I visited of the following link:


 http://my.safaribooksonline.com/book/programming/python/9781849515467/building-your-first-application/ch02lvl1sec33http://www.google.com/url?q=http%3A%2F%2Fmy.safaribooksonline.com%2Fbook%2Fprogramming%2Fpython%2F9781849515467%2Fbuilding-your-first-application%2Fch02lvl1sec33sa=Dsntz=1usg=AFQjCNEI3WHjPLyUU3QDuQxdP0KMc1CtOw

 and  I follow the instructions step by step, but when I try to run 
 application I get an error. What is the problem? Thanks in advance.

 PD: Sorry for my English.


-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.