[web2py] Invalid boundary in multipart form?

2010-05-05 Thread vince
i am trying to implement the html5 multiple file upload with progress
http://webreflection.blogspot.com/2009/03/safari-4-multiple-upload-with-progress.html
to web2py, it comes with example on php.

but i run into some parsing error from python's cgi library. is it
possible to turn off auto variable parsing on a specific controller
function so i can read header and wsgi_input directly?


this is the error i got:

Traceback (most recent call last):
  File "gluon/main.py", line 337, in wsgibase
parse_get_post_vars(request, environ)
  File "gluon/main.py", line 224, in parse_get_post_vars
dpost =
cgi.FieldStorage(fp=request.body,environ=environ,keep_blank_values=1)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/cgi.py", line 525, in __init__
self.read_multi(environ, keep_blank_values, strict_parsing)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/cgi.py", line 641, in read_multi
raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,)
ValueError: Invalid boundary in multipart form: ''


[web2py] Re: new dal

2010-02-23 Thread vince
seems to be working fine on 1.75.4.

so are we getting support of nosql database soon =)

On Feb 6, 12:14 am, mdipierro  wrote:
> I encourage eveybody running from source to try the newdal:
>
> cd gluon
> cp sql.py sql.py.bak
> cpdal.py sal.py
>
> and restart web2py.
> Let me know what works or does not work.
>
> Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] any quick workaround for the datetime strftime() methods require year >= 1900

2010-02-25 Thread vince
i run into some rare problem on web2py it's related to python's
limitation/bugs

Traceback (most recent call last):
  File "/Library/WebServer/Documents/web2py/gluon/restricted.py", line
173, in restricted
exec ccode in environment
  File "/Library/WebServer/Documents/web2py/applications/cychurch/
controllers/members.py", line 2523, in 
  File "/Library/WebServer/Documents/web2py/gluon/globals.py", line
96, in 
self._caller = lambda f: f()
  File "/Library/WebServer/Documents/web2py/applications/cychurch/
controllers/members.py", line 72, in show
 
form1=SQLFORM(db.members,thisrecord,fields=field1,deletable=False,showid=False,labels=header1,submit_button=T('Submit'))
  File "/Library/WebServer/Documents/web2py/gluon/sqlhtml.py", line
656, in __init__
default = field.formatter(default)
  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 2676,
in formatter
  File "/Library/WebServer/Documents/web2py/gluon/validators.py", line
2214, in formatter
return self.other.formatter(value)
  File "/Library/WebServer/Documents/web2py/gluon/validators.py", line
1960, in formatter
return value.strftime(self.format)
ValueError: year=1897 is before 1900; the datetime strftime() methods
require year >= 1900


is there any quick workaround for it? any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: any quick workaround for the datetime strftime() methods require year >= 1900

2010-02-25 Thread vince
is it just for years for B.C.? but currently python's strftime even
have error when it's year >= 1900.

On Feb 26, 1:09 pm, mdipierro  wrote:
> what about about we do something like this in web2py?
>
> def format_date(d, format):
>      format = format.replace('%y',str(d.year)[-2:])
>      if d.year>=0:
>          format = format.replace('%Y',str(d.year))
>      else:
>          format = format.replace('%Y',str(d.year)+'B.C.')
>      d =
> datetime.datetime(2000,d.month,d.day,d.hour,d.minute,d.second)
>      return d.strftime(format)
>
> On Feb 25, 10:47 pm, vince  wrote:
>
> > i run into some rare problem on web2py it's related to python's
> > limitation/bugs
>
> > Traceback (most recent call last):
> >   File "/Library/WebServer/Documents/web2py/gluon/restricted.py", line
> > 173, in restricted
> >     exec ccode in environment
> >   File "/Library/WebServer/Documents/web2py/applications/cychurch/
> > controllers/members.py", line 2523, in 
> >   File "/Library/WebServer/Documents/web2py/gluon/globals.py", line
> > 96, in 
> >     self._caller = lambda f: f()
> >   File "/Library/WebServer/Documents/web2py/applications/cychurch/
> > controllers/members.py", line 72, in show
>
> > form1=SQLFORM(db.members,thisrecord,fields=field1,deletable=False,showid=False,labels=header1,submit_button=T('Submit'))
> >   File "/Library/WebServer/Documents/web2py/gluon/sqlhtml.py", line
> > 656, in __init__
> >     default = field.formatter(default)
> >   File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 2676,
> > in formatter
> >   File "/Library/WebServer/Documents/web2py/gluon/validators.py", line
> > 2214, in formatter
> >     return self.other.formatter(value)
> >   File "/Library/WebServer/Documents/web2py/gluon/validators.py", line
> > 1960, in formatter
> >     return value.strftime(self.format)
> > ValueError: year=1897 is before 1900; the datetime strftime() methods
> > require year >= 1900
>
> > is there any quick workaround for it? any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: any quick workaround for the datetime strftime() methods require year >= 1900

2010-02-25 Thread vince
it's just osx and windows problem since i've just google it. it's a
known problem on python.

ValueError: year=1897 is before 1900; the datetime strftime() methods
require year >= 1900



On Feb 26, 1:20 pm, mdipierro  wrote:
> No it work for every date but just B.C.
>
> On Feb 25, 11:14 pm, vince  wrote:
>
> > is it just for years for B.C.? but currently python's strftime even
> > have error when it's year >= 1900.
>
> > On Feb 26, 1:09 pm, mdipierro  wrote:
>
> > > what about about we do something like this in web2py?
>
> > > def format_date(d, format):
> > >      format = format.replace('%y',str(d.year)[-2:])
> > >      if d.year>=0:
> > >          format = format.replace('%Y',str(d.year))
> > >      else:
> > >          format = format.replace('%Y',str(d.year)+'B.C.')
> > >      d =
> > > datetime.datetime(2000,d.month,d.day,d.hour,d.minute,d.second)
> > >      return d.strftime(format)
>
> > > On Feb 25, 10:47 pm, vince  wrote:
>
> > > > i run into some rare problem on web2py it's related to python's
> > > > limitation/bugs
>
> > > > Traceback (most recent call last):
> > > >   File "/Library/WebServer/Documents/web2py/gluon/restricted.py", line
> > > > 173, in restricted
> > > >     exec ccode in environment
> > > >   File "/Library/WebServer/Documents/web2py/applications/cychurch/
> > > > controllers/members.py", line 2523, in 
> > > >   File "/Library/WebServer/Documents/web2py/gluon/globals.py", line
> > > > 96, in 
> > > >     self._caller = lambda f: f()
> > > >   File "/Library/WebServer/Documents/web2py/applications/cychurch/
> > > > controllers/members.py", line 72, in show
>
> > > > form1=SQLFORM(db.members,thisrecord,fields=field1,deletable=False,showid=False,labels=header1,submit_button=T('Submit'))
> > > >   File "/Library/WebServer/Documents/web2py/gluon/sqlhtml.py", line
> > > > 656, in __init__
> > > >     default = field.formatter(default)
> > > >   File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 2676,
> > > > in formatter
> > > >   File "/Library/WebServer/Documents/web2py/gluon/validators.py", line
> > > > 2214, in formatter
> > > >     return self.other.formatter(value)
> > > >   File "/Library/WebServer/Documents/web2py/gluon/validators.py", line
> > > > 1960, in formatter
> > > >     return value.strftime(self.format)
> > > > ValueError: year=1897 is before 1900; the datetime strftime() methods
> > > > require year >= 1900
>
> > > > is there any quick workaround for it? any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: any quick workaround for the datetime strftime() methods require year >= 1900

2010-02-25 Thread vince
ohoh! you are the man... that was quick! yes i tried and it just work!

On Feb 26, 1:32 pm, mdipierro  wrote:
> I tried. It does not work for year<=0 but works otherwise. It is now
> in trunk. Nothing for you to do. Just upgrade and retry your code.
> Should work.
>
> On Feb 25, 11:14 pm, vince  wrote:
>
> > is it just for years for B.C.? but currently python's strftime even
> > have error when it's year >= 1900.
>
> > On Feb 26, 1:09 pm, mdipierro  wrote:
>
> > > what about about we do something like this in web2py?
>
> > > def format_date(d, format):
> > >      format = format.replace('%y',str(d.year)[-2:])
> > >      if d.year>=0:
> > >          format = format.replace('%Y',str(d.year))
> > >      else:
> > >          format = format.replace('%Y',str(d.year)+'B.C.')
> > >      d =
> > > datetime.datetime(2000,d.month,d.day,d.hour,d.minute,d.second)
> > >      return d.strftime(format)
>
> > > On Feb 25, 10:47 pm, vince  wrote:
>
> > > > i run into some rare problem on web2py it's related to python's
> > > > limitation/bugs
>
> > > > Traceback (most recent call last):
> > > >   File "/Library/WebServer/Documents/web2py/gluon/restricted.py", line
> > > > 173, in restricted
> > > >     exec ccode in environment
> > > >   File "/Library/WebServer/Documents/web2py/applications/cychurch/
> > > > controllers/members.py", line 2523, in 
> > > >   File "/Library/WebServer/Documents/web2py/gluon/globals.py", line
> > > > 96, in 
> > > >     self._caller = lambda f: f()
> > > >   File "/Library/WebServer/Documents/web2py/applications/cychurch/
> > > > controllers/members.py", line 72, in show
>
> > > > form1=SQLFORM(db.members,thisrecord,fields=field1,deletable=False,showid=False,labels=header1,submit_button=T('Submit'))
> > > >   File "/Library/WebServer/Documents/web2py/gluon/sqlhtml.py", line
> > > > 656, in __init__
> > > >     default = field.formatter(default)
> > > >   File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 2676,
> > > > in formatter
> > > >   File "/Library/WebServer/Documents/web2py/gluon/validators.py", line
> > > > 2214, in formatter
> > > >     return self.other.formatter(value)
> > > >   File "/Library/WebServer/Documents/web2py/gluon/validators.py", line
> > > > 1960, in formatter
> > > >     return value.strftime(self.format)
> > > > ValueError: year=1897 is before 1900; the datetime strftime() methods
> > > > require year >= 1900
>
> > > > is there any quick workaround for it? any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] database is locked

2010-03-04 Thread vince
i always got the error on 1.75.5. i am upgrading to 1.76.3 and see how
it goes.

i am using sqlite and it's not for heavy usage, is it suppose to be
delay instead of return error when the db file is locked?



  File "/home/web2py/gluon/sql.py", line 3042, in select
rows = response(query)
  File "/home/web2py/gluon/sql.py", line 3037, in response
db._execute(query)
  File "/home/web2py/gluon/sql.py", line 895, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
OperationalError: database is locked

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: database is locked

2010-03-04 Thread vince
here's some more errorlog just fyi.

actually it's easy to reproduce when opening page with lots of image
needs to be download via web2py

Traceback (most recent call last):
  File "/home/web2py/gluon/main.py", line 488, in wsgibase
session._try_store_in_db(request, response)
  File "/home/web2py/gluon/globals.py", line 358, in _try_store_in_db
record_id = table.insert(**dd)
  File "/home/web2py/gluon/sql.py", line 1879, in insert
self._db._execute(query)
  File "/home/web2py/applications/skyyer/models/db.py", line 76, in

db['_execute']=lambda *a,**b:
timer(db,lambda:db._cursor.execute(*a,**b))
  File "/home/web2py/applications/skyyer/models/db.py", line 73, in
timer
f()
  File "/home/web2py/applications/skyyer/models/db.py", line 76, in

db['_execute']=lambda *a,**b:
timer(db,lambda:db._cursor.execute(*a,**b))
OperationalError: database is locked


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: database is locked

2010-03-04 Thread vince
when migrate=False it fixed the .table locking problem. but this
database locking issue is just another one, actually it's just a
single user application and i still have this problem.

i think it should be delay instead of return error when the file is
locked. same case apply to .table files although migrate=False can fix
it.

On Mar 5, 5:50 am, Thadeus Burgess  wrote:
> Vince has had this problem in the past, and it was due to the .table
> files being locked, he solved it by setting migrate=False.
>
> Has he forgotten about this?
>
> I just did a quick search on the groups for "lots of images"
>
> -Thadeus
>
>
>
> On Thu, Mar 4, 2010 at 3:23 PM, Jonathan Lundell  wrote:
> > On Mar 4, 2010, at 1:08 PM, Thadeus Burgess wrote:
>
> >> The issue is that sqlite database is locked every time it is accessed.
> >> So if you have a-lot of concurrent requests, some of those will fail
> >> due to it being locked by other threads.
>
> >> The solution is to use a database that does not rely on locking such
> >> as postgresql or mysql.
>
> > Vince is right, though: there's no reason to crash. The locking is just for 
> > serializing. Something seems wrong; if this were normal, SQLite would be 
> > useless.
>
> >> -Thadeus
>
> >> On Thu, Mar 4, 2010 at 2:57 PM, vince  wrote:
> >>> here's some more errorlog just fyi.
>
> >>> actually it's easy to reproduce when opening page with lots of image
> >>> needs to be download via web2py
>
> >>> Traceback (most recent call last):
> >>>  File "/home/web2py/gluon/main.py", line 488, in wsgibase
> >>>    session._try_store_in_db(request, response)
> >>>  File "/home/web2py/gluon/globals.py", line 358, in _try_store_in_db
> >>>    record_id = table.insert(**dd)
> >>>  File "/home/web2py/gluon/sql.py", line 1879, in insert
> >>>    self._db._execute(query)
> >>>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
> >>> 
> >>>    db['_execute']=lambda *a,**b:
> >>> timer(db,lambda:db._cursor.execute(*a,**b))
> >>>  File "/home/web2py/applications/skyyer/models/db.py", line 73, in
> >>> timer
> >>>    f()
> >>>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
> >>> 
> >>>    db['_execute']=lambda *a,**b:
> >>> timer(db,lambda:db._cursor.execute(*a,**b))
> >>> OperationalError: database is locked
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] sqlite timeout setting?

2010-03-17 Thread vince
i understand sqlite is not for heavy usage. i just want to know is
there any way to set the timeout for database file access before
returning "database is locked" error?

also is there any way to catch the error and return some "busy" error
page?


although i do not have problem with for eg. mysql, but i still want to
know is there any way to catch the error if mysql server is down?


-vince

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: sqlite timeout setting?

2010-03-17 Thread vince
Traceback (most recent call last):
  File "/home/web2py/gluon/main.py", line 518, in wsgibase
session._try_store_in_db(request, response)
  File "/home/web2py/gluon/globals.py", line 356, in _try_store_in_db
table._db(table.id == record_id).update(**dd)
  File "/home/web2py/gluon/sql.py", line 3244, in update
self._db._execute(query)
  File "/home/web2py/gluon/sql.py", line 895, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
OperationalError: database is locked

i've google about sqlite and some say that sqlite have a default
timeout of 5 seconds.

i think it should be able to catch the error when the database file is
locked, for other sql database we should be able to catch the error
too when the sql server is down.

-vince

On Mar 17, 10:39 pm, mdipierro  wrote:
> What error do you get? What triggers it? I do not think it related to
> timeout of database.
>
> On Mar 17, 6:01 am, vince  wrote:
>
> > i understand sqlite is not for heavy usage. i just want to know is
> > there any way to set the timeout for database file access before
> > returning "database is locked" error?
>
> > also is there any way to catch the error and return some "busy" error
> > page?
>
> > although i do not have problem with for eg. mysql, but i still want to
> > know is there any way to catch the error if mysql server is down?
>
> > -vince

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: sqlite timeout setting?

2010-03-17 Thread vince
mutliprocess yes. i am running under mod_wsgi with single thread but
multi process.

i do assume the sqlite driver should try to acquire the database file
lock for a specific time instead of return error right away? or is
there any way to catch the error and return some busy page? it should
be apply to other database. for example when mysql server is down.

the error just appear once in a while so i think it should be just two
process trying to access the database at once.


On Mar 18, 9:31 am, mdipierro  wrote:
> I am pretty sure this is not a problem with sqlite timeout. It may be
> a concurrency issue. Do you use the thread module explicitly or
> multiprocessing or background processes? Can you post a minimalist app
> that allows to reproduce the problem? If not can you tells us a little
> more about the application?
>
> On Mar 17, 7:51 pm, vince  wrote:
>
> > Traceback (most recent call last):
> >   File "/home/web2py/gluon/main.py", line 518, in wsgibase
> >     session._try_store_in_db(request, response)
> >   File "/home/web2py/gluon/globals.py", line 356, in _try_store_in_db
> >     table._db(table.id == record_id).update(**dd)
> >   File "/home/web2py/gluon/sql.py", line 3244, in update
> >     self._db._execute(query)
> >   File "/home/web2py/gluon/sql.py", line 895, in 
> >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > OperationalError: database is locked
>
> > i've google about sqlite and some say that sqlite have a default
> > timeout of 5 seconds.
>
> > i think it should be able to catch the error when the database file is
> > locked, for other sql database we should be able to catch the error
> > too when the sql server is down.
>
> > -vince
>
> > On Mar 17, 10:39 pm, mdipierro  wrote:
>
> > > What error do you get? What triggers it? I do not think it related to
> > > timeout of database.
>
> > > On Mar 17, 6:01 am, vince  wrote:
>
> > > > i understand sqlite is not for heavy usage. i just want to know is
> > > > there any way to set the timeout for database file access before
> > > > returning "database is locked" error?
>
> > > > also is there any way to catch the error and return some "busy" error
> > > > page?
>
> > > > although i do not have problem with for eg. mysql, but i still want to
> > > > know is there any way to catch the error if mysql server is down?
>
> > > > -vince

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: sqlite timeout setting?

2010-03-17 Thread vince
no, and it rarely happens. i just found it on errorlog maybe once per
week. is the current dal return error right away if the database file
is locked?


On Mar 18, 11:36 am, mdipierro  wrote:
> That should not be a problem. Do you get this regularly or
> occasionally? Is this a long running thread?
>
> On Mar 17, 10:15 pm, vince  wrote:
>
> > mutliprocess yes. i am running under mod_wsgi with single thread but
> > multi process.
>
> > i do assume the sqlite driver should try to acquire the database file
> > lock for a specific time instead of return error right away? or is
> > there any way to catch the error and return some busy page? it should
> > be apply to other database. for example when mysql server is down.
>
> > the error just appear once in a while so i think it should be just two
> > process trying to access the database at once.
>
> > On Mar 18, 9:31 am, mdipierro  wrote:
>
> > > I am pretty sure this is not a problem with sqlite timeout. It may be
> > > a concurrency issue. Do you use the thread module explicitly or
> > > multiprocessing or background processes? Can you post a minimalist app
> > > that allows to reproduce the problem? If not can you tells us a little
> > > more about the application?
>
> > > On Mar 17, 7:51 pm, vince  wrote:
>
> > > > Traceback (most recent call last):
> > > >   File "/home/web2py/gluon/main.py", line 518, in wsgibase
> > > >     session._try_store_in_db(request, response)
> > > >   File "/home/web2py/gluon/globals.py", line 356, in _try_store_in_db
> > > >     table._db(table.id == record_id).update(**dd)
> > > >   File "/home/web2py/gluon/sql.py", line 3244, in update
> > > >     self._db._execute(query)
> > > >   File "/home/web2py/gluon/sql.py", line 895, in 
> > > >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > OperationalError: database is locked
>
> > > > i've google about sqlite and some say that sqlite have a default
> > > > timeout of 5 seconds.
>
> > > > i think it should be able to catch the error when the database file is
> > > > locked, for other sql database we should be able to catch the error
> > > > too when the sql server is down.
>
> > > > -vince
>
> > > > On Mar 17, 10:39 pm, mdipierro  wrote:
>
> > > > > What error do you get? What triggers it? I do not think it related to
> > > > > timeout of database.
>
> > > > > On Mar 17, 6:01 am, vince  wrote:
>
> > > > > > i understand sqlite is not for heavy usage. i just want to know is
> > > > > > there any way to set the timeout for database file access before
> > > > > > returning "database is locked" error?
>
> > > > > > also is there any way to catch the error and return some "busy" 
> > > > > > error
> > > > > > page?
>
> > > > > > although i do not have problem with for eg. mysql, but i still want 
> > > > > > to
> > > > > > know is there any way to catch the error if mysql server is down?
>
> > > > > > -vince

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] upgraded to 1.83.2 with db table file appears corrupted

