Re: [web2py] Re: web2py dal week query

2014-03-14 Thread 黄祥
a, i c, thank you so much for your hints, michele.

best regards,
stifan

On Friday, March 14, 2014 6:41:11 AM UTC+7, Michele Comitini wrote:

 From postgresql manual: 

 http://www.postgresql.org/docs/current/static/functions-datetime.html 


 SELECT EXTRACT(WEEK FROM TIMESTAMP '2001-02-16 20:38:40'); 

 Not supported by DAL expressions, but you can use executesql... 

 2014-03-14 0:26 GMT+01:00 黄祥 steve.van...@gmail.com javascript:: 
  actually i wan to create a chart from that query : 
  e.g. for year and month is work this way 
  views/default/index.html 
  {{sum_sale_order = db.sale_order_header.total.sum() }} 
  {{query_yearly_sale_order = (db.sale_order_header.sale_order_date.year() 
 == 
  request.now.year) }} 
  {{sum_yearly_sale_order = 
  
 db(query_yearly_sale_order).select(sum_sale_order).first()[sum_sale_order] 
  if db(query_yearly_sale_order).select() else 0}} 
  
  but when it goes to week, it return and error. and pardon, i don't think 
  this is related with database engine, because in php it can be achieved. 
  e.g. OpenCart 
  
  doing some test that work is : 
  {{import datetime}} 
  {{=datetime.date.today().isocalendar()[1]}} 
  {{=request.now.isocalendar()[1]}} 
  
  all return the same week number : 11 
  
  but i can't get it work when i passed the datetime field value into week 
 to 
  compare with the value above. 
  
  best regards, 
  stifan 
  
  -- 
  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/d/optout. 


-- 
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/d/optout.


[web2py] Creating report from diffrent tables

2014-03-14 Thread Raj
Hi Web2py user