2010-09-01 Thread vince
upgraded to 1.83.2, the application itself run fine just with this
error keeps appearing in error log.

is there any way to regenerate the db table file?

Traceback (most recent call last):
  File "gluon/restricted.py", line 186, in restricted
exec ccode in environment
  File "/home/web2py/applications/cms/models/db.py", line 36, in

auth.define_tables() # creates all needed
tables
  File "gluon/tools.py", line 1153, in define_tables
self.settings.table_membership_name, migrate))
  File "gluon/sql.py", line 1359, in define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
  File "gluon/sql.py", line 1839, in _create
raise RuntimeError, 'File %s appears corrupted' % self._dbt
RuntimeError: File /home/web2py/applications/cms/databases/
fb87181b96a99be45f5a23f4277867ce_auth_membership.table appears
corrupted


[web2py] upgraded to 1.83.2 with db table file appears corrupted

2010-09-01 Thread vince
upgraded to 1.83.2, the application itself run fine just with this
error appearing in error log sometimes.

is there any way to regenerate the db table file?

Traceback (most recent call last):
  File "gluon/restricted.py", line 186, in restricted
exec ccode in environment
  File "/home/web2py/applications/cms/models/db.py", line 36, in

auth.define_tables() # creates all needed
tables
  File "gluon/tools.py", line 1153, in define_tables
self.settings.table_membership_name, migrate))
  File "gluon/sql.py", line 1359, in define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
  File "gluon/sql.py", line 1839, in _create
raise RuntimeError, 'File %s appears corrupted' % self._dbt
RuntimeError: File /home/web2py/applications/cms/databases/
fb87181b96a99be45f5a23f4277867ce_auth_membership.table appears
corrupted


[web2py] Re: upgraded to 1.83.2 with db table file appears corrupted

2010-09-01 Thread vince
since it's the auth's table i do not know how to do fake_migrate.
however it seems to be file locking seems.

after auth.define_tables(migrate=False), the error seems to be gone.



On Sep 2, 1:55 am, mdipierro  wrote:
> yes. db.define_table(...,fake_migrate=True)
>
> On Sep 1, 12:11 pm, vince  wrote:
>
>
>
> > upgraded to 1.83.2, the application itself run fine just with this
> > error appearing in error log sometimes.
>
> > is there any way to regenerate the db table file?
>
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 186, in restricted
> >     exec ccode in environment
> >   File "/home/web2py/applications/cms/models/db.py", line 36, in
> > 
> >     auth.define_tables()                         # creates all needed
> > tables
> >   File "gluon/tools.py", line 1153, in define_tables
> >     self.settings.table_membership_name, migrate))
> >   File "gluon/sql.py", line 1359, in define_table
> >     t._create(migrate=migrate, fake_migrate=fake_migrate)
> >   File "gluon/sql.py", line 1839, in _create
> >     raise RuntimeError, 'File %s appears corrupted' % self._dbt
> > RuntimeError: File /home/web2py/applications/cms/databases/
> > fb87181b96a99be45f5a23f4277867ce_auth_membership.table appears
> > corrupted


[web2py] Re: upgraded to 1.83.2 with db table file appears corrupted

2010-09-02 Thread vince
i am using sqlite with default auth table, no notnull=True. was
upgrade from 1.76.5

auth.define_tables(migrate=False) seems to fix the problem so far.



On Sep 2, 12:09 pm, mdipierro  wrote:
> ... and what db are you using, sqlite?
> do you use a custom auth table?
> do you use notnull=True in any of your tables?
>
> Massimo
>
> On Sep 1, 11:07 pm, mdipierro  wrote:
>
>
>
> > before we work on a fix. Let me understand what is causing this. What
> > version are you upgrading from?
>
> > massimo
>
> > On Sep 1, 6:07 pm, berubejd  wrote:
>
> > > This has happened to me twice in the last week on two different
> > > tables.  I have started backing up the table files so that I can
> > > restore them.  I will try to use fake_migrate next time.
>
> > > Is there any way to avoid having this happen in the first place?
>
> > > Thanks!
> > > Jeff
>
> > > On Sep 1, 10:55 am, mdipierro  wrote:
>
> > > > yes. db.define_table(...,fake_migrate=True)
>
> > > > On Sep 1, 12:11 pm, vince  wrote:
>
> > > > > upgraded to 1.83.2, the application itself run fine just with this
> > > > > error appearing in error log sometimes.
>
> > > > > is there any way to regenerate the db table file?
>
> > > > > Traceback (most recent call last):
> > > > >   File "gluon/restricted.py", line 186, in restricted
> > > > >     exec ccode in environment
> > > > >   File "/home/web2py/applications/cms/models/db.py", line 36, in
> > > > > 
> > > > >     auth.define_tables()                         # creates all needed
> > > > > tables
> > > > >   File "gluon/tools.py", line 1153, in define_tables
> > > > >     self.settings.table_membership_name, migrate))
> > > > >   File "gluon/sql.py", line 1359, in define_table
> > > > >     t._create(migrate=migrate, fake_migrate=fake_migrate)
> > > > >   File "gluon/sql.py", line 1839, in _create
> > > > >     raise RuntimeError, 'File %s appears corrupted' % self._dbt
> > > > > RuntimeError: File /home/web2py/applications/cms/databases/
> > > > > fb87181b96a99be45f5a23f4277867ce_auth_membership.table appears
> > > > > corrupted


[web2py] problem of is_in_db multiple on 1.83.2

2010-09-07 Thread vince
after upgraded to 1.83.2,  sqlform of is_in_db multiple no longer
highlight the previous selected items from db.






[web2py] problem of is_in_db multiple on 1.83.2

2010-09-07 Thread vince
after upgraded to 1.83.2,  sqlform of is_in_db multiple no longer
highlight the previous selected items from db.


[web2py] Re: problem of is_in_db multiple on 1.83.2

2010-09-07 Thread vince
thanks! i got it.

On Sep 8, 12:22 am, mdipierro  wrote:
> What is the field that has the multiple validator? If it is of type
> 'string', can you try change the type to 'list:integer'?
>
> On Sep 7, 10:35 am, Richard Vézina 
> wrote:
>
>
>
> > Hello Massimo,
>
> > This problem looks the same as mine!!
>
> > Richard
>
> > 2010/9/7 vince 
>
> > > after upgraded to 1.83.2,  sqlform of is_in_db multiple no longer
> > > highlight the previous selected items from db.


[web2py] dal form of SQL SELECT IN?

2010-09-07 Thread vince
been searching on the document, i can only find the reverse form of
SQL SELECT IN, contains.

do dal have SELECT IN?


[web2py] strange problem on auth.requires_login with 1.85.3

2010-09-21 Thread vince
upgraded to 1.85.3, was using 1.83 or something like that (can't
remember)

only one of our server experience the problem with auth.requires_login
sometimes return false and send user back to login page. for the
problem server, it only occur with https, http connect is fine.


this problem is very anonying and hard for me to debug too. any idea?
for the mean time, as i lost the old package, where can i download the
old version like 1.83?


[web2py] Re: strange problem on auth.requires_login with 1.85.3

2010-09-22 Thread vince
i actually have no idea but it's the only changes we made since the
problem occur. anyway we can't reproduce it on another server.

i'll give it a try anyway. thanks


On Sep 22, 11:30 pm, mdipierro  wrote:
> http://web2py.com/examples/static/1.83.2/web2py_src.zip
>
> I do not believe this is an upgrade issue anyhow.
>
> On Sep 22, 12:22 am, vince  wrote:
>
>
>
> > upgraded to 1.85.3, was using 1.83 or something like that (can't
> > remember)
>
> > only one of our server experience the problem with auth.requires_login
> > sometimes return false and send user back to login page. for the
> > problem server, it only occur with https, http connect is fine.
>
> > this problem is very anonying and hard for me to debug too. any idea?
> > for the mean time, as i lost the old package, where can i download the
> > old version like 1.83?


[web2py] upgrade web2py now in admin page can't upgrade to 1.86.3

2010-10-09 Thread vince
upgrade web2py now in admin page can only upgrade to 1.86.2, can't
upgrade to 1.86.3.


[web2py:34674] Re: problem with 1.71.2

2009-11-05 Thread vince

oh yes it's working without cache.

vince

On Nov 6, 2:19 am, mdipierro  wrote:
> There is good code here. Can you help me debug this?
> can you try remove cache=(...) in validators?
> Feel free to email me personally and we'll post the fix when done.
>
> Massimo
>
> On Nov 5, 11:25 am, vince  wrote:
>
> > field1 =
> > ["sel","code","name","nickname","ename","sex","staywith","mgroup","mcommittee","origin"]
>
> > db.members.image.autodelete=True
> > db.members.sex.requires=IS_IN_DB
> > (db,'sex_list.name',orderby='sex_list.id',cache=(cache.ram,60))
> > db.members.ceremony.requires=IS_IN_DB
> > (db,'cere_list.name',orderby='cere_list.id',cache=(cache.ram,60))
> > db.members.m_status.requires=IS_IN_DB
> > (db,'mstatus_list.name',orderby='mstatus_list.id',cache=(cache.ram,
> > 60))
> > db.members.educ.requires=IS_IN_DB
> > (db,'educ_list.name',orderby='educ_list.id',cache=(cache.ram,60))
> > db.members.church.requires=IS_IN_DB
> > (db,'church_list.name',orderby='church_list.id',cache=(cache.ram,60))
> > db.members.relation1.requires=IS_IN_DB
> > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > 60))
> > db.members.relation2.requires=IS_IN_DB
> > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > 60))
> > db.members.relation3.requires=IS_IN_DB
> > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > 60))
> > db.members.relation4.requires=IS_IN_DB
> > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > 60))
> > db.members.relation5.requires=IS_IN_DB
> > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > 60))
> > db.members.relation6.requires=IS_IN_DB
> > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > 60))
> > db.members.relation7.requires=IS_IN_DB
> > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > 60))
> > db.members.relation8.requires=IS_IN_DB
> > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > 60))
> > db.members.relation9.requires=IS_IN_DB
> > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > 60))
>
> > actually i have not touch this application over year and its still
> > working fine at the moment, i just need to make some changes recently
> > and may as well update web2py to latest version but then it stop
> > working. i have no idea if it's web2py's problem or i did some non-
> > compliant stuff. anyway how can i trace out the problem?
>
> > vince
>
> > On Nov 6, 12:25 am, mdipierro  wrote:
>
> > > Can you show us how you set validators for db.members
>
> > > I do not think this is a web2py bug (may be wrong) but perhaps
> > > something was wrong before and web2py was not catching.
>
> > > Massimo
>
> > > On Nov 5, 9:46 am, vince  wrote:
>
> > > > my application was working fine with 1.59 and i just upgrade to 1.71.2
> > > > and with the following error.  i am using sqlite, any ideas?
> > > > everything works fine if i switch back to 1.59
>
> > > > Traceback (most recent call last):
> > > >   File "/Library/WebServer/Documents/web2py/gluon/restricted.py", line
> > > > 184, in restricted
> > > >     exec ccode in environment
> > > >   File "/Library/WebServer/Documents/web2py/applications/cy/
> > > > controllers/members.py", line 2365, in 
> > > >   File "/Library/WebServer/Documents/web2py/gluon/globals.py", line
> > > > 103, in 
> > > >     self._caller = lambda f: f()
> > > >   File "/Library/WebServer/Documents/web2py/applications/cy/
> > > > controllers/members.py", line 72, in show
> > > >     form1=SQLFORM
> > > > (db.members,thisrecord,fields=field1,deletable=False,showid=False,labels=header1,submit_button=T
> > > > ('Submit'))
> > > >   File "/Library/WebServer/Documents/web2py/gluon/sqlhtml.py", line
> > > > 613, in __init__
> > > >     inp = self.widgets.options.widget(field, default)
> > > >   File 

[web2py:34677] Re: problem with 1.71.2

2009-11-05 Thread vince

thanks for your quick fix!

vince

On Nov 6, 2:42 am, mdipierro  wrote:
> I found the problem.
>
> There is, there always was, a bug in cache.ram. It was caching the
> original object, not a copy, so if the object gets modified the one in
> cache changes too.
>
> This bug only showed up now.
>
> I fixed in trunk and I will post a web2py 1.71.3 asap.
>
> For now you can still use the latest web2py but edit gluon/cache.py
> add
> include copy
> and replace
>         self.storage[key] = (time.time(), value)
> with
>         self.storage[key] = (time.time(), copy.deepcopy(value))
>
> Massimo
>
> On Nov 5, 12:37 pm, vince  wrote:
>
> > oh yes it's working without cache.
>
> > vince
>
> > On Nov 6, 2:19 am, mdipierro  wrote:
>
> > > There is good code here. Can you help me debug this?
> > > can you try remove cache=(...) in validators?
> > > Feel free to email me personally and we'll post the fix when done.
>
> > > Massimo
>
> > > On Nov 5, 11:25 am, vince  wrote:
>
> > > > field1 =
> > > > ["sel","code","name","nickname","ename","sex","staywith","mgroup","mcommittee","origin"]
>
> > > > db.members.image.autodelete=True
> > > > db.members.sex.requires=IS_IN_DB
> > > > (db,'sex_list.name',orderby='sex_list.id',cache=(cache.ram,60))
> > > > db.members.ceremony.requires=IS_IN_DB
> > > > (db,'cere_list.name',orderby='cere_list.id',cache=(cache.ram,60))
> > > > db.members.m_status.requires=IS_IN_DB
> > > > (db,'mstatus_list.name',orderby='mstatus_list.id',cache=(cache.ram,
> > > > 60))
> > > > db.members.educ.requires=IS_IN_DB
> > > > (db,'educ_list.name',orderby='educ_list.id',cache=(cache.ram,60))
> > > > db.members.church.requires=IS_IN_DB
> > > > (db,'church_list.name',orderby='church_list.id',cache=(cache.ram,60))
> > > > db.members.relation1.requires=IS_IN_DB
> > > > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > > > 60))
> > > > db.members.relation2.requires=IS_IN_DB
> > > > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > > > 60))
> > > > db.members.relation3.requires=IS_IN_DB
> > > > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > > > 60))
> > > > db.members.relation4.requires=IS_IN_DB
> > > > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > > > 60))
> > > > db.members.relation5.requires=IS_IN_DB
> > > > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > > > 60))
> > > > db.members.relation6.requires=IS_IN_DB
> > > > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > > > 60))
> > > > db.members.relation7.requires=IS_IN_DB
> > > > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > > > 60))
> > > > db.members.relation8.requires=IS_IN_DB
> > > > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > > > 60))
> > > > db.members.relation9.requires=IS_IN_DB
> > > > (db,'relation_list.name',orderby='relation_list.id',cache=(cache.ram,
> > > > 60))
>
> > > > actually i have not touch this application over year and its still
> > > > working fine at the moment, i just need to make some changes recently
> > > > and may as well update web2py to latest version but then it stop
> > > > working. i have no idea if it's web2py's problem or i did some non-
> > > > compliant stuff. anyway how can i trace out the problem?
>
> > > > vince
>
> > > > On Nov 6, 12:25 am, mdipierro  wrote:
>
> > > > > Can you show us how you set validators for db.members
>
> > > > > I do not think this is a web2py bug (may be wrong) but perhaps
> > > > > something was wrong before and web2py was not catching.
>
> > > > > Massimo
>
> > > > > On Nov 5, 9:46 am, vince  wrote:
>
> > > > > > my application was working fine w

[web2py:34678] Re: Join web2py wave

2009-11-05 Thread vince

yes pls

On Nov 5, 8:22 pm, Markus Gritsch  wrote:
> Hi,
>
> it would be nice if you (or someone else) could send me an invitation,
> too.
>
> Thanks, Markus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34676] Re: js minification

2009-11-05 Thread vince

i do think it's a good idea if web2py will also do jsmin during
compile.

vince

On Nov 5, 10:59 pm, vihang  wrote:
> If not part of web2py, then It would be a superb plugin. Maybe it
> could be looked at as a candidate for 'must have' plugins. I was
> looking for one myself, had to make do with some ad-hoc arrangement.
>
> On Nov 5, 6:47 pm, mdipierro  wrote:
>
> > This is useful. I am not convinced it should be included in web2py.
>
> > On Nov 5, 7:44 am, Alexey Nezhdanov  wrote:
>
> > > Hello list.
>
> > > Is there any built-in minification facilities in web2py?
> > > I was too lazy to check out latest version, and it looks like there was no
> > > such thing one week ago.
> > > So I put down my own one:
> > > ==http://www.crockford.com/javascript/jsmin.py.txt
>
> > > template.py:
> > > from contrib.jsmin import jsmin as minify
> > > ...
> > > def parse_template(...
> > > ...
> > > # in the last loop, 13 lines before file end:
> > > if t.lower()[-3:]=='.js': child=minify(child)
> > > ===
> > > I understand that this is hugely sub-optimal - one would put a file 
> > > caching
> > > there for better perfomance. But it's ok for me for now.
>
> > > It would be good though if someone (f.e. me) will improve this minifier to
> > > at least add variables renaming.
> > > There is another chunk of code that can be used as a 
> > > reference:http://www.tero.co.uk/scripts/scrambler.php
>
> > > --
> > > Regards
> > > Alexey Nezhdanov
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:36060] Re: expire login when browser closes

2009-11-26 Thread vince
it will expire when browser close on firefox/safari. however, if you
just close the tab the session won't expire. is there any workaround
for this problem?

-vince

On Nov 20, 3:14 am, mdipierro  wrote:
> This expiration is handled at the web2py level. Thesessioncookie
> used to maintain thesessionshould expire at the browser level when
> youclosethe browser because it does have an expiration time. Since
> that is browser dependent I do not know if it always works.
>
> On Nov 19, 11:43 am, Wes James  wrote:
>
> > I see in tools.py
>
> > self.settings.expiration = 3600  # seconds
>
> > Is this used when auth_user is logged in?
>
> > How can this be reset when a browser has closed?
>
> > I notice that when Iclosethe broswer, then come back to the page, it is
> > still logged in.
>
> > thx,
>
> > -wes

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:36080] gae and nosql

2009-11-27 Thread vince
i've notice the new DAL do support a form of LIKE on GAE.

anyone tried it and how's the performance? it seems to only support
"startwith", what about "contain"?

is there any experimental  nosql database i can play with now besides
GAE?


-vince

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:36171] request.args and error handling

2009-11-29 Thread vince
i've been doing lots of error handling with request.args. is that
possible to have request.args[index] to return None instead of "index
out of range" exception?


-vince

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:36980] Re: request.args and error handling

2009-12-10 Thread vince
oh thanks a lot.

On Nov 30, 12:34 am, mdipierro  wrote:
> request.args(index)
>
> On Nov 29, 10:05 am, vince  wrote:
>
> > i've been doing lots of error handling with request.args. is that
> > possible to have request.args[index] to return None instead of "index
> > out of range" exception?
>
> > -vince

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:37483] calling dal from python and transaction

2009-12-17 Thread vince
from gluon.sql import *
db=DAL('sqlite://test.db')

db.define_table('test',
db.Field('subject'),
db.Field('num','integer',default=0),
)

db.test.insert(subject="sub",num="1")
db.test.insert(subject="sub",num="2")
db.test.insert(subject="sub",num="3")


if run this python script, all the queries are not committed.


if i append this line at the end
db.executesql("COMMIT;")

the queries do commit but i got the following error

Traceback (most recent call last):
  File "./test.py", line 23, in 
db.executesql("COMMIT;")
  File "gluon/sql.py", line 1256, in executesql
  File "gluon/sql.py", line 846, in 
sqlite3.OperationalError: cannot commit - no transaction is active


actually what is the right way to commit or even disable transaction
when i use DAL for python script?

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py:37584] blob and binary

2009-12-20 Thread vince
i need to read and write blob from sqlite in order to work with others
program. i can manually encode the blob with base64 if i read it but
is there anyway for dal to write blob in binary format?


-vinc

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py] EOFError?

2010-01-22 Thread vince
i just look into the error log for some clean up and found several
ticket with the following errors. i am using 1.74.6, any ideas?


Traceback (most recent call last):
  File "/Library/WebServer/Documents/web2py/gluon/restricted.py", line
173, in restricted
exec ccode in environment
  File "/Library/WebServer/Documents/web2py/applications/cms/models/
db.py", line 137, in 
migrate=is_migrate)
  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 1252,
in define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 1703,
in _create
sql_fields_old = cPickle.load(tfile)
EOFError

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: EOFError?

2010-01-24 Thread vince
actually the application is running fine, the weird thing is there are
few error log of this EOFError. i can't figure out when did it occur,
i'll keep you update if i can sort it out.

-vince

On Jan 23, 6:36 am, mdipierro  wrote:
> Are you using the web2py binary or source?
> Did you delete only the .table or everything in databases?
> Does you app run if you set migrate=False for all tables?
>
> Massimo
>
> On Jan 22, 4:11 pm, Brian M  wrote:
>
> > Hmm, I've been running into this problem a bunch today. WinXP with
> > source web2py 1.74.5 and SQLite.  My .table files keep getting
> > truncated to 0 bytes for some reason and then web2py chokes.
>
> > ~Brian
>
> > On Jan 22, 2:13 pm, Thadeus Burgess  wrote:
>
> > > looks like a corrupted .table file
> > > -Thadeus
>
> > > On Fri, Jan 22, 2010 at 1:18 PM, vince  wrote:
> > > > i just look into the error log for some clean up and found several
> > > > ticket with the following errors. i am using 1.74.6, any ideas?
>
> > > > Traceback (most recent call last):
> > > >  File "/Library/WebServer/Documents/web2py/gluon/restricted.py", line
> > > > 173, in restricted
> > > >    exec ccode in environment
> > > >  File "/Library/WebServer/Documents/web2py/applications/cms/models/
> > > > db.py", line 137, in 
> > > >    migrate=is_migrate)
> > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 1252,
> > > > in define_table
> > > >    t._create(migrate=migrate, fake_migrate=fake_migrate)
> > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 1703,
> > > > in _create
> > > >    sql_fields_old = cPickle.load(tfile)
> > > > EOFError
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "web2py-users" group.
> > > > To post to this group, send email to web...@googlegroups.com.
> > > > To unsubscribe from this group, send email to 
> > > > web2py+unsubscr...@googlegroups.com.
> > > > For more options, visit this group 
> > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: EOFError?

2010-01-24 Thread vince
i am running from source on linux and mac.


On Jan 23, 6:36 am, mdipierro  wrote:
> Are you using the web2py binary or source?
> Did you delete only the .table or everything in databases?
> Does you app run if you set migrate=False for all tables?
>
> Massimo
>
> On Jan 22, 4:11 pm, Brian M  wrote:
>
> > Hmm, I've been running into this problem a bunch today. WinXP with
> > source web2py 1.74.5 and SQLite.  My .table files keep getting
> > truncated to 0 bytes for some reason and then web2py chokes.
>
> > ~Brian
>
> > On Jan 22, 2:13 pm, Thadeus Burgess  wrote:
>
> > > looks like a corrupted .table file
> > > -Thadeus
>
> > > On Fri, Jan 22, 2010 at 1:18 PM, vince  wrote:
> > > > i just look into the error log for some clean up and found several
> > > > ticket with the following errors. i am using 1.74.6, any ideas?
>
> > > > Traceback (most recent call last):
> > > >  File "/Library/WebServer/Documents/web2py/gluon/restricted.py", line
> > > > 173, in restricted
> > > >    exec ccode in environment
> > > >  File "/Library/WebServer/Documents/web2py/applications/cms/models/
> > > > db.py", line 137, in 
> > > >    migrate=is_migrate)
> > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 1252,
> > > > in define_table
> > > >    t._create(migrate=migrate, fake_migrate=fake_migrate)
> > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 1703,
> > > > in _create
> > > >    sql_fields_old = cPickle.load(tfile)
> > > > EOFError
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "web2py-users" group.
> > > > To post to this group, send email to web...@googlegroups.com.
> > > > To unsubscribe from this group, send email to 
> > > > web2py+unsubscr...@googlegroups.com.
> > > > For more options, visit this group 
> > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: EOFError?

2010-01-24 Thread vince
i just double check and it should not be file permission issue.

is it safe to just delete all .table? web2py will auto recreate them?

On Jan 25, 12:44 am, mdipierro  wrote:
> I can only see three possible causes of the problem:
> 1) bug in your version of pickle
> 2) file permission issue
> 3) there are some .table files in you databases folder that were
> created by a different python dictribution
>
> On Jan 24, 10:16 am, vince  wrote:
>
> > i am running from source on linux and mac.
>
> > On Jan 23, 6:36 am, mdipierro  wrote:
>
> > > Are you using the web2py binary or source?
> > > Did you delete only the .table or everything in databases?
> > > Does you app run if you set migrate=False for all tables?
>
> > > Massimo
>
> > > On Jan 22, 4:11 pm, Brian M  wrote:
>
> > > > Hmm, I've been running into this problem a bunch today. WinXP with
> > > > source web2py 1.74.5 and SQLite.  My .table files keep getting
> > > > truncated to 0 bytes for some reason and then web2py chokes.
>
> > > > ~Brian
>
> > > > On Jan 22, 2:13 pm, Thadeus Burgess  wrote:
>
> > > > > looks like a corrupted .table file
> > > > > -Thadeus
>
> > > > > On Fri, Jan 22, 2010 at 1:18 PM, vince  wrote:
> > > > > > i just look into the error log for some clean up and found several
> > > > > > ticket with the following errors. i am using 1.74.6, any ideas?
>
> > > > > > Traceback (most recent call last):
> > > > > >  File "/Library/WebServer/Documents/web2py/gluon/restricted.py", 
> > > > > > line
> > > > > > 173, in restricted
> > > > > >    exec ccode in environment
> > > > > >  File "/Library/WebServer/Documents/web2py/applications/cms/models/
> > > > > > db.py", line 137, in 
> > > > > >    migrate=is_migrate)
> > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 1252,
> > > > > > in define_table
> > > > > >    t._create(migrate=migrate, fake_migrate=fake_migrate)
> > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 1703,
> > > > > > in _create
> > > > > >    sql_fields_old = cPickle.load(tfile)
> > > > > > EOFError
>
> > > > > > --
> > > > > > You received this message because you are subscribed to the Google 
> > > > > > Groups "web2py-users" group.
> > > > > > To post to this group, send email to web...@googlegroups.com.
> > > > > > To unsubscribe from this group, send email to 
> > > > > > web2py+unsubscr...@googlegroups.com.
> > > > > > For more options, visit this group 
> > > > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: EOFError?

2010-01-24 Thread vince
i just did some test and the error seems to appear  when i modify the
table definition, eg add a new field with migrate=true.
it will only appear in the error log and i won't see the actually
error ticket on browsing.


On Jan 25, 1:12 am, mdipierro  wrote:
> web2py will only recreate them if
>
> a) you also delete the database itself (for sqlite, you must delete
> everything in databases)
>
> OR
>
> b) you know for sure that the current models reflect exactly the
> structure of the database tables and you set "db.define_table
> (...,fake_migrate=True)" for all tables.
>
> In any case. Make a backup of the .tables before you delete them. In
> theory, if you lose them it is always possible to rebuild them (they
> are just picked files.
> Massimo
>
> On Jan 24, 10:54 am, vince  wrote:
>
> > i just double check and it should not be file permission issue.
>
> > is it safe to just delete all .table? web2py will auto recreate them?
>
> > On Jan 25, 12:44 am, mdipierro  wrote:
>
> > > I can only see three possible causes of the problem:
> > > 1) bug in your version of pickle
> > > 2) file permission issue
> > > 3) there are some .table files in you databases folder that were
> > > created by a different python dictribution
>
> > > On Jan 24, 10:16 am, vince  wrote:
>
> > > > i am running from source on linux and mac.
>
> > > > On Jan 23, 6:36 am, mdipierro  wrote:
>
> > > > > Are you using the web2py binary or source?
> > > > > Did you delete only the .table or everything in databases?
> > > > > Does you app run if you set migrate=False for all tables?
>
> > > > > Massimo
>
> > > > > On Jan 22, 4:11 pm, Brian M  wrote:
>
> > > > > > Hmm, I've been running into this problem a bunch today. WinXP with
> > > > > > source web2py 1.74.5 and SQLite.  My .table files keep getting
> > > > > > truncated to 0 bytes for some reason and then web2py chokes.
>
> > > > > > ~Brian
>
> > > > > > On Jan 22, 2:13 pm, Thadeus Burgess  wrote:
>
> > > > > > > looks like a corrupted .table file
> > > > > > > -Thadeus
>
> > > > > > > On Fri, Jan 22, 2010 at 1:18 PM, vince  wrote:
> > > > > > > > i just look into the error log for some clean up and found 
> > > > > > > > several
> > > > > > > > ticket with the following errors. i am using 1.74.6, any ideas?
>
> > > > > > > > Traceback (most recent call last):
> > > > > > > >  File 
> > > > > > > > "/Library/WebServer/Documents/web2py/gluon/restricted.py", line
> > > > > > > > 173, in restricted
> > > > > > > >    exec ccode in environment
> > > > > > > >  File 
> > > > > > > > "/Library/WebServer/Documents/web2py/applications/cms/models/
> > > > > > > > db.py", line 137, in 
> > > > > > > >    migrate=is_migrate)
> > > > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 
> > > > > > > > 1252,
> > > > > > > > in define_table
> > > > > > > >    t._create(migrate=migrate, fake_migrate=fake_migrate)
> > > > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", line 
> > > > > > > > 1703,
> > > > > > > > in _create
> > > > > > > >    sql_fields_old = cPickle.load(tfile)
> > > > > > > > EOFError
>
> > > > > > > > --
> > > > > > > > You received this message because you are subscribed to the 
> > > > > > > > Google Groups "web2py-users" group.
> > > > > > > > To post to this group, send email to web...@googlegroups.com.
> > > > > > > > To unsubscribe from this group, send email to 
> > > > > > > > web2py+unsubscr...@googlegroups.com.
> > > > > > > > For more options, visit this group 
> > > > > > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: EOFError?

2010-01-24 Thread vince
i can't sort out how to reproduce it anyway, it's not happening
everytime i add a field. i'll see if the clean up of .table works


On Jan 25, 2:58 am, vince  wrote:
> i just did some test and the error seems to appear  when i modify the
> table definition, eg add a new field with migrate=true.
> it will only appear in the error log and i won't see the actually
> error ticket on browsing.
>
> On Jan 25, 1:12 am, mdipierro  wrote:
>
>
>
> > web2py will only recreate them if
>
> > a) you also delete the database itself (for sqlite, you must delete
> > everything in databases)
>
> > OR
>
> > b) you know for sure that the current models reflect exactly the
> > structure of the database tables and you set "db.define_table
> > (...,fake_migrate=True)" for all tables.
>
> > In any case. Make a backup of the .tables before you delete them. In
> > theory, if you lose them it is always possible to rebuild them (they
> > are just picked files.
> > Massimo
>
> > On Jan 24, 10:54 am, vince  wrote:
>
> > > i just double check and it should not be file permission issue.
>
> > > is it safe to just delete all .table? web2py will auto recreate them?
>
> > > On Jan 25, 12:44 am, mdipierro  wrote:
>
> > > > I can only see three possible causes of the problem:
> > > > 1) bug in your version of pickle
> > > > 2) file permission issue
> > > > 3) there are some .table files in you databases folder that were
> > > > created by a different python dictribution
>
> > > > On Jan 24, 10:16 am, vince  wrote:
>
> > > > > i am running from source on linux and mac.
>
> > > > > On Jan 23, 6:36 am, mdipierro  wrote:
>
> > > > > > Are you using the web2py binary or source?
> > > > > > Did you delete only the .table or everything in databases?
> > > > > > Does you app run if you set migrate=False for all tables?
>
> > > > > > Massimo
>
> > > > > > On Jan 22, 4:11 pm, Brian M  wrote:
>
> > > > > > > Hmm, I've been running into this problem a bunch today. WinXP with
> > > > > > > source web2py 1.74.5 and SQLite.  My .table files keep getting
> > > > > > > truncated to 0 bytes for some reason and then web2py chokes.
>
> > > > > > > ~Brian
>
> > > > > > > On Jan 22, 2:13 pm, Thadeus Burgess  wrote:
>
> > > > > > > > looks like a corrupted .table file
> > > > > > > > -Thadeus
>
> > > > > > > > On Fri, Jan 22, 2010 at 1:18 PM, vince  
> > > > > > > > wrote:
> > > > > > > > > i just look into the error log for some clean up and found 
> > > > > > > > > several
> > > > > > > > > ticket with the following errors. i am using 1.74.6, any 
> > > > > > > > > ideas?
>
> > > > > > > > > Traceback (most recent call last):
> > > > > > > > >  File 
> > > > > > > > > "/Library/WebServer/Documents/web2py/gluon/restricted.py", 
> > > > > > > > > line
> > > > > > > > > 173, in restricted
> > > > > > > > >    exec ccode in environment
> > > > > > > > >  File 
> > > > > > > > > "/Library/WebServer/Documents/web2py/applications/cms/models/
> > > > > > > > > db.py", line 137, in 
> > > > > > > > >    migrate=is_migrate)
> > > > > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", 
> > > > > > > > > line 1252,
> > > > > > > > > in define_table
> > > > > > > > >    t._create(migrate=migrate, fake_migrate=fake_migrate)
> > > > > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", 
> > > > > > > > > line 1703,
> > > > > > > > > in _create
> > > > > > > > >    sql_fields_old = cPickle.load(tfile)
> > > > > > > > > EOFError
>
> > > > > > > > > --
> > > > > > > > > You received this message because you are subscribed to the 
> > > > > > > > > Google Groups "web2py-users" group.
> > > > > > > > > To post to this group, send email to web...@googlegroups.com.
> > > > > > > > > To unsubscribe from this group, send email to 
> > > > > > > > > web2py+unsubscr...@googlegroups.com.
> > > > > > > > > For more options, visit this group 
> > > > > > > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: EOFError?

2010-01-24 Thread vince
oh that's why. thank for the info.

On Jan 25, 3:24 am, mdipierro  wrote:
> You can have a problem with sqlite if you remove a field and you add
> it again with the same name.
>
> This is because sqlite does not support ALTER TABLE ... DROP.
>
> Massimo
>
> On Jan 24, 1:21 pm, vince  wrote:
>
>
>
> > i can't sort out how to reproduce it anyway, it's not happening
> > everytime i add a field. i'll see if the clean up of .table works
>
> > On Jan 25, 2:58 am, vince  wrote:
>
> > > i just did some test and the error seems to appear  when i modify the
> > > table definition, eg add a new field with migrate=true.
> > > it will only appear in the error log and i won't see the actually
> > > error ticket on browsing.
>
> > > On Jan 25, 1:12 am, mdipierro  wrote:
>
> > > > web2py will only recreate them if
>
> > > > a) you also delete the database itself (for sqlite, you must delete
> > > > everything in databases)
>
> > > > OR
>
> > > > b) you know for sure that the current models reflect exactly the
> > > > structure of the database tables and you set "db.define_table
> > > > (...,fake_migrate=True)" for all tables.
>
> > > > In any case. Make a backup of the .tables before you delete them. In
> > > > theory, if you lose them it is always possible to rebuild them (they
> > > > are just picked files.
> > > > Massimo
>
> > > > On Jan 24, 10:54 am, vince  wrote:
>
> > > > > i just double check and it should not be file permission issue.
>
> > > > > is it safe to just delete all .table? web2py will auto recreate them?
>
> > > > > On Jan 25, 12:44 am, mdipierro  wrote:
>
> > > > > > I can only see three possible causes of the problem:
> > > > > > 1) bug in your version of pickle
> > > > > > 2) file permission issue
> > > > > > 3) there are some .table files in you databases folder that were
> > > > > > created by a different python dictribution
>
> > > > > > On Jan 24, 10:16 am, vince  wrote:
>
> > > > > > > i am running from source on linux and mac.
>
> > > > > > > On Jan 23, 6:36 am, mdipierro  wrote:
>
> > > > > > > > Are you using the web2py binary or source?
> > > > > > > > Did you delete only the .table or everything in databases?
> > > > > > > > Does you app run if you set migrate=False for all tables?
>
> > > > > > > > Massimo
>
> > > > > > > > On Jan 22, 4:11 pm, Brian M  wrote:
>
> > > > > > > > > Hmm, I've been running into this problem a bunch today. WinXP 
> > > > > > > > > with
> > > > > > > > > source web2py 1.74.5 and SQLite.  My .table files keep getting
> > > > > > > > > truncated to 0 bytes for some reason and then web2py chokes.
>
> > > > > > > > > ~Brian
>
> > > > > > > > > On Jan 22, 2:13 pm, Thadeus Burgess  
> > > > > > > > > wrote:
>
> > > > > > > > > > looks like a corrupted .table file
> > > > > > > > > > -Thadeus
>
> > > > > > > > > > On Fri, Jan 22, 2010 at 1:18 PM, vince  
> > > > > > > > > > wrote:
> > > > > > > > > > > i just look into the error log for some clean up and 
> > > > > > > > > > > found several
> > > > > > > > > > > ticket with the following errors. i am using 1.74.6, any 
> > > > > > > > > > > ideas?
>
> > > > > > > > > > > Traceback (most recent call last):
> > > > > > > > > > >  File 
> > > > > > > > > > > "/Library/WebServer/Documents/web2py/gluon/restricted.py",
> > > > > > > > > > >  line
> > > > > > > > > > > 173, in restricted
> > > > > > > > > > >    exec ccode in environment
> > > > > > > > > > >  File 
> > > > > > > > > > > "/Library/WebServer/Documents/web2py/applications/cms/models/
> > > > > > > > > > > db.py", line 137, in 
> > > > > > > > > > >    migrate=is_migrate)
> > > > > > > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", 
> > > > > > > > > > > line 1252,
> > > > > > > > > > > in define_table
> > > > > > > > > > >    t._create(migrate=migrate, fake_migrate=fake_migrate)
> > > > > > > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", 
> > > > > > > > > > > line 1703,
> > > > > > > > > > > in _create
> > > > > > > > > > >    sql_fields_old = cPickle.load(tfile)
> > > > > > > > > > > EOFError
>
> > > > > > > > > > > --
> > > > > > > > > > > You received this message because you are subscribed to 
> > > > > > > > > > > the Google Groups "web2py-users" group.
> > > > > > > > > > > To post to this group, send email to 
> > > > > > > > > > > web...@googlegroups.com.
> > > > > > > > > > > To unsubscribe from this group, send email to 
> > > > > > > > > > > web2py+unsubscr...@googlegroups.com.
> > > > > > > > > > > For more options, visit this group 
> > > > > > > > > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Mac Apache