I want to create report on Employee.I have three tables holiday list, login 
details and  employe leave. I want to create report in such way so i can 
see employe name, total number of day in current month, total no of 
present, total number of holiday i current month and total number of leave 
emps have taken(vacation leave, medical and casual leave.

can any one help me in this  

Model
db.define_table('holiday_list',
Field('holiday_date','date',requires=IS_NOT_EMPTY(error_message='Please 
enter the Holiday date')),
Field('holiday_name',requires=IS_NOT_EMPTY(error_message='Please enter the 
Holiday Name')),
Field('remarks','text'))
 db.define_table('employee_login_detail',
Field('employee_code'),
Field('employee_email'),
Field('employee_name'),
Field('employee_login_date','date'),
Field('employee_login_time'),
Field('ip_address'))
 db.define_table('employee_leave',
Field('employee_code'),
Field('email'),
Field('taken_vacation_leave','integer'),
Field('taken_medical_leave','integer'),
Field('taken_casual_leave','integer'),
Field('left_vacation_leave','integer'),
Field('left_medical_leave','integer'),
Field('left_casual_leave','integer'))
 controller part
def admin_newholiday():
db.holiday_list.id.readable=False
form=SQLFORM.grid(db.holiday_list, selectable = lambda ids: del_hlist(ids))
return dict(form=form)
def admin_attendance():
db.employee_login_detail.id.readable=False
form=SQLFORM.grid(db.employee_login_detail, selectable = lambda ids: 
del_att(ids))
return dict(form=form)
def employee_leave():
db.employee_leave.id.readable=False
grid = SQLFORM.grid(db.employee_leave, csv=False, deletable=False, 
editable=False, searchable=True, 
showbuttontext=False,create=False,paginate=15)
 return dict(form=grid)

-- 
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/d/optout.


[web2py] Re: Creating report from diffrent tables

2014-03-14 Thread 黄祥
for total number, i think you can achieve it with sum query in dal.

ref :
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#sum--avg--min--max-and-len

best regards,
stifan

-- 
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/d/optout.


Re: [web2py] Re: GAE deployment problem with gluon.settings

2014-03-14 Thread Francisco García Claramonte
Hello Massimo,

2014-03-13 14:41 GMT+01:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 I made a change in trunk about this. Can you please check it?


Thank you for your fast answer and patch.
I'll test it in next days and I'll tell to the list.

Thank you for your work. ;)
Regards,
Francisco



 On Thursday, 13 March 2014 06:56:32 UTC-5, Francisco García wrote:


 Hello all,

 I am trying to upload a Web2py application to GAE, as I use to do with
 other web2py apps (without problems).

 I find the following error in GAE logs:

 type 'exceptions.AttributeError': 'module' object has no attribute
 'settings'
 Traceback (most recent call last):
   File /base/data/home/apps/s~proy1/1.374388951966188608/gaehandler.py,
 line 47, in module
 from gluon.settings import global_settings
   File
 /base/data/home/apps/s~proy1/1.374388951966188608/gluon/__init__.py, line
 15, in module
 from globals import current
   File
 /base/data/home/apps/s~proy1/1.374388951966188608/gluon/globals.py, line
 24, in module
 from gluon.serializers import json, custom_json
   File
 /base/data/home/apps/s~proy1/1.374388951966188608/gluon/serializers.py,
 line 10, in module
 from gluon.languages import lazyT
   File
 /base/data/home/apps/s~proy1/1.374388951966188608/gluon/languages.py, line
 30, in module
 import gluon.settings as settings

 It looks like a circular error. I can't fix it.
 I tried to upload it with Web2py-2.9.4.

 Have you got some idea about the problem?.
 Thank you in advance for your support.

 Regards,
 Francisco


 --
 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/xZ55VKMwnS0/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/d/optout.



-- 
Francisco M. García Claramonte
Debian GNU/Linux Developer   franci...@debian.org
GPG: public key ID 556ABA51
http://people.debian.org/~francisco/
http://garciac.es - franci...@garciac.es

-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread Leonel Câmara
If you have a performance issue why haven't you used a profiler yet? No one 
is going to guess it,

web2py.py -F foldername

Then use something like runsnakerun or pstats.

-- 
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/d/optout.


[web2py] Re: Creating report from diffrent tables

2014-03-14 Thread Raj
Thanks Stifan

can u give some example. i have gone trow that, but i am not getting result 


On Friday, 14 March 2014 17:31:33 UTC+5:30, 黄祥 wrote:

 for total number, i think you can achieve it with sum query in dal.

 ref :

 http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#sum--avg--min--max-and-len

 best regards,
 stifan


-- 
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/d/optout.


[web2py] Re: Creating report from diffrent tables

2014-03-14 Thread 黄祥
pardon me, is your table definition is right?
e.g.
db.define_table('employee_login_detail',
Field('employee_code'),
Field('employee_email'),
Field('employee_name'),
Field('employee_login_date','date'),
Field('employee_login_time'),
Field('ip_address'))
db.define_table('employee_leave',
* Field('employee_code', 'reference employee_login_detail'),*
Field('email'),
Field('taken_vacation_leave','integer'),
Field('taken_medical_leave','integer'),
Field('taken_casual_leave','integer'),
Field('left_vacation_leave','integer'),
Field('left_medical_leave','integer'),
Field('left_casual_leave','integer'))

just a suggestion, i think if you want to have the join table, you should 
have at least 1 fk field that reference to another table. after your table 
definition is all integrated, then you can start focus on the query logic.

best regards,
stifan

-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
I conducted a simple experiment. I took the Welcome app, surely the 
simplest you can have (no databases, no concurrency, etc.), and added the 
following to the index page:

def test():
start = time.time()
x = 0.0
for i in range(1,5000):
x += (float(i+10)*(i+25)+175.0)/3.14
debug(elapsed time: +str(time.time()-start))
return

I get an elapsed time of 0.103 seconds.

The same exact code in a command line program...

if __name__ == '__main__':
test()

gives an elapsed time of 0.003 seconds. *That's 35 times faster!* It's not 
the 2 orders of magnitude I'm seeing in the pyShipping code, but my point 
is proven. There is something hinky about web2py that makes Python code 
execute much more slowly. Is web2py using a different Python version? As 
far as I can tell, I only have Python 2.6.5 installed on my Linux server.


On Friday, 14 March 2014 08:17:00 UTC-4, Leonel Câmara wrote:

 If you have a performance issue why haven't you used a profiler yet? No 
 one is going to guess it,

 web2py.py -F foldername

 Then use something like runsnakerun or pstats.


-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 6:28 AM, horridohobbyist horrido.hobb...@gmail.com wrote:
 I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page:
 
 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return
 
 I get an elapsed time of 0.103 seconds.
 
 The same exact code in a command line program...
 
 if __name__ == '__main__':
 test()
 
 gives an elapsed time of 0.003 seconds. That's 35 times faster! It's not the 
 2 orders of magnitude I'm seeing in the pyShipping code, but my point is 
 proven. There is something hinky about web2py that makes Python code execute 
 much more slowly. Is web2py using a different Python version? As far as I can 
 tell, I only have Python 2.6.5 installed on my Linux server.
 

Easy enough to find out: print sys.version.

-- 
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/d/optout.


[web2py] Re: Verbatim Tag

2014-03-14 Thread Massimo Di Pierro
{{data.message +  world!}}

should be

{{= data.message +  world!}}

On Thursday, 13 March 2014 17:21:28 UTC-5, David Simmons wrote:

 Hi All (again).

 I did some digging around with the web2py source code and came up with 
 this.

 https://gist.github.com/shortly-portly/9538005

 The usage is pretty straight forward. You can use normal Web2py tags {{ 
 and }}. When you want to drop down into Angular, surround your stuff with 
 {{ verbatim }} and {{ endverbatim }}. For example

 {{ extend 'layout.html }} - translated by web2py as normal

 {{ verbatim }}
 div ng-app=
 input type=text ng-model=data.message
 h1{{data.message +  world!}}/h1--- not touched by 
 web2py
 /div

 {{ endverbatim }}

 Could someone who knows more about the web2py source code let me know if 
 this looks like a valid change. I'd love to be able to submit it.

 cheers

 Dave



-- 
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/d/optout.


[web2py] Re: Admin and tickets broken after upgrade to 2.9.4

2014-03-14 Thread Massimo Di Pierro
I cannot say. There is some file in there that does not get overwritten 
when you unzip it.

On Thursday, 13 March 2014 17:42:09 UTC-5, shapova...@gmail.com wrote:

 Your suggestion just did the trick. But now I'm curious - what was the 
 problem then??

 On Friday, March 14, 2014 12:14:11 AM UTC+2, Massimo Di Pierro wrote:

 Another user has reported a similar problem on google app engine and it 
 was due to a circular reference. Strangely I could not reproduce it. 
 Anyway, it is fixed.

 My suggestion is try unzip in a different (new) folder and check if it 
 works.



 On Thursday, 13 March 2014 16:55:10 UTC-5, shapova...@gmail.com wrote:

 Thanks, just did it, unzipped 
 http://www.web2py.com/examples/static/web2py_src.zip on top of web2py 
 old install, now it says:

 [Thu Mar 13 23:49:54 2014] [error] [client ] from sqlhtml import 
 SQLFORM, SQLTABLE
 [Thu Mar 13 23:49:54 2014] [error] [client ]   File 
 /home/www-data/web2py/gluon/gluon/sqlhtml.py, line 35, in module
 [Thu Mar 13 23:49:54 2014] [error] [client ] from gluon.globals 
 import current
 [Thu Mar 13 23:49:54 2014] [error] [client ] ImportError: cannot import 
 name current

  in apache error.log

 Permissions for www dir look OK.

 it it only me with this kind of problems?


 On Tuesday, March 11, 2014 3:39:55 AM UTC+2, Massimo Di Pierro wrote:

 It is there:
 https://github.com/web2py/web2py/blob/master/gluon/myregex.py#L24

 something broke during your upgrade. Perhaps web2py did not have 
 permission to overwrite the files.
 Download the latest web2py and unzip over the existing one. (make a 
 backup first).

 On Monday, 10 March 2014 19:11:08 UTC-5, shapova...@gmail.com wrote:

 Thanks form prompt reply! 

 Upgrade from previous 2.9.3, 

 Just did 
 #apachectl restart

 and now it complains on wsgihandler.py 

 [Tue Mar 11 02:07:03 2014] [notice] Apache/2.2.16 (Debian) 
 PHP/5.3.3-7+squeeze18 with Suhosin-Patch mod_ssl/2.2.16 OpenSSL/0.9.8o 
 mod_wsgi/3.3 Python/2.6.6 configured -- resuming normal operations
 [Tue Mar 11 02:07:12 2014] [error] [client ] mod_wsgi (pid=1277): 
 Target WSGI script '/home/www-data/web2py/wsgihandler.py' cannot be 
 loaded 
 as Python module.
 [Tue Mar 11 02:07:12 2014] [error] [client ] mod_wsgi (pid=1277): 
 Exception occurred processing WSGI script 
 '/home/www-data/web2py/wsgihandler.py'.
 [Tue Mar 11 02:07:12 2014] [error] [client ] Traceback (most recent 
 call last):
 [Tue Mar 11 02:07:12 2014] [error] [client ]   File 
 /home/www-data/web2py/wsgihandler.py, line 37, in module
 [Tue Mar 11 02:07:12 2014] [error] [client ] import gluon.main
 [Tue Mar 11 02:07:12 2014] [error] [client ]   File 
 /home/www-data/web2py/gluon/__init__.py, line 21, in module
 [Tue Mar 11 02:07:12 2014] [error] [client ] from compileapp 
 import LOAD
 [Tue Mar 11 02:07:12 2014] [error] [client ]   File 
 /home/www-data/web2py/gluon/compileapp.py, line 26, in module
 [Tue Mar 11 02:07:12 2014] [error] [client ] from gluon.myregex 
 import regex_expose, regex_longcomments
 [Tue Mar 11 02:07:12 2014] [error] [client ] ImportError: cannot 
 import name regex_longcomments




 On Tuesday, March 11, 2014 2:04:15 AM UTC+2, Massimo Di Pierro wrote:

 What did you upgrade from? You may have to restart web2py.

 On Monday, 10 March 2014 19:02:55 UTC-5, shapova...@gmail.com wrote:

 Just hit upgrade now to Version 2.9.4 button and in 
 web2py/applications/admin/errors:

 sssg317
 S'Traceback (most recent call last):\n  File 
 /home/www-data/web2py/gluon/restricted.py, line 217, in restricted\n  
  
  exec ccode in environment\n  File 
 /home/www-data/web2py/applications/admin/controllers/default.py, line 
 16, 
 in module\nfrom gluon.compileapp import 
 find_exposed_functions\nImportError: cannot import name 
 find_exposed_functions\n'
 p553


 Any ideas?



-- 
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/d/optout.


[web2py] Fashion Marketplace in Web2py - Feedback needed

2014-03-14 Thread Francisco Costa
Hi there,

Just wanted to get some feedback form the web2py community about this new 
project:

*CHIQUE* https://chique.pt/?lang=en is a mobile fashion marketplace built 
around real-time social experiences.
Our vibrant community brings fashion lovers together to share their 
individual style, turning every closet into a unique shopping experience.
Founded in 2014, we are headquartered at Porto, Portugal

Thanks,
Francisco Costa

-- 
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/d/optout.


[web2py] Re: Problems - Changes on SQLTABLE? Upgraded to 2.9.4-stable

2014-03-14 Thread Massimo Di Pierro
Can you please download and try trunk? It should be fixed there.

On Thursday, 13 March 2014 20:23:09 UTC-5, drayco wrote:

 We use extensive SQLTABLE and in this moment we have a lot of errors 
 similar to

 File /home/drayco/web2py/gluon/sqlhtml.py, line 2929, in __init__
 columns = 
 ['.'.join(sqlrows.db._adapter.REGEX_TABLE_DOT_FIELD.match(c).groups()) for c 
 in sqlrows.colnames]
 AttributeError: 'NoneType' object has no attribute 'groups'

 All code work with web2py 2.8.3 but when we upgrade to web2py 2.9.4, 
 This is our code
 totalPagos = 
 SQLTABLE(db((db.pagos.created_oninicio)(db.pagos.created_onfin)).\
   select(db.pagos.id.count()), headers={'COUNT(
 pagos.id)':'Total Pagos'})
 We are in the similar situation

 El jueves, 13 de marzo de 2014 09:49:01 UTC-6, Fcosqui escribió:

 Hi !

 I have 2.9.4-stable version on my Server1 and 2.8.2-stable version on my 
 Server2. 

 the same Application and query on Server1 and Server2:

 rows = SQLTABLE(db(db.info).select(db.info.name, db.info.number.count(), 
 orderby=db.info.number, groupby=db.info.number))

 Server2 : Correct answer

 Server1 : type 'exceptions.AttributeError' 'NoneType' object has no 
 attribute 'groups'


 ¿¿??.



-- 
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/d/optout.


[web2py] Re: Appadmin on 2.9.4

2014-03-14 Thread Massimo Di Pierro
Anybody else experiencing this?

On Friday, 14 March 2014 06:39:08 UTC-5, SimonD wrote:

 Hello, I have seen a previous post on an apparently broken Admin screen, 
 but I think this is a different issue (or just a noobie question).
 I have done my app development on 2.3.2 (on Ubuntu 10.04 LTS).
 I have setup a new local server (test production) on my LAN, with a 
 clean/fresh install of Ubuntu 12.04 LTS. I downloaded 2.9.4 and used the 
 'setup-web2py-ubuntu.sh' script for Apache2. I copied my app over (it is 
 still using SQLite for now), and updated web2py.js, appadmin.py and 
 appadmin.htms as per the release notes. My actual web-application seems to 
 work fine on the server.

 But, from my 10.04 machine, when I access the 12.04 server's appadmin 
 (over the LAN) via SSL, the layout/design of the screens is lost. See the 
 example screenshot. The admin login, installed applications, and edit 
 screens are broken.
 Although not consistently, this also breaks the appadmin on my local 10.04 
 machine. Clearing history/cache etc etc in Firefox usually corrects the 
 issue.

 However, I has also upgraded my 10.04LTS development environment to 2.9.4 
 and although the app admin screens were not broken in the same way, the 
 Manage buttons were not working (i.e. the dropdown edit, about, etc 
 options  don't show). Again usually clearing the firefox history/cache 
 corrects that. But restarts were required on 2 occasions. OK, its not a 
 biggie, but there is something underlying that is worrying.

 For now, I have reverted to 2.3.2 (on 10.04 LTS) to continue development 
 (although I prefer  the newer appadmin environment).

 Actually, I don't intend to use Appadmin on the production server (as per 
 the recommendations). My concern is that the appears to be an HTML, CSS, 
 Boostrap or JS issue around 2.9.4 - and am concerned it might impact the 
 production server for users.
 I am afraid I don't have the depth of expertise to nail it, so am looking 
 for pointers, please.

 As a side note, I saw a similar loss of appadmin layout when using 
 pythonanywhere about 9 months ago, so I am guessing (hoping) this is a 
 known gotcha.

 Any ideas on what is causing these appadmin layout issue?

 BTW - I have firefox 20.0
 Many thanks, as always.






-- 
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/d/optout.


Re: [web2py] Re: login_next and next var

2014-03-14 Thread Trevor Strauss
Hi Annet, I'm somewhat new...can you explain how you ended up getting this 
to work?  I am encountering same issue with login button I've created for 
jqm layout.  Thanks,Trevor

On Wednesday, 5 February 2014 07:56:59 UTC-5, Annet wrote:

 Hi Jonathan,

 Thanks for your reply.

 It's a URL; it's just %-escaped because it's in a query string (vars).


  You're right, redirect(request.vars._next) does work.


 Kind regards,

 Annet


-- 
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/d/optout.


[web2py] Re: Problem with web2py on Heroku

2014-03-14 Thread Chris DeGroot


I think I may have made sense of the error above.  Based on the code below, 
DatabaseStoredFile.web2py_filesystem is set to true even if the table 
creation fails (which it does), as I don't think the error will be caught 
before it gets to that line.  A few lines later, it tries to access that 
table, causing the error logged by Heroku.  Therefore, the key error seems 
to be that the creation of the web2py_filesystem table is failing.


if not self.web2py_filesystem:

if db._adapter.dbengine == 'mysql':

sql = CREATE TABLE IF NOT EXISTS web2py_filesystem (path 
VARCHAR(255), content LONGTEXT, PRIMARY KEY(path) ) ENGINE=InnoDB;

elif db._adapter.dbengine in ('postgres', 'sqlite'):

sql = CREATE TABLE IF NOT EXISTS web2py_filesystem (path 
VARCHAR(255), content TEXT, PRIMARY KEY(path));

self.db.executesql(sql)

DatabaseStoredFile.web2py_filesystem = True


On Thursday, March 13, 2014 11:40:59 AM UTC-4, Chris DeGroot wrote:

 I am looking again at the Heroku logs, specifically the line

 ERROR:web2py.dal:Could not retrieve applications/CaeSuite/databases/
 9e6a7c1bb77d791a89631de258057aed_web2py_session_CaeSuite.table

 Why is it looking for a file in */databases? 

 Chris

 On Thursday, March 13, 2014 10:14:32 AM UTC-4, Massimo Di Pierro wrote:

 Is this is a problem that worked before and then stopped working? Have 
 you changed anything on the database side? Do you have data that you need 
 to recovered.

 If at all an option, try delete the database and make a new one. 

 Somehow there is a problem with the web2py_filesystem table where web2py 
 stores metadata on platforms that lack a persistent filesystem. This an be 
 recovered but it is complicated to explain without direct access to the 
 system. It really depends on how it got there and what is in there.

 Massimo


 On Wednesday, 12 March 2014 17:53:08 UTC-5, Chris DeGroot wrote:

 Hello;

 I have tried everything I could think of to solve this problem, but I 
 just can't find a solution.  I am trying to deploy my application to 
 Heroku, following the instructions in the web2py manual.  The welcome app 
 works fine, so I think generally I have deployed the app properly.  The 
 application works on my local machine.  The error I am getting looks like 
 this:

 Traceback (most recent call last):
   File /app/web2py/gluon/restricted.py, line 217, in restricted
 exec ccode in environment
   File /app/web2py/applications/CaeSuite/models/db.py 
 https://warm-basin-8163.herokuapp.com/admin/default/edit/CaeSuite/models/db.py,
  line 16, in module
 db = get_db(name=None, pool_size=10)
   File /app/web2py/gluon/contrib/heroku.py, line 26, in get_db
 current.session.connect(current.request, current.response, db=db)
   File /app/web2py/gluon/globals.py, line 869, in connect
 migrate=table_migrate,
   File /app/web2py/gluon/dal.py, line 8223, in define_table
 table = self.lazy_define_table(tablename,*fields,**args)
   File /app/web2py/gluon/dal.py, line 8260, in lazy_define_table
 polymodel=polymodel)
   File /app/web2py/gluon/dal.py, line 1102, in create_table
 query), table)
   File /app/web2py/gluon/dal.py, line 850, in log
 logfile = self.file_open(table._loggername, 'a')
   File /app/web2py/gluon/dal.py, line 4578, in file_open
 return DatabaseStoredFile(self.db,filename,mode)
   File /app/web2py/gluon/dal.py, line 4506, in __init__
 self.db.executesql(sql)
   File /app/web2py/gluon/dal.py, line 8433, in executesql
 adapter.execute(query)
   File /app/web2py/gluon/dal.py, line 1969, in execute
 return self.log_execute(*a, **b)
   File /app/web2py/gluon/dal.py, line 1963, in log_execute
 ret = self.cursor.execute(command, *a[1:], **b)
 InternalError: current transaction is aborted, commands ignored until end 
 of transaction block

 Variablesself.cursor.executebuilt-in method execute of 
 psycopg2._psycopg.cursor 
 objectselfgluon.contrib.heroku.HerokuPostgresAdapter 
 objectself.cursorcursor object at 0x287a338; closed: 0b{}a('CREATE TABLE 
 IF NOT EXISTS web2py_filesystem (path VARCHAR(255), content TEXT, PRIMARY 
 KEY(path));',)retundefinedcommand'CREATE TABLE IF NOT EXISTS 
 web2py_filesystem (path VARCHAR(255), content TEXT, PRIMARY KEY(path));'


 I would really appreciate any help!!  Thanks,


 Chris



-- 
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/d/optout.


Re: [web2py] Re: login_next and next var

2014-03-14 Thread Trevor Strauss
Hi Jonathan, I've been banging my head on this all day, how do I get _next 
 to work?

On Tuesday, 4 February 2014 13:49:50 UTC-5, Jonathan Lundell wrote:

 On 4 Feb 2014, at 10:32 AM, Annet anne...@googlemail.com javascript: 
 wrote:

 Notice extra ' before 'URL


 When I remove the ' '  around the URL

  a class=btn btn-default onclick=javascript:openwindow('{{=URL('cms', 
 'default', 'user', args=['login', request.args(0)], 
 vars=dict(_next=URL('cms', 'group', 'connect', args=request.args(0}}', 
 'connect') role=buttonLogin/a

 The button is rendered the following way:

 a class=btn btn-default role=button 
 onclick=javascript:openwindow('/cms/'default/user/login/4?_next=%2Fcms%2Fgroup%2Fconnect%2F4',
  
 'connect') Login/a

 The first =URL converted to a url the second =URL is not.

 Is what I want not possible?


 It's a URL; it's just %-escaped because it's in a query string (vars).


-- 
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/d/optout.


[web2py] http 400 error after change urls

2014-03-14 Thread Relsi Maron

Hi,

This happening an unusual thing here, after I changed my urls, I am getting 
many http 400 errors.
I've rebooted the routes, already rebooted the server, and the errors are 
still happening. Sometimes you can access the url, and sometimes receive 
error 400. And sometimes it no rewrite the route, and shoue the real route.

I use patterns routes, and one of my routes, before the error was, is:

/init/jobs/job/$the_id/$the_slug

to:

/jobs/ver-job/$the_id/$the_slug

And I change to:

/vagas/ver-vagas/$the_id/$the_slug

And the errors start. And this is happening only with these urls I changed, 
all that I change of /jobs/anythings to /vagas/anythings.

eg. 
https://codefreelas.com/vagas/ver-vaga/209/desenvolvedor-web-conhecimento-wordpress-e-magento

Sometimes work, sometimes get a 400 error, and sometimes it show 
https://codefreelas.com/init/jobs/job/209/desenvolvedor-web-conhecimento-wordpress-e-magentohttps://codefreelas.com/vagas/ver-vaga/209/desenvolvedor-web-conhecimento-wordpress-e-magento
.

I use Nginx.

Thanks for any 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/d/optout.


[web2py] Accepting custom form without saving

2014-03-14 Thread Martin
Hi all,
Please could anyone tell me how to accept a *custom SQLFORM* without 
inserting to db, since 

if form.process().accepted: seems to be perform insertion directly.

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/d/optout.


[web2py] Re: Problems - Changes on SQLTABLE? Upgraded to 2.9.4-stable

2014-03-14 Thread Fcosqui


Traceback (most recent call last):
  File /var/web2py/gluon/restricted.py, line 217, in restricted
exec ccode in environment
  File /var/web2py/applications/site/controllers/default.py, line 89, in 
module
  File /var/web2py/gluon/globals.py, line 385, in lambda
self._caller = lambda f: f()
  File /var/web2py/applications/site/controllers/default.py, line 38, in 
statistic
rows = SQLTABLE(db(db.info).select(db.info.number, db.info.number.count(), 
orderby=db.info.number, groupby=db.info.number))
  File /var/web2py/gluon/sqlhtml.py, line 2929, in __init__
columns = 
['.'.join(sqlrows.db._adapter.REGEX_TABLE_DOT_FIELD.match(c).groups()) for c in 
sqlrows.colnames]
AttributeError: 'NoneType' object has no attribute 'groups'


Variablesc'COUNT(info.number)'sqlrows.dbDAL 
uri=postgres:**@localhost/site).groupsundefinedsqlrows.colnames['info.number',
 
'COUNT(info.number)']sqlrows.db._adapter.REGEX_TABLE_DOT_FIELD_sre.SRE_Pattern 
object'.'.joinundefinedsqlrows.db._adaptergluon.dal.PostgreSQLAdapter 
objectsqlrows.db._adapter.REGEX_TABLE_DOT_FIELD.matchbuilt-in method 
match of _sre.SRE_Pattern objectsqlrowsRows (62)columnsNone
El jueves, 13 de marzo de 2014 12:49:01 UTC-3, Fcosqui escribió:

 Hi !

 I have 2.9.4-stable version on my Server1 and 2.8.2-stable version on my 
 Server2. 

 the same Application and query on Server1 and Server2:

 rows = SQLTABLE(db(db.info).select(db.info.name, 
 db.registros_chile.number.count(), orderby=db.info.number, 
 groupby=db.info.number))

 Server2 : Correct answer

 Server1 : type 'exceptions.AttributeError' 'NoneType' object has no 
 attribute 'groups'


 ¿¿??.


-- 
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/d/optout.


[web2py] Re: Problems - Changes on SQLTABLE? Upgraded to 2.9.4-stable

2014-03-14 Thread Fcosqui


Traceback (most recent call last):
  File /var/web2py/gluon/restricted.py, line 217, in restricted
exec ccode in environment
  File /var/web2py/applications/site/controllers/default.py, line 89, in 
module
  File /var/web2py/gluon/globals.py, line 385, in lambda
self._caller = lambda f: f()
  File /var/web2py/applications/site/controllers/default.py, line 38, in 
statistic
rows = SQLTABLE(db(db.info).select(db.info.number, db.info.number.count(), 
groupby=db.info.number))
  File /var/web2py/gluon/sqlhtml.py, line 2929, in __init__
columns = 
['.'.join(sqlrows.db._adapter.REGEX_TABLE_DOT_FIELD.match(c).groups()) for c in 
sqlrows.colnames]
AttributeError: 'NoneType' object has no attribute 'groups'



Variablesc'COUNT(info.number)'sqlrows.dbDAL 
uri=postgres:**@localhost/site).groupsundefinedsqlrows.colnames['info.number',
 
'COUNT(info.number)']sqlrows.db._adapter.REGEX_TABLE_DOT_FIELD_sre.SRE_Pattern 
object'.'.joinundefinedsqlrows.db._adaptergluon.dal.PostgreSQLAdapter 
objectsqlrows.db._adapter.REGEX_TABLE_DOT_FIELD.matchbuilt-in method 
match of _sre.SRE_Pattern objectsqlrowsRows (62)columnsNone
El jueves, 13 de marzo de 2014 12:53:48 UTC-3, Massimo Di Pierro escribió:

 Do you have a longer traceback?


 On Thursday, 13 March 2014 10:49:01 UTC-5, Fcosqui wrote:

 Hi !

 I have 2.9.4-stable version on my Server1 and 2.8.2-stable version on my 
 Server2. 

 the same Application and query on Server1 and Server2:

 rows = SQLTABLE(db(db.info).select(db.info.name, 
 db.registros_chile.number.count(), orderby=db.info.number, 
 groupby=db.info.number))

 Server2 : Correct answer

 Server1 : type 'exceptions.AttributeError' 'NoneType' object has no 
 attribute 'groups'


 ¿¿??.



-- 
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/d/optout.


Re: [web2py] Re: CAS provider and registration

2014-03-14 Thread ureal frank


On Sunday, February 16, 2014 5:10:16 PM UTC, Massimo Di Pierro wrote:

 I am open to change this. Do you want to attempt a patch to address some 
 of the issues?


Any news regarding this issue? I've tested it today with 2.9.4 and the 
behaviour is the same. it would be awesome to have this 'fixed'.
 


 Massimo



 On Sunday, 16 February 2014 05:39:31 UTC-6, Alexei Vinidiktov wrote:

 The first issue is that the client app that uses a cas provider only 
 provides one option: to log in - in the top navigation bar. I think some 
 users would be at a loss as to how to register since there is no explicit 
 link.

 The second and third issues are with the cas provider login page. After 
 the user follows the login link in the cas client app what they see in the 
 cas provider app is the navigation bar that has a drop down menu that says 
 Login. And they see two fields for entering their email and password and 
 a single login button. 

 So the second issue is that coming from the cas client page they can 
 wrongly assume that the login drop down menu in the navigation bar of the 
 cas provider app can only log them in (not register). 

 A work around would be to use the default mode for the auth links in the 
 nav bar which will show all the links (login, registration, lost password) 
 on the nav bar (instead of a drop down). 

 The third issue is with the single login button on the cas provider app. 
 For consistency with the normal (not cas) login pages I think that instead 
 of showing only one login button it would be more user-friendly if the 
 login page in the cas provider displayed the same buttons underneath the 
 email and password boxes - the login, register and lost password button - 
 as the normal login page does.

 The fourth issue is that if the user is not registered and thus goes from 
 the client app to the cas login page and from there to the cas registration 
 page, after a successful registration they are not redirected to the cas 
 client app. I think many users would not know how to return to the cas 
 client app after the registration.


 On Sun, Feb 16, 2014 at 2:34 PM, Tim Richardson 
 t...@growthpath.com.auwrote:

 As long as you allow users to register in your auth settings (and by 
 default they can), there is a register option on the login menu of the cas 
 screen. 
 This is based on trunk.

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




 -- 
 Alexei Vinidiktov 



-- 
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/d/optout.


[web2py] Custom fill with SQLFORM not saving. Web2py version 2.8.2

2014-03-14 Thread Martin
Hi all,


   ...if FORM.accepts(form,request.vars): ..
not working for custom form, please may i know if i'am missing something...
Thanks!

def page1(): 
   form=SQLFORM(db.a_table) 
   if FORM.accepts(form,request.
vars): 
session.vars=form.vars 
redirect(URL(r=request,f='confirm')) 
   return dict(form=form) 

.


-- 
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/d/optout.


[web2py] Re: Accepting custom form without saving

2014-03-14 Thread Massimo Di Pierro


form.process(dbio=False).accepted


On Thursday, 13 March 2014 14:28:03 UTC-5, Martin wrote:

 Hi all,
 Please could anyone tell me how to accept a *custom SQLFORM* without 
 inserting to db, since 

 if form.process().accepted: seems to be perform insertion directly.

 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/d/optout.


[web2py] Re: Custom fill with SQLFORM not saving. Web2py version 2.8.2

2014-03-14 Thread Massimo Di Pierro
This was never the correct syntax. You are passing a SQLFORM objected to a 
FORM method.

 if FORM.accepts(form,request.vars): 

should be

 if form.process().accepted: 

On Thursday, 13 March 2014 14:00:24 UTC-5, Martin wrote:

 Hi all,


...if FORM.accepts(form,request.vars): ..
 not working for custom form, please may i know if i'am missing something...
 Thanks!

 def page1(): 
form=SQLFORM(db.a_table) 
if FORM.accepts(form,request.
 vars): 
 session.vars=form.vars 
 redirect(URL(r=request,f='confirm')) 
return dict(form=form) 

 .




-- 
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/d/optout.


[web2py] Re: Appadmin on 2.9.4

2014-03-14 Thread shapovalovdenis
I remember see something on previous version, IIRC the thing was in 
apache's vhost config.

On Friday, March 14, 2014 4:27:04 PM UTC+2, Massimo Di Pierro wrote:

 Anybody else experiencing this?

 On Friday, 14 March 2014 06:39:08 UTC-5, SimonD wrote:

 Hello, I have seen a previous post on an apparently broken Admin screen, 
 but I think this is a different issue (or just a noobie question).
 I have done my app development on 2.3.2 (on Ubuntu 10.04 LTS).
 I have setup a new local server (test production) on my LAN, with a 
 clean/fresh install of Ubuntu 12.04 LTS. I downloaded 2.9.4 and used the 
 'setup-web2py-ubuntu.sh' script for Apache2. I copied my app over (it is 
 still using SQLite for now), and updated web2py.js, appadmin.py and 
 appadmin.htms as per the release notes. My actual web-application seems to 
 work fine on the server.

 But, from my 10.04 machine, when I access the 12.04 server's appadmin 
 (over the LAN) via SSL, the layout/design of the screens is lost. See the 
 example screenshot. The admin login, installed applications, and edit 
 screens are broken.
 Although not consistently, this also breaks the appadmin on my local 
 10.04 machine. Clearing history/cache etc etc in Firefox usually corrects 
 the issue.

 However, I has also upgraded my 10.04LTS development environment to 2.9.4 
 and although the app admin screens were not broken in the same way, the 
 Manage buttons were not working (i.e. the dropdown edit, about, etc 
 options  don't show). Again usually clearing the firefox history/cache 
 corrects that. But restarts were required on 2 occasions. OK, its not a 
 biggie, but there is something underlying that is worrying.

 For now, I have reverted to 2.3.2 (on 10.04 LTS) to continue development 
 (although I prefer  the newer appadmin environment).

 Actually, I don't intend to use Appadmin on the production server (as per 
 the recommendations). My concern is that the appears to be an HTML, CSS, 
 Boostrap or JS issue around 2.9.4 - and am concerned it might impact the 
 production server for users.
 I am afraid I don't have the depth of expertise to nail it, so am looking 
 for pointers, please.

 As a side note, I saw a similar loss of appadmin layout when using 
 pythonanywhere about 9 months ago, so I am guessing (hoping) this is a 
 known gotcha.

 Any ideas on what is causing these appadmin layout issue?

 BTW - I have firefox 20.0
 Many thanks, as always.






-- 
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/d/optout.


[web2py] web2py on Mac OS Mavericks, trying to use port 80

2014-03-14 Thread audionuma
Hello,
Thanks to the team for the great tool !
I have minor issues on Mac OS Mavericks, just wanted to check before 
creating an issue on google code.

System
Mac OS 10.9.2
$ which python
/usr/bin/python
$ python --version
Python 2.7.5

Steps
download web2py_src.zip
unzip the archive into $basedir
from an Mac administrator account, launch Terminal
$ cd $basedir
$ python web2py.py
...
Version 2.9.4-stable+timestamp.2014.03.05.04.44.09
...
The web2py graphical interface launches
Leave server ip on local
Set Server Port to 80
Enter a password in Choose password field
Click on start server

Expected result
web2py framework, start listening on port 80

Actual result
The terminal output :
ERROR:Rocket.Errors.Port80:Socket 127.0.0.1:80 in use by other process and 
it won't share.
WARNING:Rocket.Errors.Port80:Listener started when not ready.

What have I tried
Check active ports with Apple's network utility (port scan) : no active 
port between 10 and 100

Use 
$ sudo python web2py.py
instead of 
$ python web2py.py
Then you can actually launch web2py on port 80
Terminal output :
...
please visit:
http://127.0.0.1/
starting browser...

It seems this is related to Mac OS policy to keep use of some ports for 
it's own usage.
My question is wether this is a bug or an enhancement request to have an 
error message in the graphical web2py launch app to inform user ?
(When using the Mac OS package instead of the source version, you don't 
have any feedback on this issue, the server is just not starting).

As this is my first post on this list, let me know if I made any mistake.
thanks,
Manuel

-- 
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/d/optout.


[web2py] Re: Fashion Marketplace in Web2py - Feedback needed

2014-03-14 Thread 黄祥
wonthefull, just a suggestion, for a page translation please. some page in 
english and some is in portugese

best regards,
stifan

-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
Okay, version 2.6.5 is verified. No difference in the Python version.

So how to explain the performance difference?


On Friday, 14 March 2014 09:36:29 UTC-4, Jonathan Lundell wrote:

 On 14 Mar 2014, at 6:28 AM, horridohobbyist 
 horrido...@gmail.comjavascript: 
 wrote:

 I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page:

 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return

 I get an elapsed time of 0.103 seconds.

 The same exact code in a command line program...

 if __name__ == '__main__':
 test()

 gives an elapsed time of 0.003 seconds. *That's 35 times faster!* It's 
 not the 2 orders of magnitude I'm seeing in the pyShipping code, but my 
 point is proven. There is something hinky about web2py that makes Python 
 code execute much more slowly. Is web2py using a different Python version? 
 As far as I can tell, I only have Python 2.6.5 installed on my Linux server.


 Easy enough to find out: print sys.version.


-- 
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/d/optout.


[web2py] Re: need help with query

2014-03-14 Thread Bastiaan


 Solved it by using 2 seperate queries:


rij = db().select(
db.track_trace.id_reparaties, db.track_trace.id_status, 
db.track_trace.created_by, max,
groupby=~db.track_trace.id_reparaties,
having=(db.track_trace.id_status == 4))
ids = []
for item in rij:
ids.append(item.track_trace.id_reparaties)
rijen = 
db((db.reparaties.created_by==auth.user.id)(db.reparaties.id.belongs(ids))).select()
po = len(rijen)


 

-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 7:39 AM, horridohobbyist horrido.hobb...@gmail.com wrote:
 Okay, version 2.6.5 is verified. No difference in the Python version.
 
 So how to explain the performance difference?

It's getting to be interesting.

To make the result more robust, I'd try it with a much bigger range, maybe 
100x, to be sure that the per-loop time is dominating the report. And just for 
the heck of it I'd replace range with xrange to see if it makes any difference 
at all.

Something else to keep in mind, especially if you're running this on a shared 
VM, is that time.time() is giving you clock time, and that can lead to very 
random results in a shared-hardware environment. Or even in a non-shared one, 
if there's any other system activity going on. The only way around that is to 
repeat the experiment a lot (which you're doing, sounds like).

 
 
 On Friday, 14 March 2014 09:36:29 UTC-4, Jonathan Lundell wrote:
 On 14 Mar 2014, at 6:28 AM, horridohobbyist horrido...@gmail.com wrote:
 I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page:
 
 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return
 
 I get an elapsed time of 0.103 seconds.
 
 The same exact code in a command line program...
 
 if __name__ == '__main__':
 test()
 
 gives an elapsed time of 0.003 seconds. That's 35 times faster! It's not the 
 2 orders of magnitude I'm seeing in the pyShipping code, but my point is 
 proven. There is something hinky about web2py that makes Python code execute 
 much more slowly. Is web2py using a different Python version? As far as I 
 can tell, I only have Python 2.6.5 installed on my Linux server.
 
 
 Easy enough to find out: print sys.version.


-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread Anthony
How long does web2py take to return just a simple string (i.e., remove the 
calculations from test())? You can't really compare the time an HTTP 
request takes to the time it takes to run a simple Python script -- a lot 
more is going in with an HTTP request (though .1 seconds still sounds high).

Anthony

On Friday, March 14, 2014 9:28:48 AM UTC-4, horridohobbyist wrote:

 I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page:

 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return

 I get an elapsed time of 0.103 seconds.

 The same exact code in a command line program...

 if __name__ == '__main__':
 test()

 gives an elapsed time of 0.003 seconds. *That's 35 times faster!* It's 
 not the 2 orders of magnitude I'm seeing in the pyShipping code, but my 
 point is proven. There is something hinky about web2py that makes Python 
 code execute much more slowly. Is web2py using a different Python version? 
 As far as I can tell, I only have Python 2.6.5 installed on my Linux server.


 On Friday, 14 March 2014 08:17:00 UTC-4, Leonel Câmara wrote:

 If you have a performance issue why haven't you used a profiler yet? No 
 one is going to guess it,

 web2py.py -F foldername

 Then use something like runsnakerun or pstats.



-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
xrange makes no difference. And, yes, I've run the Welcome program dozens 
of times and the results are very consistent. There is little randomness in 
time.time().

My Linux server is a dedicated machine at the datacentre. I have it all to 
myself. Not much else is running on it. Apache2, web2py.


On Friday, 14 March 2014 10:53:38 UTC-4, Jonathan Lundell wrote:

 On 14 Mar 2014, at 7:39 AM, horridohobbyist 
 horrido...@gmail.comjavascript: 
 wrote: 
  Okay, version 2.6.5 is verified. No difference in the Python version. 
  
  So how to explain the performance difference? 

 It's getting to be interesting. 

 To make the result more robust, I'd try it with a much bigger range, maybe 
 100x, to be sure that the per-loop time is dominating the report. And just 
 for the heck of it I'd replace range with xrange to see if it makes any 
 difference at all. 

 Something else to keep in mind, especially if you're running this on a 
 shared VM, is that time.time() is giving you clock time, and that can lead 
 to very random results in a shared-hardware environment. Or even in a 
 non-shared one, if there's any other system activity going on. The only way 
 around that is to repeat the experiment a lot (which you're doing, sounds 
 like). 

  
  
  On Friday, 14 March 2014 09:36:29 UTC-4, Jonathan Lundell wrote: 
  On 14 Mar 2014, at 6:28 AM, horridohobbyist horrido...@gmail.com 
 wrote: 
  I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page: 
  
  def test(): 
  start = time.time() 
  x = 0.0 
  for i in range(1,5000): 
  x += (float(i+10)*(i+25)+175.0)/3.14 
  debug(elapsed time: +str(time.time()-start)) 
  return 
  
  I get an elapsed time of 0.103 seconds. 
  
  The same exact code in a command line program... 
  
  if __name__ == '__main__': 
  test() 
  
  gives an elapsed time of 0.003 seconds. That's 35 times faster! It's 
 not the 2 orders of magnitude I'm seeing in the pyShipping code, but my 
 point is proven. There is something hinky about web2py that makes Python 
 code execute much more slowly. Is web2py using a different Python version? 
 As far as I can tell, I only have Python 2.6.5 installed on my Linux 
 server. 
  
  
  Easy enough to find out: print sys.version. 




-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
The computed time interval brackets the calculations. I don't see how that 
would be affected by HTTP processing.

Anyway, just replacing the calculations with a string return gives:

elapsed time: 2.09808349609e-05


On Friday, 14 March 2014 11:27:39 UTC-4, Anthony wrote:

 How long does web2py take to return just a simple string (i.e., remove the 
 calculations from test())? You can't really compare the time an HTTP 
 request takes to the time it takes to run a simple Python script -- a lot 
 more is going in with an HTTP request (though .1 seconds still sounds high).

 Anthony

 On Friday, March 14, 2014 9:28:48 AM UTC-4, horridohobbyist wrote:

 I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page:

 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return

 I get an elapsed time of 0.103 seconds.

 The same exact code in a command line program...

 if __name__ == '__main__':
 test()

 gives an elapsed time of 0.003 seconds. *That's 35 times faster!* It's 
 not the 2 orders of magnitude I'm seeing in the pyShipping code, but my 
 point is proven. There is something hinky about web2py that makes Python 
 code execute much more slowly. Is web2py using a different Python version? 
 As far as I can tell, I only have Python 2.6.5 installed on my Linux server.


 On Friday, 14 March 2014 08:17:00 UTC-4, Leonel Câmara wrote:

 If you have a performance issue why haven't you used a profiler yet? No 
 one is going to guess it,

 web2py.py -F foldername

 Then use something like runsnakerun or pstats.



-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread Leonel Câmara
Time is still a bad way to measure as the web2py version process may be 
getting preempted and not getting as much CPU time. Althoug,h I would agree 
there seems to be something odd going on here. Possibly dead code 
elimination. What happens with the time if you add a print x after the 
for to both versions?

-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
I disagree. I'm getting very consistent results with time.time().

With a print statement, Welcome yields 0.587778091431 second, while the 
command line execution gives 0.0202300548553 second. Again, that's 29 times 
faster.


On Friday, 14 March 2014 11:51:04 UTC-4, Leonel Câmara wrote:

 Time is still a bad way to measure as the web2py version process may be 
 getting preempted and not getting as much CPU time. Althoug,h I would agree 
 there seems to be something odd going on here. Possibly dead code 
 elimination. What happens with the time if you add a print x after the 
 for to both versions?


-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 8:59 AM, horridohobbyist horrido.hobb...@gmail.com wrote:
 I disagree. I'm getting very consistent results with time.time().

Right, I see no problem with the experiment. And the arguments to debug() must 
be computed before debug() gets called, so no problem there either.

 
 With a print statement, Welcome yields 0.587778091431 second, while the 
 command line execution gives 0.0202300548553 second. Again, that's 29 times 
 faster.
 
 
 On Friday, 14 March 2014 11:51:04 UTC-4, Leonel Câmara wrote:
 Time is still a bad way to measure as the web2py version process may be 
 getting preempted and not getting as much CPU time. Althoug,h I would agree 
 there seems to be something odd going on here. Possibly dead code 
 elimination. What happens with the time if you add a print x after the 
 for to both versions?
 
 


-- 
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/d/optout.


[web2py] Re: Appadmin on 2.9.4

2014-03-14 Thread SimonD
Thanks,
The vhost configs (I assuming that we are talking about 
sites-available/default ?), is as per the setup script as kindly included 
in web2py. It is unchanged apart from the installation directory (i.e. 
other than www-data). I have changed all references of www-data to a new 
directory name. I guess these all resolve OK, because the server works as 
expected in every other respect. I am pretty sure it is not a permission 
issue as they are the same across the whole directory.
It just looks like there is a missing CSS or JS or similar. The only 
'vhost' reference is in apache2.conf but thats just a log file name.
Actually, the Welcome Hello World screen looks fine at 
welcome/default/index. But clicking through to admin/default/index is where 
the issue starts presenting. Note the top black navbar is not showing 
(although there seems to be a navbar reference in the page source), so 
maybe part of the layout include is not being served. Does admin require 
different includes?
is there anything specific I should I look for in the conf files? (I am not 
an apache expert)
Thanks


On Friday, March 14, 2014 2:34:15 PM UTC, shapova...@gmail.com wrote:

 I remember seeing something similar on previous version, IIRC the thing 
 was in apache's vhost config.

 On Friday, March 14, 2014 4:27:04 PM UTC+2, Massimo Di Pierro wrote:

 Anybody else experiencing this?

 On Friday, 14 March 2014 06:39:08 UTC-5, SimonD wrote:

 Hello, I have seen a previous post on an apparently broken Admin screen, 
 but I think this is a different issue (or just a noobie question).
 I have done my app development on 2.3.2 (on Ubuntu 10.04 LTS).
 I have setup a new local server (test production) on my LAN, with a 
 clean/fresh install of Ubuntu 12.04 LTS. I downloaded 2.9.4 and used the 
 'setup-web2py-ubuntu.sh' script for Apache2. I copied my app over (it is 
 still using SQLite for now), and updated web2py.js, appadmin.py and 
 appadmin.htms as per the release notes. My actual web-application seems to 
 work fine on the server.

 But, from my 10.04 machine, when I access the 12.04 server's appadmin 
 (over the LAN) via SSL, the layout/design of the screens is lost. See the 
 example screenshot. The admin login, installed applications, and edit 
 screens are broken.
 Although not consistently, this also breaks the appadmin on my local 
 10.04 machine. Clearing history/cache etc etc in Firefox usually corrects 
 the issue.

 However, I has also upgraded my 10.04LTS development environment to 
 2.9.4 and although the app admin screens were not broken in the same way, 
 the Manage buttons were not working (i.e. the dropdown edit, about, etc 
 options  don't show). Again usually clearing the firefox history/cache 
 corrects that. But restarts were required on 2 occasions. OK, its not a 
 biggie, but there is something underlying that is worrying.

 For now, I have reverted to 2.3.2 (on 10.04 LTS) to continue development 
 (although I prefer  the newer appadmin environment).

 Actually, I don't intend to use Appadmin on the production server (as 
 per the recommendations). My concern is that the appears to be an HTML, 
 CSS, Boostrap or JS issue around 2.9.4 - and am concerned it might impact 
 the production server for users.
 I am afraid I don't have the depth of expertise to nail it, so am 
 looking for pointers, please.

 As a side note, I saw a similar loss of appadmin layout when using 
 pythonanywhere about 9 months ago, so I am guessing (hoping) this is a 
 known gotcha.

 Any ideas on what is causing these appadmin layout issue?

 BTW - I have firefox 20.0
 Many thanks, as always.






-- 
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/d/optout.


[web2py] Re: Fashion Marketplace in Web2py - Feedback needed

2014-03-14 Thread Massimo Di Pierro
Do I need to login? Is there more information one can see without login. 
Looks nice.

On Friday, 14 March 2014 08:54:24 UTC-5, Francisco Costa wrote:

 Hi there,

 Just wanted to get some feedback form the web2py community about this new 
 project:

 *CHIQUE* https://chique.pt/?lang=en is a mobile fashion marketplace 
 built around real-time social experiences.
 Our vibrant community brings fashion lovers together to share their 
 individual style, turning every closet into a unique shopping experience.
 Founded in 2014, we are headquartered at Porto, Portugal

 Thanks,
 Francisco Costa


-- 
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/d/optout.


Re: [web2py] Re: Fashion Marketplace in Web2py - Feedback needed

2014-03-14 Thread Francisco Costa
No, you can browse the marketplace without login
https://chique.pt/buy?lang=en

Francisco Costa
http://franciscocosta.com


On Fri, Mar 14, 2014 at 4:17 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Do I need to login? Is there more information one can see without login.
 Looks nice.


 On Friday, 14 March 2014 08:54:24 UTC-5, Francisco Costa wrote:

 Hi there,

 Just wanted to get some feedback form the web2py community about this new
 project:

 *CHIQUE* https://chique.pt/?lang=en is a mobile fashion marketplace
 built around real-time social experiences.
 Our vibrant community brings fashion lovers together to share their
 individual style, turning every closet into a unique shopping experience.
 Founded in 2014, we are headquartered at Porto, Portugal

 Thanks,
 Francisco Costa

  --
 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/_9kRTdzI2wk/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/d/optout.


-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread Leonel Câmara
 must be computed before debug() gets called, so no problem there either.

Yes Jonathan but debug, or anything else, didn't need the result of the x 
computation. So it was possible, I don't know the internals of cpython that 
well, the loop was optimized away in the command line version.  
  
I also disagree that using time is not a problem. It totally is. Id like to 
see this done using timeit and much more than 5000 iterations.
 

-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread Massimo Di Pierro
Just adding one datapoint. I am trying this with my mac. In both cases I 
see 0.002xx seconds. Therefore I cannot reproduce the discrepancy.
Are you using web2py from source? What kind of machine do you have?

Massimo

On Friday, 14 March 2014 08:28:48 UTC-5, horridohobbyist wrote:

 I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page:

 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return

 I get an elapsed time of 0.103 seconds.

 The same exact code in a command line program...

 if __name__ == '__main__':
 test()

 gives an elapsed time of 0.003 seconds. *That's 35 times faster!* It's 
 not the 2 orders of magnitude I'm seeing in the pyShipping code, but my 
 point is proven. There is something hinky about web2py that makes Python 
 code execute much more slowly. Is web2py using a different Python version? 
 As far as I can tell, I only have Python 2.6.5 installed on my Linux server.


 On Friday, 14 March 2014 08:17:00 UTC-4, Leonel Câmara wrote:

 If you have a performance issue why haven't you used a profiler yet? No 
 one is going to guess it,

 web2py.py -F foldername

 Then use something like runsnakerun or pstats.



-- 
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/d/optout.


Re: [web2py] Re: Appadmin on 2.9.4

2014-03-14 Thread Ovidio Marinho
Massimo has a problem when we use the script, web2py not posing on
localhost port.




 Ovidio Marinho Falcao Neto
  ITJP.NET.BR
 ovidio...@gmail.com
 itjp.net...@gmail.com
 Brasil



2014-03-14 11:27 GMT-03:00 Massimo Di Pierro massimo.dipie...@gmail.com:

 Anybody else experiencing this?


 On Friday, 14 March 2014 06:39:08 UTC-5, SimonD wrote:

 Hello, I have seen a previous post on an apparently broken Admin screen,
 but I think this is a different issue (or just a noobie question).
 I have done my app development on 2.3.2 (on Ubuntu 10.04 LTS).
 I have setup a new local server (test production) on my LAN, with a
 clean/fresh install of Ubuntu 12.04 LTS. I downloaded 2.9.4 and used the
 'setup-web2py-ubuntu.sh' script for Apache2. I copied my app over (it is
 still using SQLite for now), and updated web2py.js, appadmin.py and
 appadmin.htms as per the release notes. My actual web-application seems to
 work fine on the server.

 But, from my 10.04 machine, when I access the 12.04 server's appadmin
 (over the LAN) via SSL, the layout/design of the screens is lost. See the
 example screenshot. The admin login, installed applications, and edit
 screens are broken.
 Although not consistently, this also breaks the appadmin on my local
 10.04 machine. Clearing history/cache etc etc in Firefox usually corrects
 the issue.

 However, I has also upgraded my 10.04LTS development environment to 2.9.4
 and although the app admin screens were not broken in the same way, the
 Manage buttons were not working (i.e. the dropdown edit, about, etc
 options  don't show). Again usually clearing the firefox history/cache
 corrects that. But restarts were required on 2 occasions. OK, its not a
 biggie, but there is something underlying that is worrying.

 For now, I have reverted to 2.3.2 (on 10.04 LTS) to continue development
 (although I prefer  the newer appadmin environment).

 Actually, I don't intend to use Appadmin on the production server (as per
 the recommendations). My concern is that the appears to be an HTML, CSS,
 Boostrap or JS issue around 2.9.4 - and am concerned it might impact the
 production server for users.
 I am afraid I don't have the depth of expertise to nail it, so am looking
 for pointers, please.

 As a side note, I saw a similar loss of appadmin layout when using
 pythonanywhere about 9 months ago, so I am guessing (hoping) this is a
 known gotcha.

 Any ideas on what is causing these appadmin layout issue?

 BTW - I have firefox 20.0
 Many thanks, as always.




  --
 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/d/optout.


-- 
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/d/optout.


[web2py] Re: Appadmin on 2.9.4

2014-03-14 Thread Massimo Di Pierro
Can you open the page with chrome? In the javascript console (under network 
activity) it will tell you which files return a 404 error (if any). Then 
you can check if the files are there or not.

On Friday, 14 March 2014 11:06:09 UTC-5, SimonD wrote:

 Thanks,
 The vhost configs (I assuming that we are talking about 
 sites-available/default ?), is as per the setup script as kindly included 
 in web2py. It is unchanged apart from the installation directory (i.e. 
 other than www-data). I have changed all references of www-data to a new 
 directory name. I guess these all resolve OK, because the server works as 
 expected in every other respect. I am pretty sure it is not a permission 
 issue as they are the same across the whole directory.
 It just looks like there is a missing CSS or JS or similar. The only 
 'vhost' reference is in apache2.conf but thats just a log file name.
 Actually, the Welcome Hello World screen looks fine at 
 welcome/default/index. But clicking through to admin/default/index is where 
 the issue starts presenting. Note the top black navbar is not showing 
 (although there seems to be a navbar reference in the page source), so 
 maybe part of the layout include is not being served. Does admin require 
 different includes?
 is there anything specific I should I look for in the conf files? (I am 
 not an apache expert)
 Thanks


 On Friday, March 14, 2014 2:34:15 PM UTC, shapova...@gmail.com wrote:

 I remember seeing something similar on previous version, IIRC the thing 
 was in apache's vhost config.

 On Friday, March 14, 2014 4:27:04 PM UTC+2, Massimo Di Pierro wrote:

 Anybody else experiencing this?

 On Friday, 14 March 2014 06:39:08 UTC-5, SimonD wrote:

 Hello, I have seen a previous post on an apparently broken Admin 
 screen, but I think this is a different issue (or just a noobie question).
 I have done my app development on 2.3.2 (on Ubuntu 10.04 LTS).
 I have setup a new local server (test production) on my LAN, with a 
 clean/fresh install of Ubuntu 12.04 LTS. I downloaded 2.9.4 and used the 
 'setup-web2py-ubuntu.sh' script for Apache2. I copied my app over (it is 
 still using SQLite for now), and updated web2py.js, appadmin.py and 
 appadmin.htms as per the release notes. My actual web-application seems to 
 work fine on the server.

 But, from my 10.04 machine, when I access the 12.04 server's appadmin 
 (over the LAN) via SSL, the layout/design of the screens is lost. See the 
 example screenshot. The admin login, installed applications, and 
 edit 
 screens are broken.
 Although not consistently, this also breaks the appadmin on my local 
 10.04 machine. Clearing history/cache etc etc in Firefox usually corrects 
 the issue.

 However, I has also upgraded my 10.04LTS development environment to 
 2.9.4 and although the app admin screens were not broken in the same way, 
 the Manage buttons were not working (i.e. the dropdown edit, about, 
 etc 
 options  don't show). Again usually clearing the firefox history/cache 
 corrects that. But restarts were required on 2 occasions. OK, its not a 
 biggie, but there is something underlying that is worrying.

 For now, I have reverted to 2.3.2 (on 10.04 LTS) to continue 
 development (although I prefer  the newer appadmin environment).

 Actually, I don't intend to use Appadmin on the production server (as 
 per the recommendations). My concern is that the appears to be an HTML, 
 CSS, Boostrap or JS issue around 2.9.4 - and am concerned it might impact 
 the production server for users.
 I am afraid I don't have the depth of expertise to nail it, so am 
 looking for pointers, please.

 As a side note, I saw a similar loss of appadmin layout when using 
 pythonanywhere about 9 months ago, so I am guessing (hoping) this is a 
 known gotcha.

 Any ideas on what is causing these appadmin layout issue?

 BTW - I have firefox 20.0
 Many thanks, as always.






-- 
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/d/optout.


[web2py] Re: Verbatim Tag

2014-03-14 Thread LightDot
Hi Massmo,

On Friday, March 14, 2014 2:46:58 PM UTC+1, Massimo Di Pierro wrote:

 {{data.message +  world!}}

 should be

 {{= data.message +  world!}}


No... this part is fictional AngularJS code, just meant as an example.

I think you're missing the point of this thread, and that is whether web2py 
should have a special variable to temporarily disable the parsing of {{ }} 
and leave that to another parser, such as AngularJS. This would enable both 
web2py and AngularJS to keep using the same delimiters.

I believe Django has this functionality. What I don't know is the reasoning 
for their inclusion and possible caveats... @David Simmons, do you perhaps 
know if there was a discussion there and what were the arguments? Have they 
had any issues with the implementation?

Regards

 

 On Thursday, 13 March 2014 17:21:28 UTC-5, David Simmons wrote:

 Hi All (again).

 I did some digging around with the web2py source code and came up with 
 this.

 https://gist.github.com/shortly-portly/9538005

 The usage is pretty straight forward. You can use normal Web2py tags {{ 
 and }}. When you want to drop down into Angular, surround your stuff with 
 {{ verbatim }} and {{ endverbatim }}. For example

 {{ extend 'layout.html }} - translated by web2py as normal

 {{ verbatim }}
 div ng-app=
 input type=text ng-model=data.message
 h1{{data.message +  world!}}/h1--- not touched by 
 web2py
 /div

 {{ endverbatim }}

 Could someone who knows more about the web2py source code let me know if 
 this looks like a valid change. I'd love to be able to submit it.

 cheers

 Dave



-- 
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/d/optout.


[web2py] Re: web2py on Mac OS Mavericks, trying to use port 80

2014-03-14 Thread Annet
Hi Manuel,

The issue is not limited to Mac OS Mavericks, I ran into the same issue on
Mac OS Lion Server and Mountain Lion Server. For that reason I leave
Web2py's Server Port setting to the default 8000 instead of setting it to 
80.

Kind regards,

Annet

-- 
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/d/optout.


Re: [web2py] Re: Fashion Marketplace in Web2py - Feedback needed

2014-03-14 Thread Massimo Di Pierro
I would make the BUY button bigger and call is Products. It was not 
obvious to me I could browse the products without committing to anything. 
;-)

On Friday, 14 March 2014 11:21:39 UTC-5, Francisco Costa wrote:

 No, you can browse the marketplace without login 
 https://chique.pt/buy?lang=en

 Francisco Costa
 http://franciscocosta.com


 On Fri, Mar 14, 2014 at 4:17 PM, Massimo Di Pierro 
 massimo@gmail.comjavascript:
  wrote:

 Do I need to login? Is there more information one can see without login. 
 Looks nice.


 On Friday, 14 March 2014 08:54:24 UTC-5, Francisco Costa wrote:

 Hi there,

 Just wanted to get some feedback form the web2py community about this 
 new project:

 *CHIQUE* https://chique.pt/?lang=en is a mobile fashion marketplace 
 built around real-time social experiences.
 Our vibrant community brings fashion lovers together to share their 
 individual style, turning every closet into a unique shopping experience.
 Founded in 2014, we are headquartered at Porto, Portugal

 Thanks,
 Francisco Costa

  -- 
 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/_9kRTdzI2wk/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




-- 
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/d/optout.


Re: [web2py] web2py on Mac OS Mavericks, trying to use port 80

2014-03-14 Thread Jonathan Lundell
On 13 Mar 2014, at 11:34 PM, audion...@gmail.com wrote:
 It seems this is related to Mac OS policy to keep use of some ports for it's 
 own usage.
 My question is wether this is a bug or an enhancement request to have an 
 error message in the graphical web2py launch app to inform user ?
 (When using the Mac OS package instead of the source version, you don't have 
 any feedback on this issue, the server is just not starting).
 
 As this is my first post on this list, let me know if I made any mistake.

Ports 1024 are privileged; that's pretty common on Unix implementations.

You can open them as root, or give your app permission: 
http://stackoverflow.com/questions/7612053/binding-on-privileged-ports-ports-1024-on-mac-os-x-10-6

-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
If I take out the calculations and just put x = 0.0, making this 
essentially an empty loop, I get 0.096 second, which is awfully high for a 
do-nothing loop.

If I remove everything between start = time.time() and debug(), I get 
0.1 second. So 0.1 second is the granularity of my measurements.


On Friday, 14 March 2014 09:28:48 UTC-4, horridohobbyist wrote:

 I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page:

 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return

 I get an elapsed time of 0.103 seconds.

 The same exact code in a command line program...

 if __name__ == '__main__':
 test()

 gives an elapsed time of 0.003 seconds. *That's 35 times faster!* It's 
 not the 2 orders of magnitude I'm seeing in the pyShipping code, but my 
 point is proven. There is something hinky about web2py that makes Python 
 code execute much more slowly. Is web2py using a different Python version? 
 As far as I can tell, I only have Python 2.6.5 installed on my Linux server.


 On Friday, 14 March 2014 08:17:00 UTC-4, Leonel Câmara wrote:

 If you have a performance issue why haven't you used a profiler yet? No 
 one is going to guess it,

 web2py.py -F foldername

 Then use something like runsnakerun or pstats.



-- 
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/d/optout.


Re: [web2py] Re: Appadmin on 2.9.4

2014-03-14 Thread Massimo Di Pierro
Sorry I do not understand.

On Friday, 14 March 2014 11:30:04 UTC-5, Ovidio Marinho wrote:

 Massimo has a problem when we use the script, web2py not posing on 
 localhost port.

   


  Ovidio Marinho Falcao Neto
   ITJP.NET.BR  
  ovid...@gmail.com javascript:
  itjp@gmail.com javascript:
  Brasil
   


 2014-03-14 11:27 GMT-03:00 Massimo Di Pierro 
 massimo@gmail.comjavascript:
 :

 Anybody else experiencing this?


 On Friday, 14 March 2014 06:39:08 UTC-5, SimonD wrote:

 Hello, I have seen a previous post on an apparently broken Admin screen, 
 but I think this is a different issue (or just a noobie question).
 I have done my app development on 2.3.2 (on Ubuntu 10.04 LTS).
 I have setup a new local server (test production) on my LAN, with a 
 clean/fresh install of Ubuntu 12.04 LTS. I downloaded 2.9.4 and used the 
 'setup-web2py-ubuntu.sh' script for Apache2. I copied my app over (it is 
 still using SQLite for now), and updated web2py.js, appadmin.py and 
 appadmin.htms as per the release notes. My actual web-application seems to 
 work fine on the server.

 But, from my 10.04 machine, when I access the 12.04 server's appadmin 
 (over the LAN) via SSL, the layout/design of the screens is lost. See the 
 example screenshot. The admin login, installed applications, and edit 
 screens are broken.
 Although not consistently, this also breaks the appadmin on my local 
 10.04 machine. Clearing history/cache etc etc in Firefox usually corrects 
 the issue.

 However, I has also upgraded my 10.04LTS development environment to 
 2.9.4 and although the app admin screens were not broken in the same way, 
 the Manage buttons were not working (i.e. the dropdown edit, about, etc 
 options  don't show). Again usually clearing the firefox history/cache 
 corrects that. But restarts were required on 2 occasions. OK, its not a 
 biggie, but there is something underlying that is worrying.

 For now, I have reverted to 2.3.2 (on 10.04 LTS) to continue development 
 (although I prefer  the newer appadmin environment).

 Actually, I don't intend to use Appadmin on the production server (as 
 per the recommendations). My concern is that the appears to be an HTML, 
 CSS, Boostrap or JS issue around 2.9.4 - and am concerned it might impact 
 the production server for users.
 I am afraid I don't have the depth of expertise to nail it, so am 
 looking for pointers, please.

 As a side note, I saw a similar loss of appadmin layout when using 
 pythonanywhere about 9 months ago, so I am guessing (hoping) this is a 
 known gotcha.

 Any ideas on what is causing these appadmin layout issue?

 BTW - I have firefox 20.0
 Many thanks, as always.




  -- 
 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/d/optout.




-- 
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/d/optout.


[web2py] Re: Verbatim Tag

2014-03-14 Thread Massimo Di Pierro
That's not how we do it. You either tell web2py to use different delimiters:

response.delimiters = ('%', '%')

or you tell angular to do so:

var myApp = angular.module('myApp', [], function($interpolateProvider) {
$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');});

http://stackoverflow.com/questions/12923521/angular-js-custom-delimiter




On Friday, 14 March 2014 11:32:19 UTC-5, LightDot wrote:

 Hi Massimo,

 On Friday, March 14, 2014 2:46:58 PM UTC+1, Massimo Di Pierro wrote:

 {{data.message +  world!}}

 should be

 {{= data.message +  world!}}


 No... this part is fictional AngularJS code, just meant as an example.

 I think you're missing the point of this thread, and that is whether 
 web2py should have a special variable to temporarily disable the parsing of 
 {{ }} and leave that to another parser, such as AngularJS. This would 
 enable both web2py and AngularJS to keep using the same delimiters.

 I believe Django has this functionality. What I don't know is the 
 reasoning for their inclusion and possible caveats... @David Simmons, do 
 you perhaps know if there was a discussion there and what were the 
 arguments? Have they had any issues with the implementation?

 Regards

  

 On Thursday, 13 March 2014 17:21:28 UTC-5, David Simmons wrote:

 Hi All (again).

 I did some digging around with the web2py source code and came up with 
 this.

 https://gist.github.com/shortly-portly/9538005

 The usage is pretty straight forward. You can use normal Web2py tags {{ 
 and }}. When you want to drop down into Angular, surround your stuff with 
 {{ verbatim }} and {{ endverbatim }}. For example

 {{ extend 'layout.html }} - translated by web2py as normal

 {{ verbatim }}
 div ng-app=
 input type=text ng-model=data.message
 h1{{data.message +  world!}}/h1--- not touched by 
 web2py
 /div

 {{ endverbatim }}

 Could someone who knows more about the web2py source code let me know if 
 this looks like a valid change. I'd love to be able to submit it.

 cheers

 Dave



-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread Massimo Di Pierro
Can anybody else reproduce this? If so, let's try find out what 
OS/versions/hardware you have in common.

On Friday, 14 March 2014 11:18:28 UTC-5, Leonel Câmara wrote:

  must be computed before debug() gets called, so no problem there either.

 Yes Jonathan but debug, or anything else, didn't need the result of the x 
 computation. So it was possible, I don't know the internals of cpython that 
 well, the loop was optimized away in the command line version.  
   
 I also disagree that using time is not a problem. It totally is. Id like 
 to see this done using timeit and much more than 5000 iterations.

 [edit]

 Also what happens if you change the web2py version to:

 def test():
 t = time.time
 start = t()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(t()-start))
 return

  


-- 
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/d/optout.


[web2py] Re: web2py on Mac OS Mavericks, trying to use port 80

2014-03-14 Thread LightDot
Hello Manuel, welcome to the list.

The issue you're seeing is not a bug, it's a feature of the OS or, rather, 
of it's security settings. The same behavior can be observed on Linux, 
FreeBSD, Solaris, ... any UN*X OS basically: non root users can't bind to 
ports below 1024.

This limit can be changed (per user or per process), but I don't recommend 
this unless you understand all implications of doing so. There are other 
ways around this, such as starting the process as root and then dropping 
privileges, using a proxy that has such functionality, using iptables to 
redirect ports, etc.

Regards

On Friday, March 14, 2014 7:34:58 AM UTC+1, audi...@gmail.com wrote:

 Hello,
 Thanks to the team for the great tool !
 I have minor issues on Mac OS Mavericks, just wanted to check before 
 creating an issue on google code.

 System
 Mac OS 10.9.2
 $ which python
 /usr/bin/python
 $ python --version
 Python 2.7.5

 Steps
 download web2py_src.zip
 unzip the archive into $basedir
 from an Mac administrator account, launch Terminal
 $ cd $basedir
 $ python web2py.py
 ...
 Version 2.9.4-stable+timestamp.2014.03.05.04.44.09
 ...
 The web2py graphical interface launches
 Leave server ip on local
 Set Server Port to 80
 Enter a password in Choose password field
 Click on start server

 Expected result
 web2py framework, start listening on port 80

 Actual result
 The terminal output :
 ERROR:Rocket.Errors.Port80:Socket 127.0.0.1:80 in use by other process 
 and it won't share.
 WARNING:Rocket.Errors.Port80:Listener started when not ready.

 What have I tried
 Check active ports with Apple's network utility (port scan) : no active 
 port between 10 and 100

 Use 
 $ sudo python web2py.py
 instead of 
 $ python web2py.py
 Then you can actually launch web2py on port 80
 Terminal output :
 ...
 please visit:
 http://127.0.0.1/
 starting browser...

 It seems this is related to Mac OS policy to keep use of some ports for 
 it's own usage.
 My question is wether this is a bug or an enhancement request to have an 
 error message in the graphical web2py launch app to inform user ?
 (When using the Mac OS package instead of the source version, you don't 
 have any feedback on this issue, the server is just not starting).

 As this is my first post on this list, let me know if I made any mistake.
 thanks,
 Manuel


-- 
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/d/optout.


[web2py] Pulling data from API for real-time calculation

2014-03-14 Thread Martin
Hi all,
Please could anyone help me out, I need to pull some data from some API 
(ex: https//xxx/aaa/ etc.) that returns json data type.
I will take input from logged-in users (onkeyup event)  with the API 
retured json to perform some real-time calculation  and then display the 
result to the logged-in user.

My question is how can i perform this following Massimo's advices in the 
web2py online book,

*...Ajax callbacks can be used to perform computations in the background, 
but we recommend using cron or a background process instead (discussed in 
chapter 4), since the web server enforces a timeout on threads. If the 
computation takes too long, the web server kills it. Refer to your web 
server parameters to set the timeout value...*

* 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/d/optout.


[web2py] Re: Accepting custom form without saving

2014-03-14 Thread Martin
Thank you Massimo, you reply was helpful.

Le jeudi 13 mars 2014 21:28:03 UTC+2, Martin a écrit :

 Hi all,
 Please could anyone tell me how to accept a *custom SQLFORM* without 
 inserting to db, since 

 if form.process().accepted: seems to be perform insertion directly.

 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/d/optout.


[web2py] Re: Custom fill with SQLFORM not saving. Web2py version 2.8.2

2014-03-14 Thread Martin
it worked! thank you

Le jeudi 13 mars 2014 21:00:24 UTC+2, Martin a écrit :

 Hi all,


...if FORM.accepts(form,request.vars): ..
 not working for custom form, please may i know if i'am missing something...
 Thanks!

 def page1(): 
form=SQLFORM(db.a_table) 
if FORM.accepts(form,request.
 vars): 
 session.vars=form.vars 
 redirect(URL(r=request,f='confirm')) 
return dict(form=form) 

 .




-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread Anthony
Oops, sorry.

On Friday, March 14, 2014 11:38:34 AM UTC-4, horridohobbyist wrote:

 The computed time interval brackets the calculations. I don't see how that 
 would be affected by HTTP processing.

 Anyway, just replacing the calculations with a string return gives:

 elapsed time: 2.09808349609e-05


 On Friday, 14 March 2014 11:27:39 UTC-4, Anthony wrote:

 How long does web2py take to return just a simple string (i.e., remove 
 the calculations from test())? You can't really compare the time an HTTP 
 request takes to the time it takes to run a simple Python script -- a lot 
 more is going in with an HTTP request (though .1 seconds still sounds high).

 Anthony

 On Friday, March 14, 2014 9:28:48 AM UTC-4, horridohobbyist wrote:

 I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page:

 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return

 I get an elapsed time of 0.103 seconds.

 The same exact code in a command line program...

 if __name__ == '__main__':
 test()

 gives an elapsed time of 0.003 seconds. *That's 35 times faster!* It's 
 not the 2 orders of magnitude I'm seeing in the pyShipping code, but my 
 point is proven. There is something hinky about web2py that makes Python 
 code execute much more slowly. Is web2py using a different Python version? 
 As far as I can tell, I only have Python 2.6.5 installed on my Linux server.


 On Friday, 14 March 2014 08:17:00 UTC-4, Leonel Câmara wrote:

 If you have a performance issue why haven't you used a profiler yet? No 
 one is going to guess it,

 web2py.py -F foldername

 Then use something like runsnakerun or pstats.



-- 
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/d/optout.


[web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
I originally installed web2py according to the Book. This was several years 
ago.

I recently upgraded to the latest version, but I had to do it manually, as 
the administrative interface had all kinds of permission problems with the 
upgrade.

I have a Dell server box, 2.4GHz quad-core Xeon with 4GB of RAM and 500GB 
hard drive. It's running Ubuntu Server 10.04.


On Friday, 14 March 2014 12:26:44 UTC-4, Massimo Di Pierro wrote:

 Just adding one datapoint. I am trying this with my mac. In both cases I 
 see 0.002xx seconds. Therefore I cannot reproduce the discrepancy.
 Are you using web2py from source? What kind of machine do you have?

 Massimo

 On Friday, 14 March 2014 08:28:48 UTC-5, horridohobbyist wrote:

 I conducted a simple experiment. I took the Welcome app, surely the 
 simplest you can have (no databases, no concurrency, etc.), and added the 
 following to the index page:

 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return

 I get an elapsed time of 0.103 seconds.

 The same exact code in a command line program...

 if __name__ == '__main__':
 test()

 gives an elapsed time of 0.003 seconds. *That's 35 times faster!* It's 
 not the 2 orders of magnitude I'm seeing in the pyShipping code, but my 
 point is proven. There is something hinky about web2py that makes Python 
 code execute much more slowly. Is web2py using a different Python version? 
 As far as I can tell, I only have Python 2.6.5 installed on my Linux server.


 On Friday, 14 March 2014 08:17:00 UTC-4, Leonel Câmara wrote:

 If you have a performance issue why haven't you used a profiler yet? No 
 one is going to guess it,

 web2py.py -F foldername

 Then use something like runsnakerun or pstats.



-- 
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/d/optout.


[web2py] Re: Verbatim Tag

2014-03-14 Thread David Simmons
LightDot

The implementation I put together was only done last night and I have done 
limited testing. I did it as I feel Web2py and Angular make a fantastic 
combination and want to explore the two working together more.

I'm really keen to understand from Massimo and other Web2py guru's if my 
idea is stupid or not.

cheers

Dave

-- 
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/d/optout.


[web2py] Re: Verbatim Tag

2014-03-14 Thread David Simmons
Hi Massimo

I appreciate you can change either Web2py or Angular delimiters but the 
small code change I have suggested allows you to have the best of both 
worlds. If you change one of the delimiters it means you need to be careful
with anything that might rely on it. 

Is there any reason why we my code change could not be included in Web2py 
to allow for this?

many thanks

Dave

-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Michele Comitini
Please try to profile as suggested we need more info.

2014-03-14 18:18 GMT+01:00 horridohobbyist horrido.hobb...@gmail.com:
 I originally installed web2py according to the Book. This was several years
 ago.

 I recently upgraded to the latest version, but I had to do it manually, as
 the administrative interface had all kinds of permission problems with the
 upgrade.

 I have a Dell server box, 2.4GHz quad-core Xeon with 4GB of RAM and 500GB
 hard drive. It's running Ubuntu Server 10.04.


 On Friday, 14 March 2014 12:26:44 UTC-4, Massimo Di Pierro wrote:

 Just adding one datapoint. I am trying this with my mac. In both cases I
 see 0.002xx seconds. Therefore I cannot reproduce the discrepancy.
 Are you using web2py from source? What kind of machine do you have?

 Massimo

 On Friday, 14 March 2014 08:28:48 UTC-5, horridohobbyist wrote:

 I conducted a simple experiment. I took the Welcome app, surely the
 simplest you can have (no databases, no concurrency, etc.), and added the
 following to the index page:

 def test():
 start = time.time()
 x = 0.0
 for i in range(1,5000):
 x += (float(i+10)*(i+25)+175.0)/3.14
 debug(elapsed time: +str(time.time()-start))
 return

 I get an elapsed time of 0.103 seconds.

 The same exact code in a command line program...

 if __name__ == '__main__':
 test()

 gives an elapsed time of 0.003 seconds. That's 35 times faster! It's not
 the 2 orders of magnitude I'm seeing in the pyShipping code, but my point is
 proven. There is something hinky about web2py that makes Python code execute
 much more slowly. Is web2py using a different Python version? As far as I
 can tell, I only have Python 2.6.5 installed on my Linux server.


 On Friday, 14 March 2014 08:17:00 UTC-4, Leonel Câmara wrote:

 If you have a performance issue why haven't you used a profiler yet? No
 one is going to guess it,

 web2py.py -F foldername

 Then use something like runsnakerun or pstats.

 --
 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/d/optout.

-- 
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/d/optout.


[web2py] Plus Sign in URL Args

2014-03-14 Thread EW
Hi,
I'm having trouble with a url containing a plus sign in the args.  When I 
go to that url, the plus sign has been converted to an underscore.  Even 
printing raw_args in the controller shows the underscore.  When I hover 
over the link to the url in question, the + has been replaced with %2B 
as expected.  Why is it being converted to an underscore?
 
Context: I'm using gluon.Expose to browse through directories and I have a 
directory whose name starts with + (yay MATLAB toolboxes!).  Clicking on 
one such directory does not work.

-- 
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/d/optout.


[web2py] Re: Verbatim Tag

2014-03-14 Thread Leonel Câmara
David, I don't like that idea as I think it makes the views harder to 
parse. I need to remember that I'm inside a verbatim block to know if I'm 
reading python or not. I don't like the extra mental strain so I prefer the 
changing the delimiters strategy as I have a reminder of what I'm reading 
in each line. Reading code is all about saving valuable brain real estate 
for me, I need room to remember the rest of the project and the current 
task.   
  
To each it's own I guess, it's not like I would be forced to use it.  
  
You can also use {{=XML(your_angular_code, sanitize=False)}} which would be 
pretty ugly of course.


-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
First, I don't know how to use the profiler.

Second, for something as trivially simple as the Welcome app with the 
calculation loop, what is the profiler going to tell us? That simple 
multiplication and division are too slow? That the for loop is somehow 
broken?

Should I try to profile the entirety of the web2py framework?

Clearly, the Welcome app is pointing to a fundamental issue with my 
Ubuntu/Apache2/Python/web2py installation (assuming no one else can 
replicate the problem). As the Linux server is a production system, I am 
limited to how much tinkering I can actually do on it.

BTW, how does one actually shutdown web2py once it's installed and running 
via Apache?


On Friday, 14 March 2014 14:00:35 UTC-4, Michele Comitini wrote:

 Please try to profile as suggested we need more info. 

 2014-03-14 18:18 GMT+01:00 horridohobbyist 
 horrido...@gmail.comjavascript:: 

  I originally installed web2py according to the Book. This was several 
 years 
  ago. 
  
  I recently upgraded to the latest version, but I had to do it manually, 
 as 
  the administrative interface had all kinds of permission problems with 
 the 
  upgrade. 
  
  I have a Dell server box, 2.4GHz quad-core Xeon with 4GB of RAM and 
 500GB 
  hard drive. It's running Ubuntu Server 10.04. 
  
  
  On Friday, 14 March 2014 12:26:44 UTC-4, Massimo Di Pierro wrote: 
  
  Just adding one datapoint. I am trying this with my mac. In both cases 
 I 
  see 0.002xx seconds. Therefore I cannot reproduce the discrepancy. 
  Are you using web2py from source? What kind of machine do you have? 
  
  Massimo 
  
  On Friday, 14 March 2014 08:28:48 UTC-5, horridohobbyist wrote: 
  
  I conducted a simple experiment. I took the Welcome app, surely the 
  simplest you can have (no databases, no concurrency, etc.), and added 
 the 
  following to the index page: 
  
  def test(): 
  start = time.time() 
  x = 0.0 
  for i in range(1,5000): 
  x += (float(i+10)*(i+25)+175.0)/3.14 
  debug(elapsed time: +str(time.time()-start)) 
  return 
  
  I get an elapsed time of 0.103 seconds. 
  
  The same exact code in a command line program... 
  
  if __name__ == '__main__': 
  test() 
  
  gives an elapsed time of 0.003 seconds. That's 35 times faster! It's 
 not 
  the 2 orders of magnitude I'm seeing in the pyShipping code, but my 
 point is 
  proven. There is something hinky about web2py that makes Python code 
 execute 
  much more slowly. Is web2py using a different Python version? As far 
 as I 
  can tell, I only have Python 2.6.5 installed on my Linux server. 
  
  
  On Friday, 14 March 2014 08:17:00 UTC-4, Leonel Câmara wrote: 
  
  If you have a performance issue why haven't you used a profiler yet? 
 No 
  one is going to guess it, 
  
  web2py.py -F foldername 
  
  Then use something like runsnakerun or pstats. 
  
  -- 
  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/d/optout. 


-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 11:28 AM, horridohobbyist horrido.hobb...@gmail.com wrote:
 First, I don't know how to use the profiler.
 
 Second, for something as trivially simple as the Welcome app with the 
 calculation loop, what is the profiler going to tell us? That simple 
 multiplication and division are too slow? That the for loop is somehow broken?
 
 Should I try to profile the entirety of the web2py framework?

I doubt that the profile would tell you much about the loop itself, but it 
might show work going on elsewhere, which might be instructive.

 
 Clearly, the Welcome app is pointing to a fundamental issue with my 
 Ubuntu/Apache2/Python/web2py installation (assuming no one else can replicate 
 the problem). As the Linux server is a production system, I am limited to how 
 much tinkering I can actually do on it.
 
 BTW, how does one actually shutdown web2py once it's installed and running 
 via Apache?


It's running as a wsgi process under Apache, so you really need to shut down 
Apache, or at least reconfigure it to not run web2py and then do a graceful 
restart.

For this kind of testing (not production), it might be easier to run web2py 
directly and use Rocket.

-- 
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/d/optout.


[web2py] Web2py on Koding.com

2014-03-14 Thread wuelfhis asuaje
I've just deployed my app there with latest meb2py source

Configured apache, everythig looks fine, except when i try to get ajax 
links created like (A(IMG(..)..calback(myfunction())) 

The links point to something like /myapp/controler/function but in my 
machine point to something like /myapp/#null

Don't know where to start looking !

Can you 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/d/optout.


Re: [web2py] Web2py on Koding.com

2014-03-14 Thread Richard Vézina
Showing the callback code would help.

Richard


On Fri, Mar 14, 2014 at 2:50 PM, wuelfhis asuaje wasu...@hotmail.comwrote:

 I've just deployed my app there with latest meb2py source

 Configured apache, everythig looks fine, except when i try to get ajax
 links created like (A(IMG(..)..calback(myfunction()))

 The links point to something like /myapp/controler/function but in my
 machine point to something like /myapp/#null

 Don't know where to start looking !

 Can you 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/d/optout.


-- 
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/d/optout.


[web2py] Re: Verbatim Tag

2014-03-14 Thread David Simmons


 Hi Leonel


I think you are correct in that it might make it a little more difficult to 
parse. My problem with having to change either of the delimiters for 
Angular or Web2py is that I have to remember to change them for everything. 
For example if I change the
web2py delimiters I then have to replace the delimiters in the layout.html 
and any other views I might extend. If I change them in Angular then I have 
to change them for any third party code I might use.

I think you are correct that it is each to their own and a matter of 
personal taste. My request is that, if the code is acceptable, it be added 
to Web2py so that I can use it for more projects if I wish.

cheers

Dave

-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
Okay, I have some excellent news to report. Well, excellent for me, not so 
much for you guys...

I can reproduce the problem on another system. Here's what I did:

My Mac has Parallels installed. I created a new VM, downloaded Ubuntu 
Server 12.04, and installed it. Then I updated it with the latest patches.

Then, following the recipe from the Book for One step production 
deployment, I installed web2py 2.9.4.

I then ran the same Welcome vs command line test. The result?

Welcome:
elapsed time: 0.0491468906403

command line:
elapsed time: 0.00160121917725

Again, the command line is 30.6 times faster!!!

What more evidence do you need? Sorry to say, but there is something wrong 
with web2py.


On Friday, 14 March 2014 14:44:58 UTC-4, Jonathan Lundell wrote:

 On 14 Mar 2014, at 11:28 AM, horridohobbyist 
 horrido...@gmail.comjavascript: 
 wrote:

 First, I don't know how to use the profiler.

 Second, for something as trivially simple as the Welcome app with the 
 calculation loop, what is the profiler going to tell us? That simple 
 multiplication and division are too slow? That the for loop is somehow 
 broken?

 Should I try to profile the entirety of the web2py framework?


 I doubt that the profile would tell you much about the loop itself, but it 
 might show work going on elsewhere, which might be instructive.


 Clearly, the Welcome app is pointing to a fundamental issue with my 
 Ubuntu/Apache2/Python/web2py installation (assuming no one else can 
 replicate the problem). As the Linux server is a production system, I am 
 limited to how much tinkering I can actually do on it.

 BTW, how does one actually shutdown web2py once it's installed and running 
 via Apache?


 It's running as a wsgi process under Apache, so you really need to shut 
 down Apache, or at least reconfigure it to not run web2py and then do a 
 graceful restart.

 For this kind of testing (not production), it might be easier to run 
 web2py directly and use Rocket.


-- 
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/d/optout.


[web2py] Re: web2py on Mac OS Mavericks, trying to use port 80

2014-03-14 Thread Dave S
 
On Friday, March 14, 2014 9:51:55 AM UTC-7, LightDot wrote:

 Hello Manuel, welcome to the list.

 The issue you're seeing is not a bug, it's a feature of the OS or, rather, 
 of it's security settings. The same behavior can be observed on Linux, 
 FreeBSD, Solaris, ... any UN*X OS basically: non root users can't bind to 
 ports below 1024.

 This limit can be changed (per user or per process), but I don't recommend 
 this unless you understand all implications of doing so. There are other 
 ways around this, such as starting the process as root and then dropping 
 privileges, using a proxy that has such functionality, using iptables to 
 redirect ports, etc.

 Regards



Part of the  OP's question is, Should Web2Py give a diagnostic message 
when the listening port is unavailable?

Manuel has seen error messages from Rocket -- but only when using the 
command line to start web2py?  Does the graphical launcher hide these?

/dps


 On Friday, March 14, 2014 7:34:58 AM UTC+1, audi...@gmail.com wrote:

 Hello,
 Thanks to the team for the great tool !
 I have minor issues on Mac OS Mavericks, just wanted to check before 
 creating an issue on google code.

 System
 Mac OS 10.9.2
 $ which python
 /usr/bin/python
 $ python --version
 Python 2.7.5

 Steps
 download web2py_src.zip
 unzip the archive into $basedir
 from an Mac administrator account, launch Terminal
 $ cd $basedir
 $ python web2py.py
 ...
 Version 2.9.4-stable+timestamp.2014.03.05.04.44.09
 ...
 The web2py graphical interface launches
 Leave server ip on local
 Set Server Port to 80
 Enter a password in Choose password field
 Click on start server

 Expected result
 web2py framework, start listening on port 80

 Actual result
 The terminal output :
 ERROR:Rocket.Errors.Port80:Socket 127.0.0.1:80 in use by other process 
 and it won't share.
 WARNING:Rocket.Errors.Port80:Listener started when not ready.

 What have I tried
 Check active ports with Apple's network utility (port scan) : no active 
 port between 10 and 100

 Use 
 $ sudo python web2py.py
 instead of 
 $ python web2py.py
 Then you can actually launch web2py on port 80
 Terminal output :
 ...
 please visit:
 http://127.0.0.1/
 starting browser...

 It seems this is related to Mac OS policy to keep use of some ports for 
 it's own usage.
 My question is wether this is a bug or an enhancement request to have an 
 error message in the graphical web2py launch app to inform user ?
 (When using the Mac OS package instead of the source version, you don't 
 have any feedback on this issue, the server is just not starting).

 As this is my first post on this list, let me know if I made any mistake.
 thanks,
 Manuel



-- 
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/d/optout.


[web2py] Re: Understanding translation and accept-language header?

2014-03-14 Thread User
I'd really like to understand this.  If I set the current language to 'en', 
why does en-gb get translated but en-us does not get translated?

On Sunday, March 9, 2014 10:31:57 PM UTC-4, User wrote:

 So why do en-us and en-gb behave differently?  That is, why is en-gb 
 translated and en-us not translated?

 On Sunday, March 9, 2014 9:04:23 PM UTC-4, Massimo Di Pierro wrote:

 Because if T.current_languages: ['en'] it means you say that 'en' does 
 not need to be translated. This is the default behaviour.

 On Friday, 7 March 2014 17:49:23 UTC-6, User wrote:

 I made a bare bones app based on the welcome app:

 In db.py:
 T.current_languages = ['en']


 in en-us.py:
 # -*- coding: utf-8 -*-
 {
 '!langcode!': 'en-us',
 '!langname!': 'English (American)',
 'xyztest': 'Pass! (US English)'
 }

 in en-gb.py:
 # -*- coding: utf-8 -*-
 {
 '!langcode!': 'en-gb',
 '!langname!': 'English (British)',

 'xyztest': 'Pass! (UK)'

 }


 In a view:
 h2Language testing:/h2
 string: strong{{=T('xyztest')}}/strongbr
 current_languages: {{=T.current_languages}}br
 T.http_accept_language: {{=T.http_accept_language}}br
 T.accepted_language: {{=T.accepted_language}}br


 The rendered output of this is:

 string: *xyztest*
 T.current_languages: ['en']
 T.http_accept_language: en-us,en;q=0.5
 T.accepted_language: en-us

 Why does this not get translated? By contrast, if I set my browser 
 accept language to include en-gb the rendered output is:

 string:* Pass! (UK)*
 T.current_languages: ['en']
 T.http_accept_language: en-gb,en-us;q=0.7,en;q=0.3
 T.accepted_language: en-gb




-- 
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/d/optout.


Re: [web2py] Re: Fashion Marketplace in Web2py - Feedback needed

2014-03-14 Thread Francisco Costa
Thanks for the feedback Massimo,
I'm only focus on the Portuguese version for now, but soon I'll official
launch the EN version

Francisco Costa
http://franciscocosta.com


On Fri, Mar 14, 2014 at 4:30 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 I would make the BUY button bigger and call is Products. It was not
 obvious to me I could browse the products without committing to anything.
 ;-)


 On Friday, 14 March 2014 11:21:39 UTC-5, Francisco Costa wrote:

 No, you can browse the marketplace without login
 https://chique.pt/buy?lang=en

 Francisco Costa
 http://franciscocosta.com


 On Fri, Mar 14, 2014 at 4:17 PM, Massimo Di Pierro massimo@gmail.com
  wrote:

  Do I need to login? Is there more information one can see without
 login. Looks nice.


 On Friday, 14 March 2014 08:54:24 UTC-5, Francisco Costa wrote:

 Hi there,

 Just wanted to get some feedback form the web2py community about this
 new project:

 *CHIQUE* https://chique.pt/?lang=en is a mobile fashion marketplace
 built around real-time social experiences.
 Our vibrant community brings fashion lovers together to share their
 individual style, turning every closet into a unique shopping experience.
 Founded in 2014, we are headquartered at Porto, Portugal

 Thanks,
 Francisco Costa

  --
 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/_9kRTdzI2wk/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+un...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


  --
 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/_9kRTdzI2wk/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/d/optout.


-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Niphlod
Well well, it was some time that someone didn't start a web2py is slow(er) 
thread. 

start mode=resuming old dir of all kinds of tests to verify that the user 
is wrong

let's start clearing some field

ubuntu 12.10 64 bit, python 2.7.3. Original script:

# -*- coding: utf-8 -*-
import time
def test():
start = time.time()
x = 0.0
for i in range(1,5):
x += (float(i+10)*(i+25)+175.0)/3.14
res = str(time.time()-start)
return elapsed time: + res + '\n'

if __name__ == '__main__':
print test()

vs the attached app (one controller only, same function, without the 
__main__ logic). 
#commented lines is my brain working

 ./web2py.py -a password ...
 curl http://127.0.0.1:8000/pyperf/default/test
0.27 min, 0.32 max, ~0.29 mean
#kill web2py, we got a baseline
#let's execute the original script
 python originalscript.py
0.17 min, 0.25 max, ~0.20 mean
#oh gods. User is right... Something is slower. Ok, let's test web2py 
real overhead using shell mode
 ./web2py.py -M -S pyperf/default/test
0.17 min, 0.25 max, ~0.20 mean
#roger... something in the web world is making things slower. Maybe 
rocket or the infamous GIL ?!?!
#let's go with uwsgi!!!
 uwsgi -i web2py.ini
 curl http://127.0.0.1:8000/pyperf/default/test
0.25 min, 0.30 max, ~0.27 mean
# just kidding! even uwsgi is slower than originalscript.py. so it's web2py.
# wait a sec. I know a tonload of webframeworks, but I'll pick one of the 
smallest to introduce as less overhead as I can
# let's go with web.py (app_perf.py) 
 curl http://127.0.0.1:8000/pyperf
0.27 min, 0.31 max, ~0.29 mean
#gotta be kidding me. No taste whatsoever in choosing frameworks. All my 
choiches are taking 2x hit.
#let's go with the superduper flask (often recognized as one of the best 
performance-wise, without going full-blown esotherical)
# attached app_flask_perf.py
 curl http://127.0.0.1:8000/pyperf
0.27 min, 0.31 max, ~0.29 mean
# OMG! not frameworks' fault. this is wsgi fault.


So seems that web2py shell and python script behaves exactly the same 
(if web2py was introducing complexity it should show right there).
The same environment executed by rocket or uwsgi gets some gap (roughly 2x 
time).
uwsgi behaves a little better, but not that much (surely in concurrency but 
that's another deal).
Every wsgi implementation takes the hit, micro or macro framework.

S maybe the wsgi environment is posing some limits ?

-- 
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/d/optout.


web2py.app.pyperf.tar.gz
Description: Binary data
import web
import time

urls = (/pyperf, welcome)
app = web.application(urls, globals())


class welcome:

def GET(self):
start = time.time()
x = 0.0
for i in range(1,5):
x += (float(i+10)*(i+25)+175.0)/3.14
res = str(time.time()-start)
return elapsed time: + res + '\n'

if __name__ == __main__:
web.httpserver.runsimple(app.wsgifunc(), (127.0.0.1, 8000))
import time
from flask import Flask
app = Flask(__name__)

@app.route(/pyperf)
def hello():
start = time.time()
x = 0.0
for i in range(1,5):
x += (float(i+10)*(i+25)+175.0)/3.14
res = str(time.time()-start)
return elapsed time: + res + '\n'

if __name__ == __main__:
app.run(port=8000)

Re: [web2py] Re: Appadmin on 2.9.4

2014-03-14 Thread Niphlod
me neither but it may be related to static_version. A simple screenshot 
from firebug or chrome developers tools will tell us.

On Friday, March 14, 2014 5:43:41 PM UTC+1, Massimo Di Pierro wrote:

 Sorry I do not understand.



-- 
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/d/optout.


[web2py] Re: Pulling data from API for real-time calculation

2014-03-14 Thread Niphlod
if you do real-time calculations while the user presses buttons, it's 
supposed to return under 300ms. Online book states that part in 
environments where you do calculations in the background that takes more 
than 300ms (i.e. not real time).
usual webserver timeout is set to 30-60 seconds. 

On Friday, March 14, 2014 5:30:48 PM UTC+1, Martin wrote:

 Hi all,
 Please could anyone help me out, I need to pull some data from some API 
 (ex: https//xxx/aaa/ etc.) that returns json data type.
 I will take input from logged-in users (onkeyup event)  with the API 
 retured json to perform some real-time calculation  and then display the 
 result to the logged-in user.

 My question is how can i perform this following Massimo's advices in the 
 web2py online book,

 *...Ajax callbacks can be used to perform computations in the background, 
 but we recommend using cron or a background process instead (discussed in 
 chapter 4), since the web server enforces a timeout on threads. If the 
 computation takes too long, the web server kills it. Refer to your web 
 server parameters to set the timeout value...*

 * 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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 2:03 PM, Niphlod niph...@gmail.com wrote:
 So seems that web2py shell and python script behaves exactly the same (if 
 web2py was introducing complexity it should show right there).
 The same environment executed by rocket or uwsgi gets some gap (roughly 2x 
 time).
 uwsgi behaves a little better, but not that much (surely in concurrency but 
 that's another deal).
 Every wsgi implementation takes the hit, micro or macro framework.
 
 S maybe the wsgi environment is posing some limits ?

Setting aside that your 2x is a lot better than HH's, what's been bothering me 
(assuming the effect is real) is: what could possibly be the mechanism? 

Running it with web2py -S eliminates some possibilities, too, relating to the 
restricted environment stuff. 

So I'm thinking it must be thread activity. Yappi comes to mind, but not sure 
how to invoke it in a wsgi environment.

-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 2:16 PM, Jonathan Lundell jlund...@pobox.com wrote:
 On 14 Mar 2014, at 2:03 PM, Niphlod niph...@gmail.com wrote:
 So seems that web2py shell and python script behaves exactly the same 
 (if web2py was introducing complexity it should show right there).
 The same environment executed by rocket or uwsgi gets some gap (roughly 2x 
 time).
 uwsgi behaves a little better, but not that much (surely in concurrency but 
 that's another deal).
 Every wsgi implementation takes the hit, micro or macro framework.
 
 S maybe the wsgi environment is posing some limits ?
 
 Setting aside that your 2x is a lot better than HH's, what's been bothering 
 me (assuming the effect is real) is: what could possibly be the mechanism? 
 
 Running it with web2py -S eliminates some possibilities, too, relating to the 
 restricted environment stuff. 
 
 So I'm thinking it must be thread activity. Yappi comes to mind, but not sure 
 how to invoke it in a wsgi environment.
 
 

How about Rocket with min  max threads set to 1?

-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Niphlod

On Friday, March 14, 2014 10:17:40 PM UTC+1, Jonathan Lundell wrote:

 On 14 Mar 2014, at 2:16 PM, Jonathan Lundell jlun...@pobox.comjavascript: 
 wrote:

 Setting aside that your 2x is a lot better than HH's, what's been 
 bothering me (assuming the effect is real) is: what could possibly be the 
 mechanism? 


I'm always luckier than users. What can I say ? I love my computer ^__^
 


 Running it with web2py -S eliminates some possibilities, too, relating to 
 the restricted environment stuff. 

 That's what I thought

 So I'm thinking it must be thread activity. Yappi comes to mind, but not 
 sure how to invoke it in a wsgi environment.

 How about Rocket with min  max threads set to 1?


ykes!

0.23 min, 0.27 max, ~0.25 mean

-- 
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/d/optout.


[web2py] Re: Help with SQL Query without using executesql preferably :)

2014-03-14 Thread brahama von
Thanks Cliff. But i don´t think it is that simple, or perhaps it is, but i 
can't manage to build the right query.
If i use group by, it groups by the id and the having=max is ignored. all 
ids appear.
Probably it needs joins. Will try to do the raw query and see if anyone can 
translate it. Thanks

El lunes, 10 de marzo de 2014 18:21:51 UTC-3, Cliff Kachinske escribió:

 The DAL chapter of the online Web2py manual explains how to fetch the max 
 value, same as a SQL GROUP BY.

 On Monday, March 10, 2014 3:54:59 PM UTC-4, brahama von wrote:

 This is the result i get from a simple select like this:

 legacy_db(legacy_db.cursodado.gp_pro_id==course).select()

 cursodado.gp_id cursodado.gp_pro_id cursodado.gp_historicdate 
 cursodado.gp_curso_id 

 10003600042014-01-27 16:02:10None


 10003600042014-01-27 17:18:31None


 10003600042014-01-27 17:21:02None


 10005250042014-01-27 16:02:10None


 10005250042014-01-27 17:18:31None


 10005250042014-01-27 17:21:02None









 Here i get the id of the person and the id of the course but I want only 
 to show the first I once, that correspond to the 
 max(cursodado.gp_historicdate)
 To see it like this:

 cursodado.gp_id cursodado.gp_pro_id cursodado.gp_historicdate 
 cursodado.gp_curso_id 








 10003600042014-01-27 17:21:02None








 10005250042014-01-27 17:21:02None

 tried this in the select but it gives a timeout:

 select(groupby=gp_id,having=max(historicdate 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/d/optout.


Re: [web2py] Re: Appadmin on 2.9.4

2014-03-14 Thread Dewes
Maybe in apache2, on default config you have this line:

AliasMatch ^/([^/]+)/static/(.*)   
 /var/www/web2py/applications/$1/static/$2

Change it to:
 AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*)   
 /var/www/web2py/applications/$1/static/$2

At least that solved my problem.

This makes apache ignore statics with versioning.

Em sexta-feira, 14 de março de 2014 18h11min50s UTC-3, Niphlod escreveu:

 me neither but it may be related to static_version. A simple screenshot 
 from firebug or chrome developers tools will tell us.

 On Friday, March 14, 2014 5:43:41 PM UTC+1, Massimo Di Pierro wrote:

 Sorry I do not understand.



-- 
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/d/optout.


[web2py] Re: Bootstrap3 package - help to test

2014-03-14 Thread Brando
Paolo, I got everything moved over.  So far no problems.  I'm trying to 
figure out the best way to style a SQLFORM.grid without using custom js. 
What is the easiest way to style the SQLFORM.grid with bootstrap3?





On Thursday, March 13, 2014 8:59:07 AM UTC-7, Brando wrote:

 Just found this Post.  Thanks Paolo.  I'll move my app over to this 
 template and report any issues I find.




 On Monday, December 23, 2013 12:20:48 PM UTC-8, Paolo Caruccio wrote:

 I just completed a package that applies the bootstrap3 style to some 
 web2py elements - the current version covers the navigation menus, the auth 
 navbar and SQLFORMs (via formstyle) - but I need your help for testing it.

 The package includes the following files:

  - bootstrap3.py
  - web2py-bootstrap3.css
  - web2py-bootstrap3.js
  - example of layout.html
  - a readme file containing the istallation and usage instructions
  - license (please report if the license is right for a future inclusion 
 in web2py)

 Here attached some screenshots and a web2py app with examples. 

 Thank you in advance for your feedbacks, suggestions for optimizing the 
 code and any additions and everything else useful to improve the package.

 Marry Christmas. 







-- 
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/d/optout.


[web2py] Re: Understanding translation and accept-language header?

2014-03-14 Thread LightDot
I'm less familiar with the translation parts of web2py that I'd like to be, 
but is this connected with the definitions of:

'!langcode!': 'en-us',
'!langname!': 'English (US)',

that can be found in languages/default.py?

Regards


On Friday, March 14, 2014 8:39:21 PM UTC+1, User wrote:

 I'd really like to understand this.  If I set the current language to 
 'en', why does en-gb get translated but en-us does not get translated?

 On Sunday, March 9, 2014 10:31:57 PM UTC-4, User wrote:

 So why do en-us and en-gb behave differently?  That is, why is en-gb 
 translated and en-us not translated?

 On Sunday, March 9, 2014 9:04:23 PM UTC-4, Massimo Di Pierro wrote:

 Because if T.current_languages: ['en'] it means you say that 'en' does 
 not need to be translated. This is the default behaviour.

 On Friday, 7 March 2014 17:49:23 UTC-6, User wrote:

 I made a bare bones app based on the welcome app:

 In db.py:
 T.current_languages = ['en']


 in en-us.py:
 # -*- coding: utf-8 -*-
 {
 '!langcode!': 'en-us',
 '!langname!': 'English (American)',
 'xyztest': 'Pass! (US English)'
 }

 in en-gb.py:
 # -*- coding: utf-8 -*-
 {
 '!langcode!': 'en-gb',
 '!langname!': 'English (British)',

 'xyztest': 'Pass! (UK)'

 }


 In a view:
 h2Language testing:/h2
 string: strong{{=T('xyztest')}}/strongbr
 current_languages: {{=T.current_languages}}br
 T.http_accept_language: {{=T.http_accept_language}}br
 T.accepted_language: {{=T.accepted_language}}br


 The rendered output of this is:

 string: *xyztest*
 T.current_languages: ['en']
 T.http_accept_language: en-us,en;q=0.5
 T.accepted_language: en-us

 Why does this not get translated? By contrast, if I set my browser 
 accept language to include en-gb the rendered output is:

 string:* Pass! (UK)*
 T.current_languages: ['en']
 T.http_accept_language: en-gb,en-us;q=0.7,en;q=0.3
 T.accepted_language: en-gb




-- 
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/d/optout.


[web2py] Re: Bootstrap3 package - help to test

2014-03-14 Thread LightDot
Are you looking for ways to set the required css class for the table itself 
or anything more?

For example, you can manipulate the DOM for the table class. It's not a 
perfect approach, but should do for the time being:

grid = SQLFORM.grid (...code...)
grid.element('table', replace=lambda el: el.add_class(
   'table table-striped table-condensed'))

Regards


On Saturday, March 15, 2014 1:46:58 AM UTC+1, Brando wrote:

 Paolo, I got everything moved over.  So far no problems.  I'm trying to 
 figure out the best way to style a SQLFORM.grid without using custom js. 
 What is the easiest way to style the SQLFORM.grid with bootstrap3?





 On Thursday, March 13, 2014 8:59:07 AM UTC-7, Brando wrote:

 Just found this Post.  Thanks Paolo.  I'll move my app over to this 
 template and report any issues I find.




 On Monday, December 23, 2013 12:20:48 PM UTC-8, Paolo Caruccio wrote:

 I just completed a package that applies the bootstrap3 style to some 
 web2py elements - the current version covers the navigation menus, the auth 
 navbar and SQLFORMs (via formstyle) - but I need your help for testing it.

 The package includes the following files:

  - bootstrap3.py
  - web2py-bootstrap3.css
  - web2py-bootstrap3.js
  - example of layout.html
  - a readme file containing the istallation and usage instructions
  - license (please report if the license is right for a future inclusion 
 in web2py)

 Here attached some screenshots and a web2py app with examples. 

 Thank you in advance for your feedbacks, suggestions for optimizing the 
 code and any additions and everything else useful to improve the package.

 Marry Christmas. 







-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
I don't understand logging. How do I examine the log? Where is it??


On Friday, 14 March 2014 18:29:15 UTC-4, Michele Comitini wrote:

 Can you try with the following? 

 note: no DAL, no sessions 

 2014-03-14 22:23 GMT+01:00 Niphlod nip...@gmail.com javascript:: 
  
  On Friday, March 14, 2014 10:17:40 PM UTC+1, Jonathan Lundell wrote: 
  
  On 14 Mar 2014, at 2:16 PM, Jonathan Lundell jlun...@pobox.com 
 wrote: 
  
  Setting aside that your 2x is a lot better than HH's, what's been 
  bothering me (assuming the effect is real) is: what could possibly be 
 the 
  mechanism? 
  
  
  I'm always luckier than users. What can I say ? I love my computer ^__^ 
  
  
  
  Running it with web2py -S eliminates some possibilities, too, relating 
 to 
  the restricted environment stuff. 
  
  That's what I thought 
  
  So I'm thinking it must be thread activity. Yappi comes to mind, but 
 not 
  sure how to invoke it in a wsgi environment. 
  
  How about Rocket with min  max threads set to 1? 
  
  
  ykes! 
  
  0.23 min, 0.27 max, ~0.25 mean 
  
  -- 
  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/d/optout. 


-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread horridohobbyist
Astonishingly, I've discovered something else...

When I ran the test in my newly-created VM, I only ran it once. Later, I 
noticed I wasn't getting the 30x ratio anymore; I was only getting 2x, like 
Niphlod did.

Luckily, I had taken a snapshot of the VM before running the test, so I 
reverted back to it. This time, I ran the test repeatedly. Here are the 
results:

elapsed time: 0.0515658855438
elapsed time: 0.00306177139282
elapsed time: 0.00300478935242
elapsed time: 0.00301694869995
elapsed time: 0.00319504737854

Note that it is only *the first run* that shows the 30x ratio. Thereafter, 
I'm only getting the 2x ratio. *This pattern is repeatable*.

I wish I could get 2x ratio on my production server; I could live with 
that. However, I'm still getting 30x. For some reason, it's not settling 
down to 2x like in my VM. Go figure.


On Friday, 14 March 2014 15:21:12 UTC-4, horridohobbyist wrote:

 Okay, I have some excellent news to report. Well, excellent for me, not so 
 much for you guys...

 I can reproduce the problem on another system. Here's what I did:

 My Mac has Parallels installed. I created a new VM, downloaded Ubuntu 
 Server 12.04, and installed it. Then I updated it with the latest patches.

 Then, following the recipe from the Book for One step production 
 deployment, I installed web2py 2.9.4.

 I then ran the same Welcome vs command line test. The result?

 Welcome:
 elapsed time: 0.0491468906403

 command line:
 elapsed time: 0.00160121917725

 Again, the command line is 30.6 times faster!!!

 What more evidence do you need? Sorry to say, but there is something wrong 
 with web2py.


 On Friday, 14 March 2014 14:44:58 UTC-4, Jonathan Lundell wrote:

 On 14 Mar 2014, at 11:28 AM, horridohobbyist horrido...@gmail.com 
 wrote:

 First, I don't know how to use the profiler.

 Second, for something as trivially simple as the Welcome app with the 
 calculation loop, what is the profiler going to tell us? That simple 
 multiplication and division are too slow? That the for loop is somehow 
 broken?

 Should I try to profile the entirety of the web2py framework?


 I doubt that the profile would tell you much about the loop itself, but 
 it might show work going on elsewhere, which might be instructive.


 Clearly, the Welcome app is pointing to a fundamental issue with my 
 Ubuntu/Apache2/Python/web2py installation (assuming no one else can 
 replicate the problem). As the Linux server is a production system, I am 
 limited to how much tinkering I can actually do on it.

 BTW, how does one actually shutdown web2py once it's installed and 
 running via Apache?


 It's running as a wsgi process under Apache, so you really need to shut 
 down Apache, or at least reconfigure it to not run web2py and then do a 
 graceful restart.

 For this kind of testing (not production), it might be easier to run 
 web2py directly and use Rocket.



-- 
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/d/optout.


[web2py] SmartGrid Add make a Fld Readonly

2014-03-14 Thread Dan Kozlowski
Can someone tell me how within a smartgrids I can make a Fld readonly  on 
the add and update ?

I have tried the following in the controller and it does not work.

db.clients.writeable=False

-- 
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/d/optout.


[web2py] database callback return an error when using bulk_insert

2014-03-14 Thread 黄祥
hi,

i have a database callback when using bulk_insert it return an error :

db(db.product.id == f.product).update(quantity = db.product(f.product).quantity 
+ f.quantity)
AttributeError: 'list' object has no attribute 'product'


here is the code that produce error above:
*# error traceback*
*models/db.py*
def __after_insert_purchase_order_detail(f, id):
db(db.product.id == f.product).update(quantity = 
db.product(f.product).quantity + f.quantity)

# callbacks
db.purchase_order_detail._after_insert.append(__after_insert_purchase_order_detail)

*controllers/install.py*
# purchase_order_detail
db.purchase_order_detail.bulk_insert([{purchase_order_no : 1, product : 
1, quantity : 1, 
   price : 1, amount : 1, total : 2}, 
  {purchase_order_no : 1, product : 2, quantity : 1, 
   price : 1, amount : 1, total : 2}, ])

i run several test that is work are :
*# callback work when using insert not bulk_insert*
*models/db.py*
def __after_insert_purchase_order_detail(f, id):
db(db.product.id == f.product).update(quantity = 
db.product(f.product).quantity + f.quantity)

# callbacks
db.purchase_order_detail._after_insert.append(__after_insert_purchase_order_detail)

*controllers/install.py*
# purchase_order_detail
db.purchase_order_detail.insert(purchase_order_no = 1, product = 1, 
quantity= 1, price = 1, 
amount = 1, total = 1 )

*#using bulk_insert is work when i put the condition on callback*
*models/db.py*
def __after_insert_purchase_order_detail(f, id):
db(db.product.id == f.product).update(quantity = 
db.product(f.product).quantity + f.quantity)

if not request.controller == 'install':
# callbacks
purchase_order_detail._after_insert.append(__after_insert_purchase_order_detail)

*controllers/install.py*
# purchase_order_detail
db.purchase_order_detail.bulk_insert([{purchase_order_no : 1, product : 
1, quantity : 1, 
   price : 1, amount : 1, total : 2}, 
  {purchase_order_no : 1, product : 2, quantity : 1, 
   price : 1, amount : 1, total : 2}, ])

my question is why the callback is not work when i use bulk_insert?

thanks and best regards,
stifan

-- 
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/d/optout.


[web2py] Re: SmartGrid Add make a Fld Readonly

2014-03-14 Thread 黄祥
i think you can achieve it using conditional for that.
e.g.
write_in_form = 'add' in request.args or 'edit' in request.args

db.clients.writeable = not write_in_form 

best regards,
stifan

-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Mariano Reingart
Is web2py bytecode compiled?
.pyo or .pyc appears in gluon folder?
Maybe in tour production server there is some permission/date issue and
.pyc files cannot be saved, so they are compiled on each run (that takes
time).

Just and idea

Best regards,



Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com


On Fri, Mar 14, 2014 at 11:33 PM, horridohobbyist horrido.hobb...@gmail.com
 wrote:

 Astonishingly, I've discovered something else...

 When I ran the test in my newly-created VM, I only ran it once. Later, I
 noticed I wasn't getting the 30x ratio anymore; I was only getting 2x, like
 Niphlod did.

 Luckily, I had taken a snapshot of the VM before running the test, so I
 reverted back to it. This time, I ran the test repeatedly. Here are the
 results:

 elapsed time: 0.0515658855438
 elapsed time: 0.00306177139282
 elapsed time: 0.00300478935242
 elapsed time: 0.00301694869995
 elapsed time: 0.00319504737854

 Note that it is only *the first run* that shows the 30x ratio.
 Thereafter, I'm only getting the 2x ratio. *This pattern is repeatable*.

 I wish I could get 2x ratio on my production server; I could live with
 that. However, I'm still getting 30x. For some reason, it's not settling
 down to 2x like in my VM. Go figure.


 On Friday, 14 March 2014 15:21:12 UTC-4, horridohobbyist wrote:

 Okay, I have some excellent news to report. Well, excellent for me, not
 so much for you guys...

 I can reproduce the problem on another system. Here's what I did:

 My Mac has Parallels installed. I created a new VM, downloaded Ubuntu
 Server 12.04, and installed it. Then I updated it with the latest patches.

 Then, following the recipe from the Book for One step production
 deployment, I installed web2py 2.9.4.

 I then ran the same Welcome vs command line test. The result?

 Welcome:
 elapsed time: 0.0491468906403

 command line:
 elapsed time: 0.00160121917725

 Again, the command line is 30.6 times faster!!!

 What more evidence do you need? Sorry to say, but there is something
 wrong with web2py.


 On Friday, 14 March 2014 14:44:58 UTC-4, Jonathan Lundell wrote:

 On 14 Mar 2014, at 11:28 AM, horridohobbyist horrido...@gmail.com
 wrote:

 First, I don't know how to use the profiler.

 Second, for something as trivially simple as the Welcome app with the
 calculation loop, what is the profiler going to tell us? That simple
 multiplication and division are too slow? That the for loop is somehow
 broken?

 Should I try to profile the entirety of the web2py framework?


 I doubt that the profile would tell you much about the loop itself, but
 it might show work going on elsewhere, which might be instructive.


 Clearly, the Welcome app is pointing to a fundamental issue with my
 Ubuntu/Apache2/Python/web2py installation (assuming no one else can
 replicate the problem). As the Linux server is a production system, I am
 limited to how much tinkering I can actually do on it.

 BTW, how does one actually shutdown web2py once it's installed and
 running via Apache?


 It's running as a wsgi process under Apache, so you really need to shut
 down Apache, or at least reconfigure it to not run web2py and then do a
 graceful restart.

 For this kind of testing (not production), it might be easier to run
 web2py directly and use Rocket.

  --
 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/d/optout.


-- 
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/d/optout.


Re: [web2py] Re: Python Performance Issue

2014-03-14 Thread Jonathan Lundell
On 14 Mar 2014, at 9:13 PM, Mariano Reingart reing...@gmail.com wrote:
 Is web2py bytecode compiled?
 .pyo or .pyc appears in gluon folder?
 Maybe in tour production server there is some permission/date issue and .pyc 
 files cannot be saved, so they are compiled on each run (that takes time).
 

But the compilation is O(1), and shouldn't be affected by the iteration count.

-- 
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/d/optout.


Re: [web2py] Web2py on Koding.com

2014-03-14 Thread 黄祥
please take a look at :
http://www.web2pyslices.com/slice/show/1956/install-web2py-on-kodingcom

what is still outstanding is about the admin page still can not reach it 
said :
admin disabled because unable to access password file

perhaps experts in here, have the solution for that
already tested :
cd /home/www-data/web2py
sudo -u www-data python -c from gluon.widget import console; console();
sudo -u www-data python -c from gluon.main import save_password; 
save_password(raw_input('admin password: '),443)

but still got the same result

best regards,
stifan

-- 
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/d/optout.