2010-01-24 Thread vince
just compile your own version of mod_wsgi

On Jan 24, 2:42 am, pistacchio  wrote:
> Has anyone succesfully run web2py under Mac OSX apache? Any guide?
> Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: EOFError?

2010-01-24 Thread vince
I still find the error appear random, is it possible to trace the URL
of each error?

On Jan 25, 3:24 am, mdipierro  wrote:
> You can have a problem with sqlite if you remove a field and you add
> it again with the same name.
>
> This is because sqlite does not support ALTER TABLE ... DROP.
>
> Massimo
>
> On Jan 24, 1:21 pm, vince  wrote:
>
>
>
> > i can't sort out how to reproduce it anyway, it's not happening
> > everytime i add a field. i'll see if the clean up of .table works
>
> > On Jan 25, 2:58 am, vince  wrote:
>
> > > i just did some test and the error seems to appear  when i modify the
> > > table definition, eg add a new field with migrate=true.
> > > it will only appear in the error log and i won't see the actually
> > > error ticket on browsing.
>
> > > On Jan 25, 1:12 am, mdipierro  wrote:
>
> > > > web2py will only recreate them if
>
> > > > a) you also delete the database itself (for sqlite, you must delete
> > > > everything in databases)
>
> > > > OR
>
> > > > b) you know for sure that the current models reflect exactly the
> > > > structure of the database tables and you set "db.define_table
> > > > (...,fake_migrate=True)" for all tables.
>
> > > > In any case. Make a backup of the .tables before you delete them. In
> > > > theory, if you lose them it is always possible to rebuild them (they
> > > > are just picked files.
> > > > Massimo
>
> > > > On Jan 24, 10:54 am, vince  wrote:
>
> > > > > i just double check and it should not be file permission issue.
>
> > > > > is it safe to just delete all .table? web2py will auto recreate them?
>
> > > > > On Jan 25, 12:44 am, mdipierro  wrote:
>
> > > > > > I can only see three possible causes of the problem:
> > > > > > 1) bug in your version of pickle
> > > > > > 2) file permission issue
> > > > > > 3) there are some .table files in you databases folder that were
> > > > > > created by a different python dictribution
>
> > > > > > On Jan 24, 10:16 am, vince  wrote:
>
> > > > > > > i am running from source on linux and mac.
>
> > > > > > > On Jan 23, 6:36 am, mdipierro  wrote:
>
> > > > > > > > Are you using the web2py binary or source?
> > > > > > > > Did you delete only the .table or everything in databases?
> > > > > > > > Does you app run if you set migrate=False for all tables?
>
> > > > > > > > Massimo
>
> > > > > > > > On Jan 22, 4:11 pm, Brian M  wrote:
>
> > > > > > > > > Hmm, I've been running into this problem a bunch today. WinXP 
> > > > > > > > > with
> > > > > > > > > source web2py 1.74.5 and SQLite.  My .table files keep getting
> > > > > > > > > truncated to 0 bytes for some reason and then web2py chokes.
>
> > > > > > > > > ~Brian
>
> > > > > > > > > On Jan 22, 2:13 pm, Thadeus Burgess  
> > > > > > > > > wrote:
>
> > > > > > > > > > looks like a corrupted .table file
> > > > > > > > > > -Thadeus
>
> > > > > > > > > > On Fri, Jan 22, 2010 at 1:18 PM, vince  
> > > > > > > > > > wrote:
> > > > > > > > > > > i just look into the error log for some clean up and 
> > > > > > > > > > > found several
> > > > > > > > > > > ticket with the following errors. i am using 1.74.6, any 
> > > > > > > > > > > ideas?
>
> > > > > > > > > > > Traceback (most recent call last):
> > > > > > > > > > >  File 
> > > > > > > > > > > "/Library/WebServer/Documents/web2py/gluon/restricted.py",
> > > > > > > > > > >  line
> > > > > > > > > > > 173, in restricted
> > > > > > > > > > >    exec ccode in environment
> > > > > > > > > > >  File 
> > > > > > > > > > > "/Library/WebServer/Documents/web2py/applications/cms/models/
> > > > > > > > > > > db.py", line 137, in 
> > > > > > > > > > >    migrate=is_migrate)
> > > > > > > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", 
> > > > > > > > > > > line 1252,
> > > > > > > > > > > in define_table
> > > > > > > > > > >    t._create(migrate=migrate, fake_migrate=fake_migrate)
> > > > > > > > > > >  File "/Library/WebServer/Documents/web2py/gluon/sql.py", 
> > > > > > > > > > > line 1703,
> > > > > > > > > > > in _create
> > > > > > > > > > >    sql_fields_old = cPickle.load(tfile)
> > > > > > > > > > > EOFError
>
> > > > > > > > > > > --
> > > > > > > > > > > You received this message because you are subscribed to 
> > > > > > > > > > > the Google Groups "web2py-users" group.
> > > > > > > > > > > To post to this group, send email to 
> > > > > > > > > > > web...@googlegroups.com.
> > > > > > > > > > > To unsubscribe from this group, send email to 
> > > > > > > > > > > web2py+unsubscr...@googlegroups.com.
> > > > > > > > > > > For more options, visit this group 
> > > > > > > > > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: EOFError?

2010-01-25 Thread vince
i finally sorted out the problem. it is the file locking issue on
the .table file. i run the application under mod_wsgi with multiple
process. this error can be reproduce by loading a page with lots of
images and those images are handle by the "download function".

migrate=false will fix this for sure.

i suggest error ticket should record the url as well as cookie data
too for debug purpose.

-vince



On Jan 25, 3:24 am, mdipierro  wrote:
> You can have a problem with sqlite if you remove a field and you add
> it again with the same name.
>
> This is because sqlite does not support ALTER TABLE ... DROP.
>
> Massimo
>
> On Jan 24, 1:21 pm, vince  wrote:
>
>
>
> > i can't sort out how to reproduce it anyway, it's not happening
> > everytime i add a field. i'll see if the clean up of .table works
>
> > On Jan 25, 2:58 am, vince  wrote:
>
> > > i just did some test and the error seems to appear  when i modify the
> > > table definition, eg add a new field with migrate=true.
> > > it will only appear in the error log and i won't see the actually
> > > error ticket on browsing.
>
> > > On Jan 25, 1:12 am, mdipierro  wrote:
>
> > > > web2py will only recreate them if
>
> > > > a) you also delete the database itself (for sqlite, you must delete
> > > > everything in databases)
>
> > > > OR
>
> > > > b) you know for sure that the current models reflect exactly the
> > > > structure of the database tables and you set "db.define_table
> > > > (...,fake_migrate=True)" for all tables.
>
> > > > In any case. Make a backup of the .tables before you delete them. In
> > > > theory, if you lose them it is always possible to rebuild them (they
> > > > are just picked files.
> > > > Massimo
>
> > > > On Jan 24, 10:54 am, vince  wrote:
>
> > > > > i just double check and it should not be file permission issue.
>
> > > > > is it safe to just delete all .table? web2py will auto recreate them?
>
> > > > > On Jan 25, 12:44 am, mdipierro  wrote:
>
> > > > > > I can only see three possible causes of the problem:
> > > > > > 1) bug in your version of pickle
> > > > > > 2) file permission issue
> > > > > > 3) there are some .table files in you databases folder that were
> > > > > > created by a different python dictribution
>
> > > > > > On Jan 24, 10:16 am, vince  wrote:
>
> > > > > > > i am running from source on linux and mac.
>
> > > > > > > On Jan 23, 6:36 am, mdipierro  wrote:
>
> > > > > > > > Are you using the web2py binary or source?
> > > > > > > > Did you delete only the .table or everything in databases?
> > > > > > > > Does you app run if you set migrate=False for all tables?
>
> > > > > > > > Massimo
>
> > > > > > > > On Jan 22, 4:11 pm, Brian M  wrote:
>
> > > > > > > > > Hmm, I've been running into this problem a bunch today. WinXP 
> > > > > > > > > with
> > > > > > > > > source web2py 1.74.5 and SQLite.  My .table files keep getting
> > > > > > > > > truncated to 0 bytes for some reason and then web2py chokes.
>
> > > > > > > > > ~Brian
>
> > > > > > > > > On Jan 22, 2:13 pm, Thadeus Burgess  
> > > > > > > > > wrote:
>
> > > > > > > > > > looks like a corrupted .table file
> > > > > > > > > > -Thadeus
>
> > > > > > > > > > On Fri, Jan 22, 2010 at 1:18 PM, vince  
> > > > > > > > > > wrote:
> > > > > > > > > > > i just look into the error log for some clean up and 
> > > > > > > > > > > found several
> > > > > > > > > > > ticket with the following errors. i am using 1.74.6, any 
> > > > > > > > > > > ideas?
>
> > > > > > > > > > > Traceback (most recent call last):
> > > > > > > > > > >  File 
> > > > > > > > > > > "/Library/WebServer/Documents/web2py/gluon/restricted.py",
> > > > > > > > > > >  line
> > > > > > > > > > > 173, in restricted
> 

[web2py:12660] Re: ... and you can run *some* SQLALchemy models in web2py

2008-11-29 Thread vince

i am a sqlalchemy user and i think most of us are using object mapping
instead. i've been using pylons but really tried of the lack of
document, and i really enjoy the all in one package advantage in
web2py.
will web2py give us an option to use sqlalchemy instead of web2py's
DAL soon?


-vinc

On 11月17日, 下午11時12分, mdipierro <[EMAIL PROTECTED]> wrote:
> - The Table must have an integer field called 'id'.
>
> - ForeignKey must always reference such field.
>
> - Many SQLAlchemey field attributes are ignored.
>
> - It does not check for errors.
>
> - This is not the recommended way to use web2py. This is designed to
> lower the entry barrier for current SQLAlchemy users and to
> acknowledge the importance of SQLAlchemy within the Python community.
>
> Massimo
>
> On Nov 16, 10:36 pm, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > ** This is incomplete and to be considered a proof of concept **
>
> > 1) download
>
> >http://groups.google.com/group/web2py/web/sqlalchemy.py
>
> > 2) import it in your app and try the following model:
>
> > db=SQLDB()
> > metadata=MetaData(db)
>
> > users = Table('users', metadata,
> >Column('id', Integer),
> >Column('name', String(40)),
> >Column('age', Integer),
> >Column('password', String),
> >Column('blob1',Binary),
> > )
>
> > dogs = Table('dogs', metadata,
> >Column('id', Integer),
> >Column('name', String(40)),
> >Column('owner', ForeignKey('users.id')),
> > )
>
> > print users.fields
> > print dogs.fields
>
> > 3) click on [database administration] to see the generated interface.
>
> > As in the Django cases, the above code defines tables 'users' and
> > 'dogs'. They are web2py tables so you can do:
>
> > id=users.insert(name='Test')
> > dogs.insert(name='Snoopy',owner=id)
> > for row in db(dogs.owner==users.id).select(): print
> > row.dogs.name,row.users.name
>
> > Massimo

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:12661] Re: ... and you can run *some* SQLALchemy models in web2py

2008-11-29 Thread vince

i am a SQLAlchemy user and i think most of us are using its object-
relational mapping instead.
i've been using pylons but tried of its lack of document and really
enjoy the idea of "all in one package" in web2py.
will web2py give us an option to use SQLAlchemy instead of its own
DAL?

-vinc

On 11月17日, 下午11時12分, mdipierro <[EMAIL PROTECTED]> wrote:
> - The Table must have an integer field called 'id'.
>
> - ForeignKey must always reference such field.
>
> - Many SQLAlchemey field attributes are ignored.
>
> - It does not check for errors.
>
> - This is not the recommended way to use web2py. This is designed to
> lower the entry barrier for current SQLAlchemy users and to
> acknowledge the importance of SQLAlchemy within the Python community.
>
> Massimo
>
> On Nov 16, 10:36 pm, mdipierro <[EMAIL PROTECTED]> wrote:
>
> > ** This is incomplete and to be considered a proof of concept **
>
> > 1) download
>
> >http://groups.google.com/group/web2py/web/sqlalchemy.py
>
> > 2) import it in your app and try the following model:
>
> > db=SQLDB()
> > metadata=MetaData(db)
>
> > users = Table('users', metadata,
> >Column('id', Integer),
> >Column('name', String(40)),
> >Column('age', Integer),
> >Column('password', String),
> >Column('blob1',Binary),
> > )
>
> > dogs = Table('dogs', metadata,
> >Column('id', Integer),
> >Column('name', String(40)),
> >Column('owner', ForeignKey('users.id')),
> > )
>
> > print users.fields
> > print dogs.fields
>
> > 3) click on [database administration] to see the generated interface.
>
> > As in the Django cases, the above code defines tables 'users' and
> > 'dogs'. They are web2py tables so you can do:
>
> > id=users.insert(name='Test')
> > dogs.insert(name='Snoopy',owner=id)
> > for row in db(dogs.owner==users.id).select(): print
> > row.dogs.name,row.users.name
>
> > Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13567] Re: t3 on launchpad, t2 will die

2008-12-15 Thread vince

i've been playing with T3, T3 actually is a sample wiki build on top
of T2 plus some extra features too.

i think what Massimo mean is he will no longer distribute T2 itself as
you can find it on T3. right?

web2py, T2 and T3 are quite confusing, i guess we may need a plugins
system for web2py.


vince

On Dec 15, 2:01 pm, mdipierro  wrote:
> This is what I meant. t2 is contained and will be contained in t3.
>
> On Dec 14, 4:11 pm, ceej  wrote:
>
> > I like the idea of t3 but I also really like the idea of t2, I feel t2
> > should be separate from t3 and the extra features in t2 that are
> > specifically for t3 should be in a separate module extending t2.
> > Because t2 is a great module to plug into any application and helps
> > speed up the development process. Which I think a lot of developers
> > like the idea of. T3 is more of an application already for someone to
> > build on top of and is ok for certain types of projects. So I really
> > think we should consider "merging" t2 into t3.
>
> > What are other peoples thoughts?
>
> > On Dec 14, 9:51 am, Joe  Barnhart  wrote:
>
> > > In keeping with the web2py theme, a couple which come to mind are:
>
> > > app2py
>
> > > webapp2py
>
> > > On Dec 10, 4:13 pm, mdipierro  wrote:
>
> > > > This is not the final word. I think we need a better name. T3 is not
> > > > easily identifiable.
>
> > > > Suggestions?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13597] possible bug in T.current_languages

2008-12-15 Thread vince

T.current_languages['en'] doesn't work as expected
however, when i edit gluon/languages.py and change
self.current_languages = ['en'] it works.
my current workaround is to put a en.py file inside language directory
with just "()"

-vince

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13599] Re: possible bug in T.current_languages

2008-12-15 Thread vince

yes as described in the manual i declare

T.current_language=['en']

in models.

but it didn't work, but editing the self.current_language=['en']
directly inside gluon works.

or i have to declare it elsewhere? i expect it should be fine to
declare inside models or controllers.

-vince



On Dec 16, 1:25 pm, mdipierro  wrote:
> Unless I misunderstand... It is not a bug. web2py does not assume that
> your current language is english so you have to declare it:
>
> T.current_language=['en']
>
> this tells web2py that 'accept-language: en' does not need
> translation.
>
> Massimo
>
> On Dec 15, 11:21 pm, vince  wrote:
>
> > T.current_languages['en'] doesn't work as expected
> > however, when i edit gluon/languages.py and change
> > self.current_languages = ['en'] it works.
> > my current workaround is to put a en.py file inside language directory
> > with just "()"
>
> > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13602] Re: possible bug in T.current_languages

2008-12-15 Thread vince

T.append('en') will return error saying no attribute append.
u mean T.current_languages.append('en') right? that doesn't work too.
i think it should be some language scoping problem as it works when i
edit gluon/languagess.py directly. i tried to look into the code but i
have no clue too..

T.force('en') works fine but what i want is to set the default
language and T.current_languages doesn't work for some result.

-vince

On Dec 16, 1:35 pm, mdipierro  wrote:
> odd. can you try
>
> T.append('en')
>
> Massimo
>
> On Dec 15, 11:30 pm, vince  wrote:
>
> > yes as described in the manual i declare
>
> > T.current_language=['en']
>
> > in models.
>
> > but it didn't work, but editing the self.current_language=['en']
> > directly inside gluon works.
>
> > or i have to declare it elsewhere? i expect it should be fine to
> > declare inside models or controllers.
>
> > -vince
>
> > On Dec 16, 1:25 pm, mdipierro  wrote:
>
> > > Unless I misunderstand... It is not a bug. web2py does not assume that
> > > your current language is english so you have to declare it:
>
> > > T.current_language=['en']
>
> > > this tells web2py that 'accept-language: en' does not need
> > > translation.
>
> > > Massimo
>
> > > On Dec 15, 11:21 pm, vince  wrote:
>
> > > > T.current_languages['en'] doesn't work as expected
> > > > however, when i edit gluon/languages.py and change
> > > > self.current_languages = ['en'] it works.
> > > > my current workaround is to put a en.py file inside language directory
> > > > with just "()"
>
> > > > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13606] Re: possible bug in T.current_languages

2008-12-15 Thread vince

oh i actually figured it out, it has to be

T.current_language=['en']
T.force(request.env.http_accept_language)

it works.


-vince

On 12月16日, 下午2时00分, mdipierro  wrote:
> Can I see your app? You can email it to me privately.
>
> Massimo
>
> On Dec 15, 11:45 pm, vince  wrote:
>
> > T.append('en') will return error saying no attribute append.
> > u mean T.current_languages.append('en') right? that doesn't work too.
> > i think it should be some language scoping problem as it works when i
> > edit gluon/languagess.py directly. i tried to look into the code but i
> > have no clue too..
>
> > T.force('en') works fine but what i want is to set the default
> > language and T.current_languages doesn't work for some result.
>
> > -vince
>
> > On Dec 16, 1:35 pm, mdipierro  wrote:
>
> > > odd. can you try
>
> > > T.append('en')
>
> > > Massimo
>
> > > On Dec 15, 11:30 pm, vince  wrote:
>
> > > > yes as described in the manual i declare
>
> > > > T.current_language=['en']
>
> > > > in models.
>
> > > > but it didn't work, but editing the self.current_language=['en']
> > > > directly inside gluon works.
>
> > > > or i have to declare it elsewhere? i expect it should be fine to
> > > > declare inside models or controllers.
>
> > > > -vince
>
> > > > On Dec 16, 1:25 pm, mdipierro  wrote:
>
> > > > > Unless I misunderstand... It is not a bug. web2py does not assume that
> > > > > your current language is english so you have to declare it:
>
> > > > > T.current_language=['en']
>
> > > > > this tells web2py that 'accept-language: en' does not need
> > > > > translation.
>
> > > > > Massimo
>
> > > > > On Dec 15, 11:21 pm, vince  wrote:
>
> > > > > > T.current_languages['en'] doesn't work as expected
> > > > > > however, when i edit gluon/languages.py and change
> > > > > > self.current_languages = ['en'] it works.
> > > > > > my current workaround is to put a en.py file inside language 
> > > > > > directory
> > > > > > with just "()"
>
> > > > > > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13608] Re: possible bug in T.current_languages

2008-12-15 Thread vince

i propose this patch to make it cleaner to set current languages.

-vince

gluon/languages.py

57a58,61
> self.http_accept_language = request.env.http_accept_language
> def set_current_languages(self,languages):
> self.current_languages=languages
> self.force(languages=self.http_accept_language)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13669] Re: possible bug in T.current_languages

2008-12-16 Thread vince

will that introduce performance impact since it should have hundreds T
() call for each page?
i understand it's better to keep the api compatible. or maybe it's
good time to change the api when no one notice this problem yet?

-vince

On Dec 16, 4:21 pm, mdipierro  wrote:
> correction... I think I found a better solution, inspired by your
> patch, that does not require introducing a new function and make the
> example in the book work as it should. In trunk now.
>
> Massimo
>
> On Dec 16, 1:31 am, mdipierro  wrote:
>
> > This helped me understand the issue. I like it. Accepted and uploading
> > to trunk now.
> > Thank you Vince.
>
> > Massimo
>
> > On Dec 16, 12:55 am, vince  wrote:
>
> > > i propose this patch to make it cleaner to set current languages.
>
> > > -vince
>
> > > gluon/languages.py
>
> > > 57a58,61
>
> > > >         self.http_accept_language = request.env.http_accept_language
> > > >     def set_current_languages(self,languages):
> > > >         self.current_languages=languages
> > > >         self.force(languages=self.http_accept_language)
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13715] is that possible to requires IS_DATE or None/Empty?

2008-12-16 Thread vince

is that possible to define a SQLField as date so it is either empty or
a valid IS_DATE format?

-vince
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13717] Re: is that possible to requires IS_DATE or None/Empty?

2008-12-17 Thread vince

oh thanks a lots. i didn't notice there is a IS_NULL_OR

-vince

On Dec 17, 4:10 pm, mdipierro  wrote:
> requires=IS_NULL_OR(IS_DATE('%Y-%m-%d',error_message='must be empty or
> iso date'))
>
> On Dec 17, 1:56 am, vince  wrote:
>
> > is that possible to define a SQLField as date so it is either empty or
> > a valid IS_DATE format?
>
> > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13782] mod_wsgi deployment question

2008-12-17 Thread vince

anyone have experience with mod_wsgi deployment?

i use the manual's sample config but it didn't work straight away. i
have to remove the line
Alias / /home/web2py/applications/
it works but then all the /static/ page are serve via web2py instead
of apache directly.

it seems that once i have set the Alias the WSGIScriptAlias will be
ignore. anyone have the solution to have all the static page skip
mod_wsgi?

thanks in advance
vince

here's my config

   
  ServerName 10.10.10.2
  ### alias the location of applications (for static files)
  #Alias / /home/web2py/applications/
  ### setup WSGI
  WSGIScriptAlias / /home/web2py/wsgihandler.py
  WSGIDaemonProcess web2py user=www-data group=www-data \
   home=/home/web2py/ \
   processes=10 maximum-requests=500
  ### static files do not need WSGI
  
Order Allow,Deny
Allow from all
  
  ### everything else goes over WSGI
  
Order deny,allow
Allow from all
WSGIProcessGroup web2py
  
   



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13790] Re: mod_wsgi deployment question

2008-12-18 Thread vince

thanks your config works fine.
but those files under static still serving by web2py.

-vince

On Dec 18, 3:48 pm, Johanm  wrote:
> I got some help with this a week or so ago. I found the manual to be
> more confusing than 
> helpful.http://groups.google.com/group/web2py/browse_thread/thread/f4197ddc6f...
>
> Here is my working config file
> note that i had to put my wsgi handlers outside the  tags
> so it would work for both HTTP and HTTPS
>
>        WSGIScriptAlias / /var/www/web2py/wsgihandler.py
>         WSGIDaemonProcess web2py user=web2py group=web2py home=/var/
> www/web2py processes=1 maximum-requests=1000
> 
>         #WSGIScriptAlias / /var/www/web2py/wsgihandler.py
>         #WSGIDaemonProcess web2py user=web2py group=web2py home=/var/
> www/web2py processes=1 maximum-requests=1000
>         ServerAdmin webmas...@localhost
>         DocumentRoot /var/www/web2py/applications
>         
>                 Options FollowSymLinks
>                 AllowOverride None
>         
>         
>                 Options Indexes FollowSymLinks MultiViews
>                 AllowOverride None
>                 Order allow,deny
>                 allow from all
>         
>         ErrorLog /var/log/apache2/error.log
>         # Possible values include: debug, info, notice, warn, error,
> crit,
>         # alert, emerg.
>         LogLevel warn
>         CustomLog /var/log/apache2/access.log combined
> 
> NameVirtualHost *:443
> 
>         ServerAdmin webmas...@localhost
>         SSLEngine On
>         SSLCertificateFile /etc/apache2/ssl/server.crt
>         SSLCertificateKeyFile /etc/apache2/ssl/server.key
>         DocumentRoot /var/www/web2py/applications/admin
>         #WSGIScriptAlias / /var/www/web2py/wsgihandler.py
>         #WSGIDaemonProcess web2py user=web2py group=web2py home=/var/
> www/web2py processes=1 maximum-requests=1000
>        
>                 Options FollowSymLinks
>                 AllowOverride None
>         
>         
>                 Options Indexes FollowSymLinks MultiViews
>                 AllowOverride None
>                 Order allow,deny
>                 allow from all
>         
>         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>         
>                 AllowOverride None
>                 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>                 Order allow,deny
>                 Allow from all
>         
>         ErrorLog /var/log/apache2/error.log
>         # Possible values include: debug, info, notice, warn, error, crit,
>         # alert, emerg.
>         LogLevel warn
>         CustomLog /var/log/apache2/access.log combined
>     Alias /doc/ "/usr/share/doc/"
>     
>         Options Indexes MultiViews FollowSymLinks
>         AllowOverride None
>         Order deny,allow
>         Deny from all
>         Allow from 127.0.0.0/255.0.0.0 ::1/128
>     
> 
>
> On Dec 17, 11:35 pm, vince  wrote:
>
> > anyone have experience with mod_wsgi deployment?
>
> > i use the manual's sample config but it didn't work straight away. i
> > have to remove the line
> > Alias / /home/web2py/applications/
> > it works but then all the /static/ page are serve via web2py instead
> > of apache directly.
>
> > it seems that once i have set the Alias the WSGIScriptAlias will be
> > ignore. anyone have the solution to have all the static page skip
> > mod_wsgi?
>
> > thanks in advance
> > vince
>
> > here's my config
>
> >    
> >       ServerName 10.10.10.2
> >       ### alias the location of applications (for static files)
> >       #Alias / /home/web2py/applications/
> >       ### setup WSGI
> >       WSGIScriptAlias / /home/web2py/wsgihandler.py
> >       WSGIDaemonProcess web2py user=www-data group=www-data \
> >                                home=/home/web2py/ \
> >                                processes=10 maximum-requests=500
> >       ### static files do not need WSGI
> >       
> >         Order Allow,Deny
> >         Allow from all
> >       
> >       ### everything else goes over WSGI
> >       
> >         Order deny,allow
> >         Allow from all
> >         WSGIProcessGroup web2py
> >       
> >    
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13957] Re: To know IP Address of client

2008-12-20 Thread vince

request.client

On Dec 21, 7:52 am, "Phyo Arkar"  wrote:
> AHH no no this . it is just server ip:port .. how can i find browser
> client's IP ?
>
> On Sat, Dec 20, 2008 at 11:49 PM, Phyo Arkar wrote:
>
> > Got it , it is
>
> > request.env.http_host
>
> > Where can i find all the properties of Request Response and Session
> > objects?
>
> > Regards,
>
> > Phyo.
>
> > On Sat, Dec 20, 2008 at 11:30 PM, Phyo Arkar 
> > wrote:
>
> >> Hi All;
>
> >> How can i know the IP address of the Client who access the Page? Is that
> >> from Request object right?But which ?
>
> >> Regards,
>
> >> Phyo.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13958] Re: Performance tips

2008-12-20 Thread vince

i've been evaluate web2py recently for its performance, so far the
overhead i found is very minimum comparing to other framework. the
only minor issues so far i've found are from the html helper or
sqltable which does require some cpu power.

600 visitors a day is very low volume and it shouldn't have any
problem at all even if you just using reverse proxy via apache. maybe
you can try mod_wsgi.


-vince

On Dec 21, 5:47 am, voltron  wrote:
> I am having serious performance problems with an appliance. I have 2
> instances of web2py being served by reverse proxy via Apache2.
>
> The live domain running on port 8000 runs very compared to the test
> domain running on port 8002. The only difference is that the live
> server is being accessed by over 600 visitors a day.
>
> The pages are being generated very slowly, even though they do not
> access the db. I have compiled all the appliances concerned but did
> not get any visible speedups. I could start cacheing the pages in ram,
> but I just want to be sure that there are now tips left out before
> doing so. Any other tips? Does emptying the sessions folder help any
> way?
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13965] Re: Performance tips

2008-12-21 Thread vince

from my experience pylons should be the fastest one before i notice
web2py. i don't have any accurate data compare to pylons right now but
i guess it shouldn't have much different i think.  if u need one i'll
try to build a sample benchmarking application for both pylons and
web2py later.

one performance issue i notice on web2py is the sqlform/sqltable. if
you have 100 fields in a table u'll notice it. it makes it hard with
high concurrent visitors. although pylons' formbuilder is quite fast
but it's not fair to compare as it's not that powerful/handy. and i
think that can be fix easy by caching the sqlform result and replace
it.

oh yeah one question. web2py's DAL is non-lazy query right?

-vince

> @vince
> do you have any data we can use to compare web2py to other frameworks?
>
> Massimo
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13980] Re: Performance tips

2008-12-21 Thread vince

i was trying to figure out how to cache select inside the SQLFORM.
let say
db.Field('info1',db.list),
db.Field('info2',db.list),
db.Field('info3',db.list),


i tried to locate the select query inside SQLFORM in sqlhtml.py

elif hasattr(field.requires,'options'):
 opts=[]
 for k,v in field.requires.options():
  opts.append(OPTION(v,_value=k))

can you show me some lights where is the actual select query.
in some cases if i have many field that is joining the same table it
will have over a second delay on just the SQLFORM function.

-vince

On Dec 21, 7:03 pm, mdipierro  wrote:
> No it is not lazy evaluated. You can cache selects.
>
> Massimo
>
> On Dec 21, 2:15 am, vince  wrote:
>
> > from my experience pylons should be the fastest one before i notice
> > web2py. i don't have any accurate data compare to pylons right now but
> > i guess it shouldn't have much different i think.  if u need one i'll
> > try to build a sample benchmarking application for both pylons and
> > web2py later.
>
> > one performance issue i notice on web2py is the sqlform/sqltable. if
> > you have 100 fields in a table u'll notice it. it makes it hard with
> > high concurrent visitors. although pylons' formbuilder is quite fast
> > but it's not fair to compare as it's not that powerful/handy. and i
> > think that can be fix easy by caching the sqlform result and replace
> > it.
>
> > oh yeah one question. web2py's DAL is non-lazy query right?
>
> > -vince
>
> > > @vince
> > > do you have any data we can use to compare web2py to other frameworks?
>
> > > Massimo
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13984] Re: Performance tips

2008-12-21 Thread vince

oh thx i got it.

can i propose a quick patch to add an optional argument to SQLFORM for
passing the cache option to IS_IN_DB.options?

-vince


On Dec 22, 2:11 am, mdipierro  wrote:
> good point. the select is in gluon/validators.py right now there is no
> option cache it.
>
> Massimo
>
> On Dec 21, 11:56 am, vince  wrote:
>
> > i was trying to figure out how to cache select inside the SQLFORM.
> > let say
> > db.Field('info1',db.list),
> > db.Field('info2',db.list),
> > db.Field('info3',db.list),
>
> > i tried to locate the select query inside SQLFORM in sqlhtml.py
>
> > elif hasattr(field.requires,'options'):
> >      opts=[]
> >      for k,v in field.requires.options():
> >           opts.append(OPTION(v,_value=k))
>
> > can you show me some lights where is the actual select query.
> > in some cases if i have many field that is joining the same table it
> > will have over a second delay on just the SQLFORM function.
>
> > -vince
>
> > On Dec 21, 7:03 pm, mdipierro  wrote:
>
> > > No it is not lazy evaluated. You can cache selects.
>
> > > Massimo
>
> > > On Dec 21, 2:15 am, vince  wrote:
>
> > > > from my experience pylons should be the fastest one before i notice
> > > > web2py. i don't have any accurate data compare to pylons right now but
> > > > i guess it shouldn't have much different i think.  if u need one i'll
> > > > try to build a sample benchmarking application for both pylons and
> > > > web2py later.
>
> > > > one performance issue i notice on web2py is the sqlform/sqltable. if
> > > > you have 100 fields in a table u'll notice it. it makes it hard with
> > > > high concurrent visitors. although pylons' formbuilder is quite fast
> > > > but it's not fair to compare as it's not that powerful/handy. and i
> > > > think that can be fix easy by caching the sqlform result and replace
> > > > it.
>
> > > > oh yeah one question. web2py's DAL is non-lazy query right?
>
> > > > -vince
>
> > > > > @vince
> > > > > do you have any data we can use to compare web2py to other frameworks?
>
> > > > > Massimo
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13987] Re: Performance tips

2008-12-21 Thread vince

works fine except when omitting cache in IS_IN_DB it will have the
following problem.

  File "/home/web2py/gluon/sqlhtml.py", line 106, in __init__
for k,v in field.requires.options():
  File "gluon/validators.py", line 152, in options
self.build_set()
  File "gluon/validators.py", line 143, in build_set
records=self.dbset.select(*self.fields,**dd)
  File "gluon/sql.py", line 1186, in select
cache_model,time_expire=attributes['cache']
TypeError: 'NoneType' object is not iterable



On Dec 22, 6:30 am, mdipierro  wrote:
> try the latest trunk IS_IN_DB(...cache=(cache.ram,3600))
>
> On Dec 21, 12:39 pm, vince  wrote:
>
> > oh thx i got it.
>
> > can i propose a quick patch to add an optional argument to SQLFORM for
> > passing the cache option to IS_IN_DB.options?
>
> > -vince
>
> > On Dec 22, 2:11 am, mdipierro  wrote:
>
> > > good point. the select is in gluon/validators.py right now there is no
> > > option cache it.
>
> > > Massimo
>
> > > On Dec 21, 11:56 am, vince  wrote:
>
> > > > i was trying to figure out how to cache select inside the SQLFORM.
> > > > let say
> > > > db.Field('info1',db.list),
> > > > db.Field('info2',db.list),
> > > > db.Field('info3',db.list),
>
> > > > i tried to locate the select query inside SQLFORM in sqlhtml.py
>
> > > > elif hasattr(field.requires,'options'):
> > > >      opts=[]
> > > >      for k,v in field.requires.options():
> > > >           opts.append(OPTION(v,_value=k))
>
> > > > can you show me some lights where is the actual select query.
> > > > in some cases if i have many field that is joining the same table it
> > > > will have over a second delay on just the SQLFORM function.
>
> > > > -vince
>
> > > > On Dec 21, 7:03 pm, mdipierro  wrote:
>
> > > > > No it is not lazy evaluated. You can cache selects.
>
> > > > > Massimo
>
> > > > > On Dec 21, 2:15 am, vince  wrote:
>
> > > > > > from my experience pylons should be the fastest one before i notice
> > > > > > web2py. i don't have any accurate data compare to pylons right now 
> > > > > > but
> > > > > > i guess it shouldn't have much different i think.  if u need one 
> > > > > > i'll
> > > > > > try to build a sample benchmarking application for both pylons and
> > > > > > web2py later.
>
> > > > > > one performance issue i notice on web2py is the sqlform/sqltable. if
> > > > > > you have 100 fields in a table u'll notice it. it makes it hard with
> > > > > > high concurrent visitors. although pylons' formbuilder is quite fast
> > > > > > but it's not fair to compare as it's not that powerful/handy. and i
> > > > > > think that can be fix easy by caching the sqlform result and replace
> > > > > > it.
>
> > > > > > oh yeah one question. web2py's DAL is non-lazy query right?
>
> > > > > > -vince
>
> > > > > > > @vince
> > > > > > > do you have any data we can use to compare web2py to other 
> > > > > > > frameworks?
>
> > > > > > > Massimo
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13988] Re: Performance tips

2008-12-21 Thread vince

also is it possible to enable logging for all SQL query execution?



On Dec 22, 6:30 am, mdipierro  wrote:
> try the latest trunk IS_IN_DB(...cache=(cache.ram,3600))
>
> On Dec 21, 12:39 pm, vince  wrote:
>
> > oh thx i got it.
>
> > can i propose a quick patch to add an optional argument to SQLFORM for
> > passing the cache option to IS_IN_DB.options?
>
> > -vince
>
> > On Dec 22, 2:11 am, mdipierro  wrote:
>
> > > good point. the select is in gluon/validators.py right now there is no
> > > option cache it.
>
> > > Massimo
>
> > > On Dec 21, 11:56 am, vince  wrote:
>
> > > > i was trying to figure out how to cache select inside the SQLFORM.
> > > > let say
> > > > db.Field('info1',db.list),
> > > > db.Field('info2',db.list),
> > > > db.Field('info3',db.list),
>
> > > > i tried to locate the select query inside SQLFORM in sqlhtml.py
>
> > > > elif hasattr(field.requires,'options'):
> > > >      opts=[]
> > > >      for k,v in field.requires.options():
> > > >           opts.append(OPTION(v,_value=k))
>
> > > > can you show me some lights where is the actual select query.
> > > > in some cases if i have many field that is joining the same table it
> > > > will have over a second delay on just the SQLFORM function.
>
> > > > -vince
>
> > > > On Dec 21, 7:03 pm, mdipierro  wrote:
>
> > > > > No it is not lazy evaluated. You can cache selects.
>
> > > > > Massimo
>
> > > > > On Dec 21, 2:15 am, vince  wrote:
>
> > > > > > from my experience pylons should be the fastest one before i notice
> > > > > > web2py. i don't have any accurate data compare to pylons right now 
> > > > > > but
> > > > > > i guess it shouldn't have much different i think.  if u need one 
> > > > > > i'll
> > > > > > try to build a sample benchmarking application for both pylons and
> > > > > > web2py later.
>
> > > > > > one performance issue i notice on web2py is the sqlform/sqltable. if
> > > > > > you have 100 fields in a table u'll notice it. it makes it hard with
> > > > > > high concurrent visitors. although pylons' formbuilder is quite fast
> > > > > > but it's not fair to compare as it's not that powerful/handy. and i
> > > > > > think that can be fix easy by caching the sqlform result and replace
> > > > > > it.
>
> > > > > > oh yeah one question. web2py's DAL is non-lazy query right?
>
> > > > > > -vince
>
> > > > > > > @vince
> > > > > > > do you have any data we can use to compare web2py to other 
> > > > > > > frameworks?
>
> > > > > > > Massimo
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13990] simple benchmark

2008-12-21 Thread vince


i've done a simple benchmark between pylons and web2py both testing
page have one single query  one inherit template

pylons: use the quickwiki demo, sqlite sqlalchemy mako
web2py: made a similiar wiki using sqlite





web2py:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.8.8.18 (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests


Server Software:Apache/2.2.3
Server Hostname:10.8.8.18
Server Port:80

Document Path:  /welcometest/wiki
Document Length:1277 bytes

Concurrency Level:  1
Time taken for tests:   19.245 seconds
Complete requests:  200
Failed requests:0
Write errors:   0
Total transferred:  334600 bytes
HTML transferred:   255400 bytes
Requests per second:10.39 [#/sec] (mean)
Time per request:   96.224 [ms] (mean)
Time per request:   96.224 [ms] (mean, across all concurrent
requests)
Transfer rate:  16.98 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:01   3.0  0  30
Processing:75   96  22.7 87 194
Waiting:   74   95  22.7 87 193
Total: 75   96  22.9 88 194

Percentage of the requests served within a certain time (ms)
  50% 88
  66% 94
  75%103
  80%112
  90%126
  95%141
  98%171
  99%187
 100%194 (longest request)



pylons:

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.8.8.17 (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests


Server Software:Apache/2.2.3
Server Hostname:10.8.8.17
Server Port:80

Document Path:  /wiki/
Document Length:511 bytes

Concurrency Level:  1
Time taken for tests:   19.706 seconds
Complete requests:  200
Failed requests:0
Write errors:   0
Total transferred:  142394 bytes
HTML transferred:   102200 bytes
Requests per second:10.15 [#/sec] (mean)
Time per request:   98.530 [ms] (mean)
Time per request:   98.530 [ms] (mean, across all concurrent
requests)
Transfer rate:  7.06 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   1.0  0  13
Processing:78   98  20.0 90 193
Waiting:   77   98  20.0 90 193
Total: 78   98  20.0 91 193

Percentage of the requests served within a certain time (ms)
  50% 91
  66% 98
  75%107
  80%112
  90%127
  95%138
  98%161
  99%190
 100%193 (longest request)

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13991] Re: simple benchmark

2008-12-21 Thread vince

another one with totally identical setup

web2py:
model:
---
db=SQLDB('sqlite://storage.db')
db.define_table('page',
SQLField('title'),
SQLField('body','text'))
---
controller
---
def index():
mypages=db().select
(db.page.id,db.page.title,orderby=db.page.title)
return dict(pages=mypages)
---
view
---
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>

  
QuickWiki 6
  
  

  {{include}}

  

---
{{extend 'layout.html'}}
Title List

{{for page in pages:}}

{{=page.title}}
 [{{=A("visit",_href=URL(r=request,f='show',args=[page.id]))}}]

{{pass}}




pylons:
model:
-
import quickwiki.lib.helpers as h

from pylons import config
from sqlalchemy import Column, MetaData, Table, types
from sqlalchemy.orm import mapper
from sqlalchemy.orm import scoped_session, sessionmaker
Session = scoped_session(sessionmaker(autoflush=True,
transactional=True,
  bind=config
['pylons.g'].sa_engine))
metadata = MetaData()
pages_table = Table('pages', metadata,
Column('title', types.Unicode(40), primary_key=True),
Column('content', types.Unicode(), default='')
)
class Page(object):
content = None

def __str__(self):
return self.title
mapper(Page, pages_table)
---
controller
---
from quickwiki.model import Page
from quickwiki.lib.base import *
def list(self):
c.titles = [page.title for page in Session.query(Page).all()]
return render('/list.mako')

template

http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>

  
QuickWiki 6
  
  

  ${next.body()}

  


<%inherit file="base.mako"/>
Title List

% for title in c.titles:

${title}
  [${h.link_to('visit', h.url_for(title=title, action="index"))}]

% endfor

-



benchmark

web2py
Server Software:Apache/2.2.3
Server Hostname:10.8.8.18
Server Port:80

Document Path:  /welcometest/wiki
Document Length:895 bytes

Concurrency Level:  1
Time taken for tests:   6.398 seconds
Complete requests:  100
Failed requests:0
Write errors:   0
Total transferred:  129000 bytes
HTML transferred:   89500 bytes
Requests per second:15.63 [#/sec] (mean)
Time per request:   63.977 [ms] (mean)
Time per request:   63.977 [ms] (mean, across all concurrent
requests)
Transfer rate:  19.69 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:01   2.4  0  20
Processing:49   63  16.2 56 130
Waiting:   49   63  16.1 56 130
Total: 49   64  16.3 57 130

Percentage of the requests served within a certain time (ms)
  50% 57
  66% 64
  75% 69
  80% 75
  90% 85
  95%100
  98%122
  99%130
 100%130 (longest request)

pylons
Server Software:Apache/2.2.3
Server Hostname:10.8.8.17
Server Port:80

Document Path:  /wiki/page/list
Document Length:895 bytes

Concurrency Level:  1
Time taken for tests:   6.188 seconds
Complete requests:  100
Failed requests:0
Write errors:   0
Total transferred:  109660 bytes
HTML transferred:   89500 bytes
Requests per second:16.16 [#/sec] (mean)
Time per request:   61.884 [ms] (mean)
Time per request:   61.884 [ms] (mean, across all concurrent
requests)
Transfer rate:  17.30 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.8  0   9
Processing:49   61  13.7 58 130
Waiting:   48   61  13.7 58 129
Total: 49   62  13.8 58 130

Percentage of the requests served within a certain time (ms)
  50% 58
  66% 61
  75% 65
  80% 68
  90% 81
  95% 86
  98%111
  99%130
 100%130 (longest request)



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13992] Re: simple benchmark

2008-12-21 Thread vince

another one with totally identical setup

web2py:
model:
---
db=SQLDB('sqlite://storage.db')
db.define_table('page',
SQLField('title'),
SQLField('body','text'))
---
controller
---
def index():
mypages=db().select
(db.page.id,db.page.title,orderby=db.page.title)
return dict(pages=mypages)
---
view
---
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>

  
QuickWiki 6
  
  

  {{include}}

  

---
{{extend 'layout.html'}}
Title List

{{for page in pages:}}

{{=page.title}}
 [{{=A("visit",_href=URL(r=request,f='show',args=[page.id]))}}]

{{pass}}


pylons:
model:
-
import quickwiki.lib.helpers as h

from pylons import config
from sqlalchemy import Column, MetaData, Table, types
from sqlalchemy.orm import mapper
from sqlalchemy.orm import scoped_session, sessionmaker
Session = scoped_session(sessionmaker(autoflush=True,
transactional=True,
  bind=config
['pylons.g'].sa_engine))
metadata = MetaData()
pages_table = Table('pages', metadata,
Column('title', types.Unicode(40), primary_key=True),
Column('content', types.Unicode(), default='')
)
class Page(object):
content = None

def __str__(self):
return self.title
mapper(Page, pages_table)
---
controller
---
from quickwiki.model import Page
from quickwiki.lib.base import *
def list(self):
c.titles = [page.title for page in Session.query(Page).all()]
return render('/list.mako')

template

http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>

  
QuickWiki 6
  
  

  ${next.body()}

  


<%inherit file="base.mako"/>
Title List

% for title in c.titles:

${title}
  [${h.link_to('visit', h.url_for(title=title, action="index"))}]

% endfor

-

benchmark

web2py:
Server Software:Apache/2.2.3
Server Hostname:10.8.8.18
Server Port:80

Document Path:  /welcometest/wiki
Document Length:895 bytes

Concurrency Level:  1
Time taken for tests:   4.428 seconds
Complete requests:  100
Failed requests:0
Write errors:   0
Total transferred:  129000 bytes
HTML transferred:   89500 bytes
Requests per second:22.58 [#/sec] (mean)
Time per request:   44.278 [ms] (mean)
Time per request:   44.278 [ms] (mean, across all concurrent
requests)
Transfer rate:  28.45 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:01   1.8  0  18
Processing:38   44   6.1 42  72
Waiting:   38   44   6.0 41  70
Total: 39   44   6.4 42  72

Percentage of the requests served within a certain time (ms)
  50% 42
  66% 43
  75% 44
  80% 48
  90% 54
  95% 57
  98% 66
  99% 72
 100% 72 (longest request)


pylons:
Server Software:Apache/2.2.3
Server Hostname:10.8.8.17
Server Port:80

Document Path:  /wiki/page/list
Document Length:895 bytes

Concurrency Level:  1
Time taken for tests:   5.191 seconds
Complete requests:  100
Failed requests:0
Write errors:   0
Total transferred:  109219 bytes
HTML transferred:   89500 bytes
Requests per second:19.27 [#/sec] (mean)
Time per request:   51.906 [ms] (mean)
Time per request:   51.906 [ms] (mean, across all concurrent
requests)
Transfer rate:  20.55 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   1.8  0  19
Processing:47   51   3.1 51  64
Waiting:   47   51   3.1 51  64
Total: 47   52   3.6 51  70

Percentage of the requests served within a certain time (ms)
  50% 51
  66% 52
  75% 54
  80% 54
  90% 57
  95% 58
  98% 64
  99% 70
 100% 70 (longest request)



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:13999] Re: Performance tips

2008-12-22 Thread vince

db._lastsql only record the last sql query right? is that any easy way
to log all the sql query it's executing to a file like sql.log does
for table update? i think it's really useful for preference fine tune.

-vince

On Dec 22, 4:26 pm, mdipierro  wrote:
> Will think about it but for now:
>
> def timer(myfile,db,f):
>       import time
>       t0=time.time()
>       f()
>       t0=time.time()-t0
>       myfile.wriite('%s: %s\n' % (t0,db._lastsql)
>
> myfile=open('mylogfile.log','w')
> rows=timer(myfile,db,lambda:db(db.table.id>0).select())
>
> Massimo
>
> On Dec 22, 1:04 am, Jonathan Benn  wrote:
>
> > Hi,
>
> > On Dec 22, 4:52 am, vince  wrote:
>
> > > also is it possible to enable logging for all SQL query execution?
>
> > Logging with a timer included would be really handy.
>
> > Sincerely,
>
> > --Jonathan
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14001] Re: simple benchmark

2008-12-22 Thread vince

oh actually pylons one was compiled as when it's running under
mod_wsgi u need to touch the wsgihandler or it will use pyc directly.
i don't think packing pylons project into compiled egg will increase
performance.


compiled version, stock centos5.2 x86_64, python2.5.2 and mod_wsgi 2.3
(self compiled x86_64), cpu underclocked at 1G
model name  : AMD Athlon(tm) 64 X2 Dual Core Processor 5000+
cpu MHz : 1000.000

# ab -n 500

web2py
Server Software:Apache/2.2.3
Server Hostname:10.8.8.18
Server Port:80

Document Path:  /welcometest/wiki
Document Length:889 bytes

Concurrency Level:  1
Time taken for tests:   20.955 seconds
Complete requests:  500
Failed requests:0
Write errors:   0
Total transferred:  642000 bytes
HTML transferred:   444500 bytes
Requests per second:23.86 [#/sec] (mean)
Time per request:   41.909 [ms] (mean)
Time per request:   41.909 [ms] (mean, across all concurrent
requests)
Transfer rate:  29.92 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.9  0  15
Processing:37   41   5.0 40  70
Waiting:   36   41   5.0 40  70
Total: 37   42   5.1 40  70

Percentage of the requests served within a certain time (ms)
  50% 40
  66% 41
  75% 42
  80% 43
  90% 50
  95% 53
  98% 56
  99% 64
 100% 70 (longest request)


pylons

Server Software:Apache/2.2.3
Server Hostname:10.8.8.17
Server Port:80

Document Path:  /wiki/page/list
Document Length:895 bytes

Concurrency Level:  1
Time taken for tests:   26.368 seconds
Complete requests:  500
Failed requests:0
Write errors:   0
Total transferred:  546221 bytes
HTML transferred:   447500 bytes
Requests per second:18.96 [#/sec] (mean)
Time per request:   52.736 [ms] (mean)
Time per request:   52.736 [ms] (mean, across all concurrent
requests)
Transfer rate:  20.23 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   2.8  0  60
Processing:46   52   6.6 51 152
Waiting:   46   52   6.7 51 152
Total: 47   53   7.2 51 153

Percentage of the requests served within a certain time (ms)
  50% 51
  66% 52
  75% 54
  80% 54
  90% 58
  95% 61
  98% 70
  99% 78
 100%153 (longest request)





--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14002] Re: simple benchmark

2008-12-22 Thread vince

oh actually pylons one was compiled as when it's running under
mod_wsgi u need to touch the wsgihandler or it will use pyc directly.
i don't think packing pylons project into compiled egg will increase
performance.

compiled version, stock centos5.2 x86_64, python2.5.2 and mod_wsgi 2.3
(self compiled x86_64), cpu underclocked at 1G
model name  : AMD Athlon(tm) 64 X2 Dual Core Processor 5000+
cpu MHz : 1000.000

# ab -n 500

web2py

Server Software:Apache/2.2.3
Server Hostname:10.8.8.18
Server Port:80

Document Path:  /welcometest/wiki
Document Length:895 bytes

Concurrency Level:  1
Time taken for tests:   20.865 seconds
Complete requests:  500
Failed requests:0
Write errors:   0
Total transferred:  645000 bytes
HTML transferred:   447500 bytes
Requests per second:23.96 [#/sec] (mean)
Time per request:   41.730 [ms] (mean)
Time per request:   41.730 [ms] (mean, across all concurrent
requests)
Transfer rate:  30.19 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:01   3.9  0  60
Processing:36   41   6.4 39 116
Waiting:   36   41   6.4 39 115
Total: 36   42   7.4 39 116

Percentage of the requests served within a certain time (ms)
  50% 39
  66% 40
  75% 41
  80% 43
  90% 50
  95% 53
  98% 64
  99% 71
 100%116 (longest request)


pylons

Server Software:Apache/2.2.3
Server Hostname:10.8.8.17
Server Port:80

Document Path:  /wiki/page/list
Document Length:895 bytes

Concurrency Level:  1
Time taken for tests:   26.368 seconds
Complete requests:  500
Failed requests:0
Write errors:   0
Total transferred:  546221 bytes
HTML transferred:   447500 bytes
Requests per second:18.96 [#/sec] (mean)
Time per request:   52.736 [ms] (mean)
Time per request:   52.736 [ms] (mean, across all concurrent
requests)
Transfer rate:  20.23 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   2.8  0  60
Processing:46   52   6.6 51 152
Waiting:   46   52   6.7 51 152
Total: 47   53   7.2 51 153

Percentage of the requests served within a certain time (ms)
  50% 51
  66% 52
  75% 54
  80% 54
  90% 58
  95% 61
  98% 70
  99% 78
 100%153 (longest request)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14004] Re: simple benchmark

2008-12-22 Thread vince

ab -c 5 -n 500

web2py

Server Software:Apache/2.2.3
Server Hostname:10.8.8.18
Server Port:80

Document Path:  /welcometest/wiki
Document Length:895 bytes

Concurrency Level:  5
Time taken for tests:   22.284 seconds
Complete requests:  500
Failed requests:0
Write errors:   0
Total transferred:  645000 bytes
HTML transferred:   447500 bytes
Requests per second:22.44 [#/sec] (mean)
Time per request:   222.836 [ms] (mean)
Time per request:   44.567 [ms] (mean, across all concurrent
requests)
Transfer rate:  28.27 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.4  0   6
Processing:69  222  61.0215 596
Waiting:   68  218  60.4212 574
Total: 69  222  61.0215 596

Percentage of the requests served within a certain time (ms)
  50%215
  66%233
  75%249
  80%259
  90%283
  95%319
  98%410
  99%492
 100%596 (longest request)


pylons

Server Software:Apache/2.2.3
Server Hostname:10.8.8.17
Server Port:80

Document Path:  /wiki/page/list
Document Length:895 bytes

Concurrency Level:  5
Time taken for tests:   32.494 seconds
Complete requests:  500
Failed requests:0
Write errors:   0
Total transferred:  544961 bytes
HTML transferred:   447500 bytes
Requests per second:15.39 [#/sec] (mean)
Time per request:   324.936 [ms] (mean)
Time per request:   64.987 [ms] (mean, across all concurrent
requests)
Transfer rate:  16.38 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.6  0   7
Processing:   131  324  53.4321 771
Waiting:  129  321  52.7318 771
Total:131  324  53.3321 772

Percentage of the requests served within a certain time (ms)
  50%321
  66%338
  75%350
  80%357
  90%382
  95%403
  98%447
  99%508
 100%772 (longest request)



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14005] Re: simple benchmark

2008-12-22 Thread vince

ab -c 10 -n 500

web2py

Server Software:Apache/2.2.3
Server Hostname:10.8.8.18
Server Port:80

Document Path:  /welcometest/wiki
Document Length:895 bytes

Concurrency Level:  10
Time taken for tests:   22.178 seconds
Complete requests:  500
Failed requests:0
Write errors:   0
Total transferred:  645000 bytes
HTML transferred:   447500 bytes
Requests per second:22.54 [#/sec] (mean)
Time per request:   443.567 [ms] (mean)
Time per request:   44.357 [ms] (mean, across all concurrent
requests)
Transfer rate:  28.40 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:01   5.3  0  73
Processing:87  441 111.04281064
Waiting:   77  437 110.74251049
Total: 88  442 111.94281064

Percentage of the requests served within a certain time (ms)
  50%428
  66%473
  75%501
  80%522
  90%573
  95%623
  98%711
  99%832
 100%   1064 (longest request)



pylons

Server Software:Apache/2.2.3
Server Hostname:10.8.8.17
Server Port:80

Document Path:  /wiki/page/list
Document Length:895 bytes

Concurrency Level:  10
Time taken for tests:   33.341 seconds
Complete requests:  500
Failed requests:0
Write errors:   0
Total transferred:  544604 bytes
HTML transferred:   447500 bytes
Requests per second:15.00 [#/sec] (mean)
Time per request:   666.826 [ms] (mean)
Time per request:   66.683 [ms] (mean, across all concurrent
requests)
Transfer rate:  15.95 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.1  0   2
Processing:   151  664 105.06611088
Waiting:  151  660 104.96581088
Total:151  664 105.06611088

Percentage of the requests served within a certain time (ms)
  50%661
  66%695
  75%720
  80%733
  90%780
  95%830
  98%944
  99%   1007
 100%   1088 (longest request)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14009] Re: simple benchmark

2008-12-22 Thread vince

sure will do.

-vince
On Dec 22, 5:50 pm, mdipierro  wrote:
> Bottom line: we are +50% faster (22-23 rq/sec vs 15-18)!
>
> Thank you vince.
>
> Would you add an entry in thehttp://mdp.cti.depaul.edu/web2py_wiki
> summarzing your results and posting sample code?
>
> Massimo
>
> On Dec 22, 3:36 am, vince  wrote:
>
> > ab -c 10 -n 500
>
> > web2py
>
> > Server Software:        Apache/2.2.3
> > Server Hostname:        10.8.8.18
> > Server Port:            80
>
> > Document Path:          /welcometest/wiki
> > Document Length:        895 bytes
>
> > Concurrency Level:      10
> > Time taken for tests:   22.178 seconds
> > Complete requests:      500
> > Failed requests:        0
> > Write errors:           0
> > Total transferred:      645000 bytes
> > HTML transferred:       447500 bytes
> > Requests per second:    22.54 [#/sec] (mean)
> > Time per request:       443.567 [ms] (mean)
> > Time per request:       44.357 [ms] (mean, across all concurrent
> > requests)
> > Transfer rate:          28.40 [Kbytes/sec] received
>
> > Connection Times (ms)
> >               min  mean[+/-sd] median   max
> > Connect:        0    1   5.3      0      73
> > Processing:    87  441 111.0    428    1064
> > Waiting:       77  437 110.7    425    1049
> > Total:         88  442 111.9    428    1064
>
> > Percentage of the requests served within a certain time (ms)
> >   50%    428
> >   66%    473
> >   75%    501
> >   80%    522
> >   90%    573
> >   95%    623
> >   98%    711
> >   99%    832
> >  100%   1064 (longest request)
>
> > pylons
>
> > Server Software:        Apache/2.2.3
> > Server Hostname:        10.8.8.17
> > Server Port:            80
>
> > Document Path:          /wiki/page/list
> > Document Length:        895 bytes
>
> > Concurrency Level:      10
> > Time taken for tests:   33.341 seconds
> > Complete requests:      500
> > Failed requests:        0
> > Write errors:           0
> > Total transferred:      544604 bytes
> > HTML transferred:       447500 bytes
> > Requests per second:    15.00 [#/sec] (mean)
> > Time per request:       666.826 [ms] (mean)
> > Time per request:       66.683 [ms] (mean, across all concurrent
> > requests)
> > Transfer rate:          15.95 [Kbytes/sec] received
>
> > Connection Times (ms)
> >               min  mean[+/-sd] median   max
> > Connect:        0    0   0.1      0       2
> > Processing:   151  664 105.0    661    1088
> > Waiting:      151  660 104.9    658    1088
> > Total:        151  664 105.0    661    1088
>
> > Percentage of the requests served within a certain time (ms)
> >   50%    661
> >   66%    695
> >   75%    720
> >   80%    733
> >   90%    780
> >   95%    830
> >   98%    944
> >   99%   1007
> >  100%   1088 (longest request)
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14008] Re: Performance tips

2008-12-22 Thread vince

db._execute=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
  File "gluon/sql.py", line 305, in __setattr__
raise SyntaxError, 'Object exists and cannot be redefined'
SyntaxError: Object exists and cannot be redefined



On Dec 22, 5:43 pm, mdipierro  wrote:
> db=SQLDB(...)
> def timer(db,f):
>       import time,os
>       import gluon.portalocker
>       myfile=open(os.path.join
> (request.folder,'databases','sql.log'),'a')
>       gluon.portalocker,lock(myfile, gluon.portalocker.LOCK_EX)
>       t0=time.time()
>       f()
>       t0=time.time()-t0
>       gluon.portalocker,unlock(myfile)
>       myfile.wriite('%s: %s\n' % (t0,db._lastsql)
> db._execute=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
>
> On Dec 22, 2:54 am, vince  wrote:
>
> > db._lastsql only record the last sql query right? is that any easy way
> > to log all the sql query it's executing to a file like sql.log does
> > for table update? i think it's really useful for preference fine tune.
>
> > -vince
>
> > On Dec 22, 4:26 pm, mdipierro  wrote:
>
> > > Will think about it but for now:
>
> > > def timer(myfile,db,f):
> > >       import time
> > >       t0=time.time()
> > >       f()
> > >       t0=time.time()-t0
> > >       myfile.wriite('%s: %s\n' % (t0,db._lastsql)
>
> > > myfile=open('mylogfile.log','w')
> > > rows=timer(myfile,db,lambda:db(db.table.id>0).select())
>
> > > Massimo
>
> > > On Dec 22, 1:04 am, Jonathan Benn  wrote:
>
> > > > Hi,
>
> > > > On Dec 22, 4:52 am, vince  wrote:
>
> > > > > also is it possible to enable logging for all SQL query execution?
>
> > > > Logging with a timer included would be really handy.
>
> > > > Sincerely,
>
> > > > --Jonathan
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14032] Re: Performance tips

2008-12-22 Thread vince

it freezed and i tried debugging. it seems to be a recursive dead lock
problem.

def timer(db,f):
  import time,os
  import gluon.portalocker
  myfile=open(os.path.join
(request.folder,'databases','sql.log'),'a')
  print "locking"
  gluon.portalocker.lock(myfile, gluon.portalocker.LOCK_EX)
  t0=time.time()
  print "pre f()"
  f()
  t0=time.time()-t0
  print "unlocking"
  gluon.portalocker.unlock(myfile)
  myfile.write('%s: %s\n' % (t0,db._lastsql))
db['_execute']=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))

and the output

locking
pre f()
locking




-vince


On Dec 22, 6:20 pm, mdipierro  wrote:
> grr
>
> db['_execute']=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
>
> On Dec 22, 4:17 am, vince  wrote:
>
> >     db._execute=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
> >   File "gluon/sql.py", line 305, in __setattr__
> >     raise SyntaxError, 'Object exists and cannot be redefined'
> > SyntaxError: Object exists and cannot be redefined
>
> > On Dec 22, 5:43 pm, mdipierro  wrote:
>
> > > db=SQLDB(...)
> > > def timer(db,f):
> > >       import time,os
> > >       import gluon.portalocker
> > >       myfile=open(os.path.join
> > > (request.folder,'databases','sql.log'),'a')
> > >       gluon.portalocker,lock(myfile, gluon.portalocker.LOCK_EX)
> > >       t0=time.time()
> > >       f()
> > >       t0=time.time()-t0
> > >       gluon.portalocker,unlock(myfile)
> > >       myfile.wriite('%s: %s\n' % (t0,db._lastsql)
> > > db._execute=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
>
> > > On Dec 22, 2:54 am, vince  wrote:
>
> > > > db._lastsql only record the last sql query right? is that any easy way
> > > > to log all the sql query it's executing to a file like sql.log does
> > > > for table update? i think it's really useful for preference fine tune.
>
> > > > -vince
>
> > > > On Dec 22, 4:26 pm, mdipierro  wrote:
>
> > > > > Will think about it but for now:
>
> > > > > def timer(myfile,db,f):
> > > > >       import time
> > > > >       t0=time.time()
> > > > >       f()
> > > > >       t0=time.time()-t0
> > > > >       myfile.wriite('%s: %s\n' % (t0,db._lastsql)
>
> > > > > myfile=open('mylogfile.log','w')
> > > > > rows=timer(myfile,db,lambda:db(db.table.id>0).select())
>
> > > > > Massimo
>
> > > > > On Dec 22, 1:04 am, Jonathan Benn  wrote:
>
> > > > > > Hi,
>
> > > > > > On Dec 22, 4:52 am, vince  wrote:
>
> > > > > > > also is it possible to enable logging for all SQL query execution?
>
> > > > > > Logging with a timer included would be really handy.
>
> > > > > > Sincerely,
>
> > > > > > --Jonathan
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14034] Re: simple benchmark

2008-12-22 Thread vince

mod_wsgi on apache doing quite well. i'll sure take a look it.

-vince

On Dec 22, 6:26 pm, mmstud  wrote:
> Have you ever considered using libevent based server (FAPWS2)? I
> realized the excellence of libevent (what comes to performance and
> concurrency) year or so ago and to my glad just found, that there has
> been python projects, that uses it.
>
> -Marko
>
> On 22 joulu, 12:18, vince  wrote:
>
> > sure will do.
>
> > -vince
> > On Dec 22, 5:50 pm, mdipierro  wrote:
>
> > > Bottom line: we are +50% faster (22-23 rq/sec vs 15-18)!
>
> > > Thank you vince.
>
> > > Would you add an entry in thehttp://mdp.cti.depaul.edu/web2py_wiki
> > > summarzing your results and posting sample code?
>
> > > Massimo
>
> > > On Dec 22, 3:36 am, vince  wrote:
>
> > > > ab -c 10 -n 500
>
> > > > web2py
>
> > > > Server Software:        Apache/2.2.3
> > > > Server Hostname:        10.8.8.18
> > > > Server Port:            80
>
> > > > Document Path:          /welcometest/wiki
> > > > Document Length:        895 bytes
>
> > > > Concurrency Level:      10
> > > > Time taken for tests:   22.178 seconds
> > > > Complete requests:      500
> > > > Failed requests:        0
> > > > Write errors:           0
> > > > Total transferred:      645000 bytes
> > > > HTML transferred:       447500 bytes
> > > > Requests per second:    22.54 [#/sec] (mean)
> > > > Time per request:       443.567 [ms] (mean)
> > > > Time per request:       44.357 [ms] (mean, across all concurrent
> > > > requests)
> > > > Transfer rate:          28.40 [Kbytes/sec] received
>
> > > > Connection Times (ms)
> > > >               min  mean[+/-sd] median   max
> > > > Connect:        0    1   5.3      0      73
> > > > Processing:    87  441 111.0    428    1064
> > > > Waiting:       77  437 110.7    425    1049
> > > > Total:         88  442 111.9    428    1064
>
> > > > Percentage of the requests served within a certain time (ms)
> > > >   50%    428
> > > >   66%    473
> > > >   75%    501
> > > >   80%    522
> > > >   90%    573
> > > >   95%    623
> > > >   98%    711
> > > >   99%    832
> > > >  100%   1064 (longest request)
>
> > > > pylons
>
> > > > Server Software:        Apache/2.2.3
> > > > Server Hostname:        10.8.8.17
> > > > Server Port:            80
>
> > > > Document Path:          /wiki/page/list
> > > > Document Length:        895 bytes
>
> > > > Concurrency Level:      10
> > > > Time taken for tests:   33.341 seconds
> > > > Complete requests:      500
> > > > Failed requests:        0
> > > > Write errors:           0
> > > > Total transferred:      544604 bytes
> > > > HTML transferred:       447500 bytes
> > > > Requests per second:    15.00 [#/sec] (mean)
> > > > Time per request:       666.826 [ms] (mean)
> > > > Time per request:       66.683 [ms] (mean, across all concurrent
> > > > requests)
> > > > Transfer rate:          15.95 [Kbytes/sec] received
>
> > > > Connection Times (ms)
> > > >               min  mean[+/-sd] median   max
> > > > Connect:        0    0   0.1      0       2
> > > > Processing:   151  664 105.0    661    1088
> > > > Waiting:      151  660 104.9    658    1088
> > > > Total:        151  664 105.0    661    1088
>
> > > > Percentage of the requests served within a certain time (ms)
> > > >   50%    661
> > > >   66%    695
> > > >   75%    720
> > > >   80%    733
> > > >   90%    780
> > > >   95%    830
> > > >   98%    944
> > > >   99%   1007
> > > >  100%   1088 (longest request)
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14035] Re: Performance revisited

2008-12-22 Thread vince

you'll have to provide more details if u need help from us. 1500 users
a day can do well even without any caching

you'll have to figure out where is the bottleneck first. use a simple

import time
t0 = time.clock()
some code
t0 = time.clock-t0
print t0

can help you debug your problem


On Dec 22, 11:51 pm, voltron  wrote:
> Hi all,
>
> I am still having serious problems. Contrary to what I posted before,
> the site in question serves an average of 1, 500 users a day. I have
> used cacheing for several pages but to my dismay, I noticed that the
> cached pages display the default web2py template instead of the
> template which I assigned to the controller actions. I am using
> PostgreSQL with pools = 10
>
> Any other ideas?
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14042] Re: Performance tips

2008-12-22 Thread vince

this one with the errors

  File "gluon/sql.py", line 1184, in select
r=response(query)
  File "gluon/sql.py", line 1180, in response
self._db._execute(query)
  File "/home/web2py/applications/cychurch/models/db.py", line 255, in

db['_execute']=lambda f=db._execute,*a,**b: timer(db,lambda:f
(*a,**b))
  File "/home/web2py/applications/cychurch/models/db.py", line 248, in
timer
f()
  File "/home/web2py/applications/cychurch/models/db.py", line 255, in

db['_execute']=lambda f=db._execute,*a,**b: timer(db,lambda:f
(*a,**b))
TypeError: 'str' object is not callable



On Dec 23, 2:39 am, mdipierro  wrote:
> try this
>
> db['_execute']=lambda f=db._execute,*a,**b: timer(db,lambda:f(*a,**b))
>
> On Dec 22, 9:50 am, vince  wrote:
>
> > it freezed and i tried debugging. it seems to be a recursive dead lock
> > problem.
>
> > def timer(db,f):
> >       import time,os
> >       import gluon.portalocker
> >       myfile=open(os.path.join
> > (request.folder,'databases','sql.log'),'a')
> >       print "locking"
> >       gluon.portalocker.lock(myfile, gluon.portalocker.LOCK_EX)
> >       t0=time.time()
> >       print "pre f()"
> >       f()
> >       t0=time.time()-t0
> >       print "unlocking"
> >       gluon.portalocker.unlock(myfile)
> >       myfile.write('%s: %s\n' % (t0,db._lastsql))
> > db['_execute']=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
>
> > and the output
>
> > locking
> > pre f()
> > locking
>
> > -vince
>
> > On Dec 22, 6:20 pm, mdipierro  wrote:
>
> > > grr
>
> > > db['_execute']=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
>
> > > On Dec 22, 4:17 am, vince  wrote:
>
> > > >     db._execute=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
> > > >   File "gluon/sql.py", line 305, in __setattr__
> > > >     raise SyntaxError, 'Object exists and cannot be redefined'
> > > > SyntaxError: Object exists and cannot be redefined
>
> > > > On Dec 22, 5:43 pm, mdipierro  wrote:
>
> > > > > db=SQLDB(...)
> > > > > def timer(db,f):
> > > > >       import time,os
> > > > >       import gluon.portalocker
> > > > >       myfile=open(os.path.join
> > > > > (request.folder,'databases','sql.log'),'a')
> > > > >       gluon.portalocker,lock(myfile, gluon.portalocker.LOCK_EX)
> > > > >       t0=time.time()
> > > > >       f()
> > > > >       t0=time.time()-t0
> > > > >       gluon.portalocker,unlock(myfile)
> > > > >       myfile.wriite('%s: %s\n' % (t0,db._lastsql)
> > > > > db._execute=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
>
> > > > > On Dec 22, 2:54 am, vince  wrote:
>
> > > > > > db._lastsql only record the last sql query right? is that any easy 
> > > > > > way
> > > > > > to log all the sql query it's executing to a file like sql.log does
> > > > > > for table update? i think it's really useful for preference fine 
> > > > > > tune.
>
> > > > > > -vince
>
> > > > > > On Dec 22, 4:26 pm, mdipierro  wrote:
>
> > > > > > > Will think about it but for now:
>
> > > > > > > def timer(myfile,db,f):
> > > > > > >       import time
> > > > > > >       t0=time.time()
> > > > > > >       f()
> > > > > > >       t0=time.time()-t0
> > > > > > >       myfile.wriite('%s: %s\n' % (t0,db._lastsql)
>
> > > > > > > myfile=open('mylogfile.log','w')
> > > > > > > rows=timer(myfile,db,lambda:db(db.table.id>0).select())
>
> > > > > > > Massimo
>
> > > > > > > On Dec 22, 1:04 am, Jonathan Benn  wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > On Dec 22, 4:52 am, vince  wrote:
>
> > > > > > > > > also is it possible to enable logging for all SQL query 
> > > > > > > > > execution?
>
> > > > > > > > Logging with a timer included would be really handy.
>
> > > > > > > > Sincerely,
>
> > > > > > > > --Jonathan
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14067] Re: Performance tips

2008-12-23 Thread vince

i am still seeking the way to log all sql query for SQLDB. the
following error still have error. i tried to look into sql.py but
really have no quick solution myself. the way  jonathan use to wrap
the whole db class seems working except when using  cache.

def timer(db,f):
  import time,os
  import gluon.portalocker
  myfile=open(os.path.join
(request.folder,'databases','sql.log'),'a')
  gluon.portalocker.lock(myfile, gluon.portalocker.LOCK_EX)
  t0=time.time()
  f()
  t0=time.time()-t0
  gluon.portalocker.unlock(myfile)
  myfile.write('%s: %s\n' % (t0,db._lastsql))

db['_execute']=lambda f=db._execute,*a,**b: timer(db,lambda:f(*a,**b))

  File "gluon/sql.py", line 1184, in select
r=response(query)
  File "gluon/sql.py", line 1180, in response
self._db._execute(query)
  File "/home/web2py/applications/cychurch/models/db.py", line 255, in

db['_execute']=lambda f=db._execute,*a,**b: timer(db,lambda:f
(*a,**b))
  File "/home/web2py/applications/cychurch/models/db.py", line 248, in
timer
f()
  File "/home/web2py/applications/cychurch/models/db.py", line 255, in

db['_execute']=lambda f=db._execute,*a,**b: timer(db,lambda:f
(*a,**b))
TypeError: 'str' object is not callable

-vince

On Dec 23, 9:41 pm, mdipierro  wrote:
> in latest trunk, _lastsql on GAE is a string but only says "select" ,
> "delete", "insert" etc. Better than nothing for now.
>
> Massimo
>
> On Dec 23, 12:14 am, Jonathan Benn  wrote:
>
> > Hi all,
>
> > On Dec 22, 12:43 pm, mdipierro  wrote:
>
> > > db=SQLDB(...)
> > > def timer(db,f):
> > >       import time,os
> > >       import gluon.portalocker
> > >       myfile=open(os.path.join
> > > (request.folder,'databases','sql.log'),'a')
> > >       gluon.portalocker,lock(myfile, gluon.portalocker.LOCK_EX)
> > >       t0=time.time()
> > >       f()
> > >       t0=time.time()-t0
> > >       gluon.portalocker,unlock(myfile)
> > >       myfile.wriite('%s: %s\n' % (t0,db._lastsql)
> > > db._execute=lambda *a,**b: timer(db,lambda:db._execute(*a,**b))
>
> > Unfortunately the above code doesn't work for for GAE. I tried the
> > following solution in my model:
>
> > import time, logging
> > class DatabaseDecorator(GQLDB):
> >     def __timer(self, where):
> >         if not self._lastsql:
> >             value = GQLDB.__call__(self, where)
> >         else:
> >             t0 = time.time()
> >             value = GQLDB.__call__(self, where)
> >             t1 = time.time() - t0
> >             logging.critical('%s : %.0f ms' % (self._lastsql, t1))
> >         return value
>
> >     def __call__(self, where=''):
> >         return self.__timer(where)
>
> > db=DatabaseDecorator()  # connect to Google BigTable
>
> > There's only one big problem: GQLDB._lastsql gives you Google's
> > "Query" object, which doesn't have a string representation.  I wonder
> > if there's an easy way to store the query string in GQLDB, as
> > GQLDB._lastsqlstring or something?
>
> > Sincerely,
>
> > --Jonathan
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14238] sqlrow to json again

2008-12-29 Thread vince

http://groups.google.com/group/web2py/browse_thread/thread/8e3e33879974663f/64f76c562366aec4?lnk=gst&q=json#64f76c562366aec4

will it be added or we'll have to wait? i think it's hard to avoid all
dependency contrib / thirdparty package. as long as it's include i
think that's fine.


-vince
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14239] Re: reportlab in web2py?

2008-12-29 Thread vince

i think pdf generation is necessary but the size may affect those user
who do not need it.

any convenient way to include reportlab to web2py right now? (at least
compatible on win32/osx and linux)


-vince
On Dec 27, 12:20 am, mdipierro  wrote:
> There is a problem with makingreportlaban appliance.
>
> Some modules internally use relative paths, some use absolute paths.
>
> If they use relative paths, it does not matter where the are located.
> They can be, for example, into an appliance. All current web2py
> modules use relative paths thus web2py never alters sys.path.
>
> If they use absolute paths (likereportlabdoes) they must be located
> in a folder that is listed in sys.path. An app cannot alter sys.path
> because that is not completely thread safe.
>
> One solution would be to give web2py it's own site-packages folder
> where apps can install-uninstall additional global modules.
> This would be fine for users running the windows binary distribution
> but I am sure anybody running from source will oppose it.
>
> In order to includereportlabin web2py I would have to append gluon/
> contrib to sys.path.
>
> Massimo
>
> On Dec 26, 8:18 am, dhmorgan  wrote:
>
> > I likeReportLaband think of PDF generation as a necessary component.
> > I also know it took some time to get a handle on using it. I wouldn't
> > worry about how much size it adds as much as the overhead of making
> > and keeping it easy to use. Seems that it should be an appliance
> > rather than something built into web2py.
>
> > On Dec 24, 11:23 am, pmate  wrote:
>
> > > Pisa is really nice, but i'm totally proreportlab.
> > > It's true that it is a little heavy but it's a great solution for
> > > printing in web2py
>
> > > Paolo
>
> > > On Dec 24, 3:36 pm, Timothy Farrell  wrote:
>
> > > > Just like you would normally run a long-running process in web2py, 
> > > > os.spawn is my favorite (python offers numerous methods).
> > > > But...do we really want a framework that installs software on demand 
> > > > (without prompting an admin)?  I say, let's just leave it to the 
> > > > humans.  It's one thing to make someone's life easier, it's another to 
> > > > allow them to get away from a process that they should know about and 
> > > > control (like messing with IP tables programmatically).
> > > > Further driving the point, easy_install installs the latest version of 
> > > > a package.  When I did this, it broke form-encode for me.
> > > > -tim
> > > > mdipierro wrote:is it possible to call easy_install programmatically? 
> > > > Can anybody point me to an example? Massimo On Dec 23, 4:21 pm, Timothy 
> > > > Farrellwrote:easy_installreportlabdang, that's 
> > > > easy! ;-) mr.freeze wrote:It would be nice to have a feature system 
> > > > that allows either manual uploading (similar to the application upload) 
> > > > or on-demand downloading of components likeReportLabso that each person 
> > > > could customize their installation as they see fit. Just daydreaming 
> > > > out loud. It would probably be difficult to implement and maintain. 
> > > > Components like these are very useful but probably shouldn't be 
> > > > included in the framework by default in my opinion. Nathan On Dec 23, 
> > > > 12:41 pm,mdipierrowrote:Should we 
> > > > includereportlabin web2py? pros: web2py lacks printing capability and 
> > > > pdf output may be a solution the license allows it cons: it doubles the 
> > > > size of web2py there are alternative such as the openoffice APIs it 
> > > > requires creating a site-package folder and add it the path Comments? 
> > > > Massimo-- Timothy FarrellComputer Guy Statewide 
> > > > General Insurance Agency (www.swgen.com)-- Timothy 
> > > > FarrellComputer Guy Statewide General Insurance 
> > > > Agency (www.swgen.com)
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14240] Re: open source organization again

2008-12-29 Thread vince

i think that's really necessary for web2py. without anyone providing
business support, cooperate won't trust web2py!

vince

On Dec 28, 3:18 am, mdipierro  wrote:
> Some of you may remember previous threads on creating an organization
> to support web2py adoption and provide business support to the many
> skilled people in this list. This does not exist yet, it will not be a
> replacement for this group but more like a complement for those who
> choose to be part of it.
>
> So far I came up with this:
>
> http://docs.google.com/Doc?id=ddjcrc9c_1c3nmn4dn
>
> comments? suggestions? If you want edit access, just ask.
>
> Can you share some of your previous contracts (anonymized)?
>
> Can you help with a logo?
>
> Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14273] bug on devel trunk revision 320

2008-12-29 Thread vince

Traceback (most recent call last):
  File "gluon/restricted.py", line 62, in restricted
exec ccode in environment
  File "/home/web2py/applications/cychurch/controllers/appadmin.py",
line 209, in 
  File "gluon/globals.py", line 55, in 
self._caller=lambda f: f()
  File "/home/web2py/applications/cychurch/controllers/appadmin.py",
line 197, in update
if form.accepts(request.vars,session):
  File "gluon/sqlhtml.py", line 286, in accepts
fields[fieldname]=int(fields[fieldname])
ValueError: invalid literal for int() with base 10: '\xe5\xbc
\xb5\xe5\xbf\x97\xe9\x81\x93'


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14281] Re: bug on devel trunk revision 320

2008-12-29 Thread vince

this problem exist on 1.54 as well.

if using IS_IN_DB to string field instead of the id field. it will
have the error after form submit.

db.define_table('name_list',
db.Field('name')
)
db.define_table('members',
   db.Field('name',db.name_list),
   )
db.members.name.requires=IS_IN_DB(db,'name_list.name')



On Dec 30, 4:24 am, vince  wrote:
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 62, in restricted
>     exec ccode in environment
>   File "/home/web2py/applications/cychurch/controllers/appadmin.py",
> line 209, in 
>   File "gluon/globals.py", line 55, in 
>     self._caller=lambda f: f()
>   File "/home/web2py/applications/cychurch/controllers/appadmin.py",
> line 197, in update
>     if form.accepts(request.vars,session):
>   File "gluon/sqlhtml.py", line 286, in accepts
>     fields[fieldname]=int(fields[fieldname])
> ValueError: invalid literal for int() with base 10: '\xe5\xbc
> \xb5\xe5\xbf\x97\xe9\x81\x93'
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14284] Re: bug on devel trunk revision 320

2008-12-29 Thread vince

>
> this says the foreign key (a 'name_list.id')  must be in the table name_list
> in a string field, 'name'.
>
> This is why you get an error - you are checking a foreign key (an integer)
> against a string.
>
>

oh so the case is IS_IN_DB allow referring via the key(id) ?


-vince


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14286] Re: bug on devel trunk revision 320

2008-12-29 Thread vince

thanks. it's my mistake that IS_IN_DB should not work this way.

since i need the field holding the name instead of the id, i'll sort
out other solution for it.

-vince

On Dec 30, 6:14 am, "Yarko Tymciurak"  wrote:
> If what you want is a form which will list the names to choose from, then I
> think what you want is something like this:
> db.define_table('name_list',
>    db.Field('name')
>    )
> db.define_table('members',
>   db.Field('name',db.name_list),
>   )
> db.members.name.requires=IS_IN_DB(db,'name_list.id <http://name_list.name>',
> '%(name)s')
>
> On Mon, Dec 29, 2008 at 4:08 PM, vince  wrote:
>
> > > this says the foreign key (a 'name_list.id')  must be in the table
> > name_list
> > > in a string field, 'name'.
>
> > > This is why you get an error - you are checking a foreign key (an
> > integer)
> > > against a string.
>
> > oh so the case is IS_IN_DB allow referring via the key(id) ?
>
> > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14288] sqlform formname question

2008-12-29 Thread vince

form1=SQLFORM(db.members,thisrecord)
form2=SQLFORM(db.products,thisrecord)

refer to the manual SQLFORM should set formname for each form. but i
notice the second form generated by SQLFORM will have no formname.

i try to set the formname myself but fail

form2=SQLFORM(db.products,thisrecord,formname="form2")
form2=SQLFORM(db.products,thisrecord,_formname="form2")
form2.element(_formname="form2")
form2.element(formname="form2")

doesn't work too. anyone have the way to set formname to SQLFORM?

thanks in advance
-vince
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14293] Re: Many-to-Many widgets

2008-12-29 Thread vince

http://groups.google.com/group/web2py/browse_thread/thread/29655ebffb97d7ac/c8dcc5e5ed3c7ea5

this is a simple one. maybe you can base on this widget and workout
something.

-vince

On Dec 30, 4:39 am, Fran  wrote:
> I agree with this thread that a good method for handling the 80% case
> where the Many-to-Many just has the mapping fields would be really
> useful:http://groups.google.com/group/web2py/browse_thread/thread/70273ee7ba...
>
> Massimo, I know that you're not much into including this in SQLFORM
> (since 20% of the time people wish to store extra fields in the M2M
> table such as 'Quantity'), but for me this would be really useful.
>
> I guess the implementation would end up looking something like 
> this:http://code.google.com/p/django-ajax-filtered-fields/
> Another option is the one previously 
> mentioned:http://marinhobrandao.com/blog/p/ajax-many2manyfield-widget-screensho...
> (fromhttp://translate.google.com/translate?hl=en&u=http%3A%2F%2Fmarinhobra...)
>
> Does anyone have samples of work they've done on this?
> - ideally by extending SQLFORM (or t2.create() / t2.update()) but even
> manual HTML examples would be great
> - code ideal but even screenshots or a demo app to play with to se how
> it should look would be useful
>
> For me, I'm more interested in UUID links than ID ones, so an
> implementation that handles that nicely would be perfect :)
>
> Many thanks,
> Fran.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14294] how to do dal not like?

2008-12-29 Thread vince

anyway to do sql not like?
db(!(db.members.name.like('%a%'))).select() or something like that?
anyone like the syntax to do not?

-vince

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14297] Re: how to do dal not like?

2008-12-30 Thread vince

oh thanks alot. i was searching for this NOT operator on the manual
for long!

-vince

On Dec 30, 3:56 pm, "Yarko Tymciurak"  wrote:
> On Tue, Dec 30, 2008 at 1:34 AM, vince  wrote:
>
> > anyway to do sql not like?
> > db(!(db.members.name.like('%a%'))).select() or something like that?
>
> try:
>
>    db( ~(db.members.name.like( '%a' )) ).select()
>
> > anyone like the syntax to do not?
>
> > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14308] Re: Many-to-Many widgets

2008-12-30 Thread vince

oh actually i haven't look t2's widget yet. i'll have a look

i will need to sort out a widget for m2m using multiple select box too
soon. i'll post it here if i come up with anything.
i had an implement for below 50 options using a single text field
holding the id in csv. that's no good for you if you're looking for
hundreds of entries

-vinc



On Dec 30, 7:43 pm, Fran  wrote:
> On Dec 30, 5:59 am, vince  wrote:
>
> >http://groups.google.com/group/web2py/browse_thread/thread/29655ebffb...
> > this is a simple one. maybe you can base on this widget and workout
> > something.
>
> t2.widget() is indeed a nice, simple UI to look at borrowing from.
> This uses a single text field to store entries rather than a Many-to-
> Many field, so I guess performance will get bad when storing lots of
> entries?
> I'll also need to be able to select from potentially hundreds of
> options, so the solution isn't scalable as-is...I think I want to be
> able to select the options from the output of a t2.search() &/or an
> AutoComplete.
>
> Anyway, I'll look at that code & see if it can be used as a starting
> point :)
>
> F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14455] sqlform error message positioning problem

2009-01-03 Thread vince

when sqlform validate with error it will generate the error message
like this
too long!

i think it should be
too long!

so we can position it as well as the table.field__label and
table.field



-vince


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14508] question about win32 build

2009-01-04 Thread vince


i only work on linux and trying to figure out the win32 build of
web2py recently

i tried to put the reportlab's dll files inside the library.zip and
the web2py directory but it didn't work. is the dll files suppose to
put inside sys.path?

thanks in advance,
vince
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14509] Re: sqlform error message positioning problem

2009-01-04 Thread vince

wow that was fast! thanks for the awesome web2py

-vince




On Jan 4, 9:18 pm, mdipierro  wrote:
> In trunk now:
>
> >>> a=FORM(INPUT(_name='test',requires=IS_NOT_EMPTY()))
> >>> a.accepts(request.vars,formname=None)
> False
> >>> print a
>
>  name="test" value="" />cannot be
> empty!
>
> Massimo
>
> On Jan 3, 5:30 pm, mdipierro  wrote:
>
> > Good point. Will do it. Thanks Vince.
>
> > Massimo
>
> > On Jan 3, 3:43 am, vince  wrote:
>
> > > when sqlform validate with error it will generate the error message
> > > like this
> > > too long!
>
> > > i think it should be
> > > too long!
>
> > > so we can position it as well as the table.field__label and
> > > table.field
>
> > > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14552] locking issue

2009-01-04 Thread vince

i just notice single thread, not even with db access, will lock the
whole application. i can only access to other application on the same
server.

is that suppose to be single thread only for each applcation?

-vince


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14560] Re: locking issue

2009-01-05 Thread vince

let say i put the following in application/welcome/controllers/
default.py

def hold():
 import time
 time.sleep(60)
 return "done"

after i access
http://localhost:8000/welcome/default/hold

http://localhost:8000/welcome/ anything will lock until hold is
returned

http://localhost:8000/admin/ or any others application works fine

i even try with a new empty welcome applcation where the model/db.py
is empty

-vince


On Jan 5, 9:02 am, mdipierro  wrote:
> sorry, I do not understand the context of the question.
>
> which operation locks the entire applications?
>
> Massimo
>
> On Jan 4, 5:18 pm, vince  wrote:
>
> > i just notice single thread, not even with db access, will lock the
> > whole application. i can only access to other application on the same
> > server.
>
> > is that suppose to be single thread only for each applcation?
>
> > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14561] Re: question about win32 build

2009-01-05 Thread vince

oh thanks

i didn't know reportlab is pure python(i guess except the image thing)
as it's website come with compiled dll for windows.

stupid me spend hours on copying the dll around haha.

-vince

On Jan 4, 10:06 pm, mdipierro  wrote:
> Just put the reportlab source in the main web2py folder. You only need
> the dll for bitmaps and I am not sure how to do that myself.
>
> On Jan 4, 7:51 am, vince  wrote:
>
> > i only work on linux and trying to figure out the win32 build of
> > web2py recently
>
> > i tried to put the reportlab's dll files inside the library.zip and
> > the web2py directory but it didn't work. is the dll files suppose to
> > put inside sys.path?
>
> > thanks in advance,
> > vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14567] Re: locking issue

2009-01-05 Thread vince

oh thanks for the info

no session still lock the whole application
session.forget()

sql session works fine
session.connect(request,response,db=db)

i think it should make the session default to sql then if file session
have locking issue.


-vince

On Jan 5, 9:04 pm, mdipierro  wrote:
> Because by default you have files in sessions and files are locked to
> guarantee transactional integrity. Replace
>
> def hold():
>  import time
>  time.sleep(60)
>  return "done"
>
> with
>
> def hold():
>  session.forget()
>  import time
>  time.sleep(60)
>  return "done"
>
> and there will be no issue. sessions in db are also not locked (for
> technical reasons).
>
> Massimo
>
> On Jan 5, 2:55 am, vince  wrote:
>
> > let say i put the following in application/welcome/controllers/
> > default.py
>
> > def hold():
> >  import time
> >  time.sleep(60)
> >  return "done"
>
> > after i accesshttp://localhost:8000/welcome/default/hold
>
> >http://localhost:8000/welcome/anythingwill lock until hold is
> > returned
>
> >http://localhost:8000/admin/orany others application works fine
>
> > i even try with a new empty welcome applcation where the model/db.py
> > is empty
>
> > -vince
>
> > On Jan 5, 9:02 am, mdipierro  wrote:
>
> > > sorry, I do not understand the context of the question.
>
> > > which operation locks the entire applications?
>
> > > Massimo
>
> > > On Jan 4, 5:18 pm, vince  wrote:
>
> > > > i just notice single thread, not even with db access, will lock the
> > > > whole application. i can only access to other application on the same
> > > > server.
>
> > > > is that suppose to be single thread only for each applcation?
>
> > > > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14569] Re: locking issue

2009-01-05 Thread vince

oh that's a different case, sorry for my misunderstanding.

-vince

On Jan 5, 10:12 pm, mdipierro  wrote:
> It does not lock the whole application. It simply serializes all
> requests sharing the same session.
> If two different users (or same use using different sessions) connect
> to the same app, they do not see any locking.
> The locking is a feature to prevent race conditions on session
> variables.
>
> Massimo
>
> On Jan 5, 8:03 am, vince  wrote:
>
> > oh thanks for the info
>
> > no session still lock the whole application
> > session.forget()
>
> > sql session works fine
> > session.connect(request,response,db=db)
>
> > i think it should make the session default to sql then if file session
> > have locking issue.
>
> > -vince
>
> > On Jan 5, 9:04 pm, mdipierro  wrote:
>
> > > Because by default you have files in sessions and files are locked to
> > > guarantee transactional integrity. Replace
>
> > > def hold():
> > >  import time
> > >  time.sleep(60)
> > >  return "done"
>
> > > with
>
> > > def hold():
> > >  session.forget()
> > >  import time
> > >  time.sleep(60)
> > >  return "done"
>
> > > and there will be no issue. sessions in db are also not locked (for
> > > technical reasons).
>
> > > Massimo
>
> > > On Jan 5, 2:55 am, vince  wrote:
>
> > > > let say i put the following in application/welcome/controllers/
> > > > default.py
>
> > > > def hold():
> > > >  import time
> > > >  time.sleep(60)
> > > >  return "done"
>
> > > > after i accesshttp://localhost:8000/welcome/default/hold
>
> > > >http://localhost:8000/welcome/anythingwilllockuntil hold is
> > > > returned
>
> > > >http://localhost:8000/admin/oranyothersapplication works fine
>
> > > > i even try with a new empty welcome applcation where the model/db.py
> > > > is empty
>
> > > > -vince
>
> > > > On Jan 5, 9:02 am, mdipierro  wrote:
>
> > > > > sorry, I do not understand the context of the question.
>
> > > > > which operation locks the entire applications?
>
> > > > > Massimo
>
> > > > > On Jan 4, 5:18 pm, vince  wrote:
>
> > > > > > i just notice single thread, not even with db access, will lock the
> > > > > > whole application. i can only access to other application on the 
> > > > > > same
> > > > > > server.
>
> > > > > > is that suppose to be single thread only for each applcation?
>
> > > > > > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:14562] Re: sqlform error message positioning problem

2009-01-05 Thread vince

wow nice formula! no wonder web2py works great

On Jan 4, 10:07 pm, mdipierro  wrote:
> some changes take one line and they are fast (t~exp(1)). Some changing
> take 10 lines they can be slow (t~exp(10)).
>
> Massimo
>
> On Jan 4, 7:52 am, vince  wrote:
>
> > wow that was fast! thanks for the awesome web2py
>
> > -vince
>
> > On Jan 4, 9:18 pm, mdipierro  wrote:
>
> > > In trunk now:
>
> > > >>> a=FORM(INPUT(_name='test',requires=IS_NOT_EMPTY()))
> > > >>> a.accepts(request.vars,formname=None)
> > > False
> > > >>> print a
>
> > >  > > name="test" value="" />cannot be
> > > empty!
>
> > > Massimo
>
> > > On Jan 3, 5:30 pm, mdipierro  wrote:
>
> > > > Good point. Will do it. Thanks Vince.
>
> > > > Massimo
>
> > > > On Jan 3, 3:43 am, vince  wrote:
>
> > > > > when sqlform validate with error it will generate the error message
> > > > > like this
> > > > > too long!
>
> > > > > i think it should be
> > > > > too long!
>
> > > > > so we can position it as well as the table.field__label and
> > > > > table.field
>
> > > > > -vince
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



  1   2   >