[web2py] Re: how to keep response.headers after redirect

2018-01-19 Thread vince
i tried 
 raise HTTP(303,location="url",HEADER_TEST=True)

but i can't find the HEADER_TEST header passed, is this still valid for 
recent version of web2py?


On Monday, November 28, 2011 at 10:43:00 PM UTC+8, Massimo Di Pierro wrote:
>
> Anthony's response suggests a better way to solve your problem yet I
> can see people wanting to forward headers. This is possible.
>
>redirect(URL(...))
>
> is the same as
>
>raise HTTP(303,location=URL(...))
>
> the named arguments of HTTP are headers so you can do:
>
>raise HTTP(303,location=URL(...),success=True)
>
> or (forward all headers)
>
>raise HTTP(303,location=URL(...),**request.headers)
>
> On Nov 28, 7:15 am, thodoris  wrote:
> > I want to do the following:
> >
> > I want to add a key to response.headers
> >
> > response.headers['success']='True'
> >
> > after a successful file upload and also redirect.
> >
> > The problem is that i also want to redirect after successful upload
> > but redirect makes a new reasponse.headers and i lose the key i want
> > to add.
> >
> > Is there a way to solve this?
> >
> > When upload fails and i don't get redirected i can see my key in the
> > headers.
> >
> > My code is:
> >
> > @auth.requires_login()
> > def upload():
> > db.reactable.id.default = request.args(0)
> > form=SQLFORM(db.table)
> > response.headers['success']='False'
> > if form.accepts(request.vars,session):
> > response.headers['success']='True'
> > session.flash="Record added"
> > redirect(URL('index'))
> > return dict(form=form)
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.15.1 is OUT

2017-07-17 Thread vince
i download 
from https://mdipierro.pythonanywhere.com/examples/static/web2py_src.zip

on first line of changelog it's 2.15.0b1

and when i run web2py.py error as below

Traceback (most recent call last):
  File "./web2py.py", line 21, in 
import gluon.widget
  File "/home/web2py/gluon/__init__.py", line 38, in 
from .dal import DAL, Field
  File "/home/web2py/gluon/dal.py", line 19, in 
from gluon import sqlhtml
  File "/home/web2py/gluon/sqlhtml.py", line 32, in 
from pydal.helpers.methods import smart_query, bar_encode, _repr_ref, 
merge_tablemaps
ImportError: cannot import name merge_tablemaps 

-vince

On Tuesday, July 11, 2017 at 5:40:08 AM UTC+8, Massimo Di Pierro wrote:
>
> It took a year. Thanks to everybody who contributed. There are a ton of 
> bug fixes and speed improvements.
>
> I would encourage everybody who contributed to add a comment in this 
> thread explaining the main features/improvements they have made.
>
> If anything does not work or was broken it is only fault and I will remedy 
> if reported.
>
> Massimo
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Future of web2py

2017-06-13 Thread vince
since you've mentioned rethinkdb, just wondering have you completed the 
pydal adapter for rethinkdb yet? it would be nice if you release it with 
web2py too.

On Tuesday, May 30, 2017 at 7:29:20 AM UTC+8, Massimo Di Pierro wrote:
>
> My plan is this
>
> It is based on bottle + gevent + gunicorn + rethinkdb + pydal + vue.js + 
> some code ported from web2py (templates, helpers, validators, 
> internationalization, scheduler)
>
> Unlike web2py it uses modules not execfile and this makes it 10x faster 
> (this part is done) and code it no longer interpreted at every request. 
> Only on change.
>
> Routes are declared using decorators like in bottle and flask.
>
> It will use rethinkdb for storing errors, sessions, and anything user 
> defined. This allows to scale horizontally. Nothing gets stored on the file 
> system any more. Ever. Unless you choose to use sqlite for your app.
>
> No more forms and grids generated server side. Possible and will probably 
> backport SQLFrom and Gid but will discourage it. The default client will be 
> in vue.js. The forms and grids will be generated client-side based on 
> self-documenting APIs. This work must be done. It is not terribly hard just 
> pedantic.
>
> It has a redesigned admin. Not necessarily better but leaner. This part is 
> also done although it may need restyling.
>
> I am ditching a lot of the web2py auth logic. Nobody really uses groups 
> and permissions and the way it is done may not be the best way for 
> everybody. Instead I will default to auth0 integration.
>
> From a developer prospective the code will look very similar and I will be 
> able to recycle 90% of the documentation.
>
> The problems are that web2py grew a bit bloated and typical programming 
> patterns have shifted from postbacks to single page apps with form 
> submission via API. Also web2py does not provide enough tools for scaling 
> since uses filesystem by default. The new version will do less then current 
> web2py but will remedy those issues and make it easier to make responsive 
> and scalable apps.
>
> I am conflicted. I could use help to get this done quicker but I do not 
> want to post something that is half done people are unhappy with. What I 
> would like may not be what everybody likes but I am mostly building this in 
> a way that would work well for myself and share in the hope it is useful to 
> others. BSD license.
>
> If you are willing to help before the code is made public feel free to 
> contact me personally.
>
> Massimo
>  
>
>
>
>
>
> On Sunday, 28 May 2017 11:47:49 UTC-5, Oasis Agano wrote:
>>
>>
>> Is the new framework web3py if so when is the official launch?
>> On Sunday, May 28, 2017 at 2:32:01 AM UTC+2, Relsi Maron wrote:
>>>
>>>
>>> Hi Andrea,
>>>
>>> Yes, there will be a future for web2py!
>>>
>>> Web2py will remain being what it is. :)
>>>
>>> A new version, with support for Python 3, is about to come. Even though 
>>> Massimo is developing a new framework, Web2py will continue to exist - with 
>>> the same purpose for which it was created: to teach development.
>>>
>>> Cheers.
>>>
>>>
>>> Em sábado, 27 de maio de 2017 04:11:02 UTC-3, Andrea Fae' escreveu:

 Hello guys,
 I'd like to know if there will be future of web2py? Any information 
 about it?
 Thanks

>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Please help us test the 2.9.12 binaries

2015-02-10 Thread vince
i have the same problem too, 2.9.11 works fine.

On Saturday, January 10, 2015 at 4:54:58 AM UTC+8, Dmitry Ermolaev wrote:
>
> I use _src.zip 
>
>>  'DAL' object has no attribute 'Field'
>> Versionweb2py™Version 2.9.12-beta+timestamp.2015.01.07.16.40.02PythonPython 
>> 2.7.8: C:\Python27\python.exe (prefix: C:\Python27)Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>>
>> Traceback (most recent call last):
>>   File "C:\web2py-9-12\gluon\restricted.py", line 224, in restricted
>> exec ccode in environment
>>   File "C:/web2py-9-12/applications/bs3b/models/db.py" 
>> , line 11, in 
>> 
>> db.Field('is_enabled', 'boolean', required=False, default=True),
>>   File "C:\web2py-9-12\gluon\dal\base.py", line 893, in __getattr__
>> return ogetattr(self, key)
>> AttributeError: 'DAL' object has no attribute 'Field'
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-03-16 Thread vince
clean doesn't work for me too on 2.9.5, only 
request.user_agent()['is_mobile'] works.

On Friday, November 29, 2013 11:46:56 AM UTC+8, Tim Richardson wrote:
>
> To fix this, you need to clear sessions.
> The easiest way to do this is via the admin app.
> Find the application causing problems, and from the menu of actions per 
> application, choose "Clean"
>
> This will fix the problem.
> At least, it fixes the "is_mobile" problem that people are experiencing 
> due to the new web2py version. 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: WEB2PY iOS install APP

2013-08-29 Thread vince
i guess thats the best solution for now. the only downside is jailbreak 
required

anyone have experience with pyobjc? it is possible to just execute python 
code as daemon? 

On Monday, August 26, 2013 10:14:33 AM UTC+8, Massimo Di Pierro wrote:
>
> Did you see this: 
> http://www.web2pyslices.com/slice/show/1481/install-web2py-in-the-ipad
> Does it help?
>
>
> On Tuesday, 14 May 2013 17:51:06 UTC-5, Allan K wrote:
>>
>> Hi, 
>>
>> I need to work with an app for web2py, but I do not know if I can use 
>> web2py with iOS and install apps as I can with windows and macOS.
>>
>> Thanks.
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: WEB2PY iOS install APP

2013-08-24 Thread vince
i believe what he means is, create an ios app actually running web2py on 
the device as backend server and with uiwebview accessing it.

i've been looking for it too.

On Friday, May 17, 2013 10:21:13 PM UTC+8, Christian Foster Howes wrote:
>
> i don't understand the question.  what are you trying to do?
>
> web2py can run the server code of a client-server application.  web2py has 
> nothing specific for iOS and has no control over the installation of iOS 
> apps.
>
> On Tuesday, May 14, 2013 3:51:06 PM UTC-7, Allan K wrote:
>>
>> Hi, 
>>
>> I need to work with an app for web2py, but I do not know if I can use 
>> web2py with iOS and install apps as I can with windows and macOS.
>>
>> Thanks.
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Deadlock found when trying to get lock; try restarting transaction

2013-07-20 Thread vince
actually it is possible to disable transaction?  i believe the cluster will 
handle auto-recommit except for transactional commit.
 

On Saturday, July 20, 2013 4:39:01 PM UTC+7, vince wrote:
>
> i think the framework errors are from web2py session update into mysql, 
> we've already use session.forget to minimize the problem but still we need 
> to update session sometimes.
>
> we have already catching all update request and do retry ourself. since 
> mariadb galera cluster is synchronous replication i guess it's no way to 
> avoid deadlock during update.
>
> is there any solution to do custom update retry on web2py session? it 
> would be ideal if dal have an option to auto retry update query.
>
>
>
> On Friday, July 19, 2013 7:58:30 PM UTC+7, Alan Etkin wrote:
>>
>> i do not know which function actually causing this problem. the 
>>> application we testing are mostly select query so most likely it's from the 
>>> web2py session update query.
>>
>>
>> I think this is a workflow issue. Perhaps your db error occurs after 
>> executing the action logic. In that case, this pseudocode might help:
>>
>> At a web2py controller:
>>
>> try some DAL db i/o command
>> force a commit (with db.commit())
>> if there's a driver exception wait for a few seconds and retry
>> if the second try fails, return a message
>> else return the query output
>>
>> BTW: How did you implement my previous pseudocode? What was the error 
>> output?
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Deadlock found when trying to get lock; try restarting transaction

2013-07-20 Thread vince
i think the framework errors are from web2py session update into mysql, 
we've already use session.forget to minimize the problem but still we need 
to update session sometimes.

we have already catching all update request and do retry ourself. since 
mariadb galera cluster is synchronous replication i guess it's no way to 
avoid deadlock during update.

is there any solution to do custom update retry on web2py session? it would 
be ideal if dal have an option to auto retry update query.



On Friday, July 19, 2013 7:58:30 PM UTC+7, Alan Etkin wrote:
>
> i do not know which function actually causing this problem. the 
>> application we testing are mostly select query so most likely it's from the 
>> web2py session update query.
>
>
> I think this is a workflow issue. Perhaps your db error occurs after 
> executing the action logic. In that case, this pseudocode might help:
>
> At a web2py controller:
>
> try some DAL db i/o command
> force a commit (with db.commit())
> if there's a driver exception wait for a few seconds and retry
> if the second try fails, return a message
> else return the query output
>
> BTW: How did you implement my previous pseudocode? What was the error 
> output?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Mobile and Tablets detection

2013-07-18 Thread vince
fyi request.user_agent().is_mobile will return false for ipod touch now.

On Thursday, July 18, 2013 9:43:10 PM UTC+8, Marcio Andrey Oliveira wrote:
>
> Niphlod, I'm fairly new to web2py (I'm reading the official book but I'm 
> still on page #160 of 614 pages) and I'm trying to collect the most 
> possible information that I think relevant for what I'm planning to do.
>
> Even if I had read entirely book I believe that not all information about 
> web2py will be there. That's why I'm asking.
>
> All information I gather will help me decide which framework better fits 
> my needs.
>
> I understood from your last email that I could call request.user_agent()and 
> then I should figure out by myself whether it's a mobile user agent or 
> not what I don't think feasible. The mobile detect library has methods like 
> *is_mobile()*, ? and *is_android()* that make life easier.
>
> Thank you for taking your time to answer my post. I really appreciate that.
>
>
>
> Angelo, I'm glad to hear that.
>
> Could you please show me a snippet on how to test if a browser is mobile?
>
> Thank you a lot.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Deadlock found when trying to get lock; try restarting transaction

2013-07-18 Thread vince
i do not know which function actually causing this problem. the application 
we testing are mostly select query so most likely it's from the web2py 
session update query.

in pymysql/connection.py 

def commit(self):
''' Commit changes to stable storage '''
try:
self._execute_command(COM_QUERY, "COMMIT")
self.read_packet()
except:
exc,value,tb = sys.exc_info()
self.errorhandler(None, exc, value)


it's belong to commit function and we didn't do any db.commit call. a 
ticket without request and session info can i assume it's web2py session 
update?



On Thursday, July 18, 2013 9:40:57 PM UTC+8, Alan Etkin wrote:
>
>
> the sample from you didn't work.
>
>
> Can you post the new error output?
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Deadlock found when trying to get lock; try restarting transaction

2013-07-17 Thread vince
actually yes i just need a way to handle this error myself. see the above 
for the error message i attached, the sample from you didn't work.


On Thursday, July 18, 2013 6:56:27 AM UTC+8, Alan Etkin wrote:
>
> those ticket don't come with request/session info, we have no idea where 
>> and when did this problem occur. does that mean that web2py already handle 
>> the retry?
>>
>  
> AFAIK, web2py does not retry db I/O commands. The tickets are created when 
> the request generates an uncaught exception (in your case, a driver error). 
> One way of preventing this would be writing your own driver error (and 
> retry) handler in your application logic.
>
> I guess something like this
>
> def action():
> from adriver import DriverException
> try:
> rows = ...
> except DriverException:
> raise HTTP(500, "Seems like the cluster is busy now. Try in a few 
> moments")
> return dict(...) 
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Deadlock found when trying to get lock; try restarting transaction

2013-07-17 Thread vince
i am using mariadb galera cluster and we did not implement any locking. 
been testing this cluster for long and it will return locking error during 
node lag.

heres the error i got.
Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.

Traceback (most recent call last):
  File "/home/web2py/gluon/main.py", line 599, in wsgibase
BaseAdapter.close_all_instances('commit')
  File "/home/web2py/gluon/dal.py", line 560, in close_all_instances
db._adapter.close(action)
  File "/home/web2py/gluon/dal.py", line 540, in close
getattr(self, action)()
  File "/home/web2py/gluon/dal.py", line 1740, in commit
if self.connection: return self.connection.commit()
  File "/home/web2py/gluon/contrib/pymysql/connections.py", line 631, in commit
self.errorhandler(None, exc, value)
  File "/home/web2py/gluon/contrib/pymysql/connections.py", line 202, in 
defaulterrorhandler
raise errorclass, errorvalue
InternalError: (1213, u'Deadlock found when trying to get lock; try restarting 
transaction')

In file: Framework


On Wednesday, July 17, 2013 5:27:30 PM UTC+8, Massimo Di Pierro wrote:
>
> We need more information. What is galera cluster? What you trying to lock?
>
> On Tuesday, 16 July 2013 22:29:09 UTC-5, vince wrote:
>>
>> we are testing web2py with galera cluster and notice lots of Deadlock 
>> found when trying to get lock; try restarting transaction ticket.
>>
>> those ticket don't come with request/session info, we have no idea where 
>> and when did this problem occur. does that mean that web2py already handle 
>> the retry?
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Deadlock found when trying to get lock; try restarting transaction

2013-07-16 Thread vince
we are testing web2py with galera cluster and notice lots of Deadlock found 
when trying to get lock; try restarting transaction ticket.

those ticket don't come with request/session info, we have no idea where 
and when did this problem occur. does that mean that web2py already handle 
the retry?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Code changes not honored (by web2py?)

2013-04-08 Thread vince
i am running web2py 2.4.6  on apache with mod_wsgi, track_changes seems to 
always work for the first modify after i restart apache. 2nd changes and so 
on to the module will not always trigger module reload.


On Monday, December 10, 2012 6:55:06 AM UTC+8, Massimo Di Pierro wrote:
>
> This has come up before.
>
> from gluon.custom_import import track_changes; track_changes()
>
> must be a model file, before the modules are imported, not in the modules 
> themselves which are otherwise cached and therefore the line may or may not 
> be executed.
>
> Massimo
>
> On Sunday, 9 December 2012 15:34:09 UTC-6, Chr_M wrote:
>>
>> Sometimes the changes in the code of a module (in the modules directory) 
>> are not working when requesting the url that uses these modules. in the 
>> modules directory I have a subdirectory with python files that form a 
>> package (__init__.py file in this subdirectory). I have added 
>>
>> from gluon.custom_import import track_changes
>> track_changes()
>>
>> in the first model that gets called, but still sometimes code changes are 
>> not working. I noticed that the py-files in the modules dir get compiled to 
>> pyc-files. But at one point (it looks to be randomly) these are not 
>> compiled anymore when I change code in the py-files. But even when I remove 
>> these pyc-files, the code changes are still not working when requesting the 
>> url. 
>>
>> Am I missing something? Is there a cache I can clear or something? I now 
>> have to restart web2py to make the code changes work...
>>
>> Thanks.
>>
>> Regards, Chris
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: database is locked

2013-04-07 Thread vince
from my experience if u running web2py on apache with mod_wsgi u will get 
database locked more often than running web2py alone with it's buildin 
webserver.

u should also avoid using session on sqlite database.


On Saturday, April 6, 2013 11:14:16 PM UTC+8, BlueShadow wrote:
>
> I know that I will eventually have that problem. thats why I got the plan 
> to migrate to postgres when I got more time. the problem with postgres 
> migration is that I used a couple field names which you are not allowed to 
> use in postgres so I can't simply move the db with me thats quite a bit of 
> work. So I try to keep it running with SQLite until I got more time.
>
> On Saturday, April 6, 2013 4:51:03 PM UTC+2, Niphlod wrote:
>>
>>
>>
>> On Saturday, April 6, 2013 3:29:24 PM UTC+2, Vasile Ermicioi wrote:
>>>
>>> Don't really know where you saw the 100k user statement
>>>
>>> http://www.sqlite.org/whentouse.html
>>>
>>  
>> Make a simple app (even with "less bloated" frameworks) that writes to a 
>> db every time a user hits a page. I bet I can lock the db in no time.
>> The problem is not "how many users are hitting the website" but "how many 
>> users are hitting the website and trying to write to the db".
>> As far as read is concerned, I never had a "database locked" problem with 
>> SQLite, WAL active or not.
>>
>>>
>>> editing a single table from multiple users ... no.
>>>
>>> with WAL enabled the response is YES!
>>>
>>>  
>> Nope. It helps for sure, but doesn't prevent locking in an "universal" 
>> way.
>>
>> Test it yourself, open one shell ...
>> sqlite3 storage.db
>> SQLite version 3.7.13 2012-06-11 02:05:22
>> Enter ".help" for instructions
>> Enter SQL statements terminated with a ";"
>> sqlite> create table m(col_a integer);
>> sqlite> insert into m values(1);
>> sqlite> PRAGMA journal_mode=WAL;
>> wal
>> sqlite> insert into m values(1);
>> sqlite> select * from m
>>...> ;
>> 1
>> 1
>> 3
>> ok, now open another shell
>>
>> sqlite3 storage.db 
>> SQLite version 3.7.13 2012-06-11 02:05:22
>> Enter ".help" for instructions
>> Enter SQL statements terminated with a ";"
>> sqlite> insert into m values(3);
>> sqlite> BEGIN TRANSACTION;
>> sqlite> insert into m values(3);
>> sqlite> select * from m;
>> 1
>> 1
>> 3
>> 3
>> sqlite> 
>>
>> now, back to the previous one
>> sqlite> insert into m values(1);
>> Error: database is locked
>>
>>
>> voilà, WAL active, but locked database anyway.
>>
>> tl;dr : You can't have an open transaction that made writes to the db and 
>> contemporarily read the database.
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: weird auth error

2013-04-06 Thread vince
ok i figured out how to reproduce this error.


apache httpd.conf
WSGIDaemonProcess web2py user=web2py group=web2py threads=30 
 maximum-requests=500

Listen 10.8.8.8:80

DocumentRoot /home/web2py/applications/
WSGIProcessGroup web2py
WSGIScriptAlias / /home/web2py/wsgihandler.py



Listen 10.8.8.8:443

DocumentRoot /home/web2py/applications/
WSGIProcessGroup web2py
WSGIScriptAlias / /home/web2py/wsgihandler.py




login via https first then you will get this auth error when u try to login 
via http. vice versa

i don't know if it's a bug or web2py not suppose to share 
WSGIDaemonProcess, anyway i use different WSGIDaemonProcess on https and 
http and problem solve.

On Sunday, April 7, 2013 5:23:39 AM UTC+8, vince wrote:
>
> auth = Auth(db)
> auth.define_tables(username=False, signature=False)
> auth.settings.registration_requires_verification = False
> auth.settings.registration_requires_approval = False
> auth.settings.reset_password_requires_verification = True
>
> that's all i have for auth.
>
> i just run into this error again right now on a test server running centos 
> 6.4, apache with mod_wsgi. most likely restarting apache will fix it.
>
> any comment on how can i trace out the problem?
>
>
> On Saturday, April 6, 2013 9:16:27 PM UTC+8, Massimo Di Pierro wrote:
>>
>> Do you have any custom fields in auth or virtual fields? It is trying to 
>> store in session something that is not pickleable.
>>
>> On Thursday, 28 March 2013 02:08:39 UTC-5, vince wrote:
>>>
>>> i got this error once in a while, usually restart apache will fix it. it 
>>> will only happens when using the auth module for login. any idea? the error 
>>> log is short, any idea on how to trace out the problem?
>>>
>>> i am running web2py 2.4.5-stable+timestamp.2013.03.18.22.46.22
>>>
>>>
>>> Traceback (most recent call last):
>>>   File "/home/web2py/gluon/main.py", line 555, in wsgibase
>>> session._try_store_in_db(request, response)
>>>   File "/home/web2py/gluon/globals.py", line 732, in _try_store_in_db
>>> or self._forget or self._unchanged():
>>>   File "/home/web2py/gluon/globals.py", line 719, in _unchanged
>>> session_pickled = cPickle.dumps(dict(self))
>>>   File "/usr/lib64/python2.6/copy_reg.py", line 84, in _reduce_ex
>>> dict = getstate()
>>> TypeError: 'NoneType' object is not callable
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: weird auth error

2013-04-06 Thread vince
auth = Auth(db)
auth.define_tables(username=False, signature=False)
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True

that's all i have for auth.

i just run into this error again right now on a test server running centos 
6.4, apache with mod_wsgi. most likely restarting apache will fix it.

any comment on how can i trace out the problem?


On Saturday, April 6, 2013 9:16:27 PM UTC+8, Massimo Di Pierro wrote:
>
> Do you have any custom fields in auth or virtual fields? It is trying to 
> store in session something that is not pickleable.
>
> On Thursday, 28 March 2013 02:08:39 UTC-5, vince wrote:
>>
>> i got this error once in a while, usually restart apache will fix it. it 
>> will only happens when using the auth module for login. any idea? the error 
>> log is short, any idea on how to trace out the problem?
>>
>> i am running web2py 2.4.5-stable+timestamp.2013.03.18.22.46.22
>>
>>
>> Traceback (most recent call last):
>>   File "/home/web2py/gluon/main.py", line 555, in wsgibase
>> session._try_store_in_db(request, response)
>>   File "/home/web2py/gluon/globals.py", line 732, in _try_store_in_db
>> or self._forget or self._unchanged():
>>   File "/home/web2py/gluon/globals.py", line 719, in _unchanged
>> session_pickled = cPickle.dumps(dict(self))
>>   File "/usr/lib64/python2.6/copy_reg.py", line 84, in _reduce_ex
>> dict = getstate()
>> TypeError: 'NoneType' object is not callable
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Possible bug? session.auth is None in some requests

2013-04-06 Thread vince
do you think my problem of auth related?

https://groups.google.com/forum/?fromgroups=#!searchin/web2py/auth$20error/web2py/jkqyPM5_zaE/Ve5gy7greuoJ

i am running web2py on multi-threaded mod_wsgi

On Thursday, January 17, 2013 4:53:40 PM UTC+8, Daniel Gonzalez wrote:
>
> Yes Anthony, pretty sure. The little hash that you see in the logs *is* 
> the cookie. Otherwise I can not grep for the relevant log messages (lots of 
> activity going on with 10 parallel requests). This is the code that I have 
> at the very top of my db.py:
>
> try:
> cookie_value = request.cookies[response.session_id_name].value
> except:
> cookie_value = None
>
> from gluon.tools import tools_tracer
> tools_tracer.setid(cookie_value)
>
> (tools_tracer is part of my instrumentation) And that setid call with 
> compute a cookie hash for my logs.
>
> On Thursday, January 17, 2013 5:32:22 AM UTC+1, Anthony wrote:
>>
>> You're sure the client is sending the session cookie each time?
>>
>> On Wednesday, January 16, 2013 10:19:01 PM UTC-5, Daniel Gonzalez wrote:
>>>
>>> Hi,
>>>
>>> I am doing stress testing of my web2py application. The way I am doing 
>>> this is:
>>>
>>>- 10 parallel clients
>>>- the clients log-in automatically, and obtain the session cookie
>>>- the clients log-in only *once* at the start of testing.
>>>- I use the session cookie to tag log messages in order to look for 
>>>mý problem: this way I can relate the log messages to a specific client.
>>>- I am looking for problems in the web2py code, specifically in 
>>>tools.py, Auth.__init__, where the auth.user is defined
>>>
>>> This is my instrumented code (in tools.py, Auth.__init__):
>>>
>>> if auth is None:
>>> tools_tracer.show('session.auth is None')
>>> if auth and auth.last_visit and auth.last_visit + \
>>> datetime.timedelta(days=0, seconds=auth.expiration) >request
>>> .now:
>>> tools_tracer.show('session.auth active, last_visit=%s', auth
>>> .last_visit)
>>> self.user = auth.user
>>> # this is a trick to speed up sessions
>>> if (request.now - auth.last_visit).seconds > (auth.expiration 
>>> / 10):
>>> auth.last_visit = request.now
>>> else:
>>> self.user = None
>>> if session.auth:
>>> del session.auth
>>> tools_tracer.show('session.auth expired')
>>>
>>> And (in tools.py, Auth.login_user):
>>>
>>> current.session.auth = Storage(
>>> user = user,
>>> last_visit=current.request.now,
>>> expiration=self.settings.expiration,
>>> hmac_key=web2py_uuid())
>>> tools_tracer.show('session.auth created')
>>>
>>> This is my current log:
>>>
>>> 2013-01-17 04:00:41,816 - Thread-5  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:00:41,861 - Thread-5  - c2d769 session.auth 
>>> created
>>> 2013-01-17 04:00:41,984 - Thread-6  - c2d769 session.auth 
>>> active, last_visit=2013-01-17 04:00:41.791030
>>> 2013-01-17 04:00:48,923 - Thread-7  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:01:51,131 - Thread-10 - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:01:51,214 - Thread-9  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:02:42,506 - Thread-6  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:04:42,791 - Thread-9  - c2d769 session.auth 
>>> active, last_visit=2013-01-17 04:04:07.717197
>>> 2013-01-17 04:04:42,816 - Thread-4  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:04:48,862 - Thread-10 - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:04:49,251 - Thread-6  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:05:35,713 - Thread-7  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:06:39,764 - Thread-8  - c2d769 session.auth 
>>> active, last_visit=2013-01-17 04:06:10.853567
>>> 2013-01-17 04:06:39,803 - Thread-2  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:07:35,154 - Thread-8  - c2d769 session.auth 
>>> active, last_visit=2013-01-17 04:07:00.261709
>>> 2013-01-17 04:07:40,860 - Thread-9  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:07:46,176 - Thread-8  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:07:46,266 - Thread-5  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:08:27,416 - Thread-9  - c2d769 session.auth 
>>> active, last_visit=2013-01-17 04:08:03.492030
>>> 2013-01-17 04:08:27,436 - Thread-2  - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:09:31,485 - Thread-10 - c2d769 session.auth 
>>> is None
>>> 2013-01-17 04:11:21,903 - Thread-7  - c2d769 session.auth 
>>> is None
>>> 2013-01-1

[web2py] Re: weird auth error

2013-04-05 Thread vince
this error still appear once in a while and restart apache will fix it.

On Tuesday, April 2, 2013 11:49:45 AM UTC+8, vince wrote:
>
> the default version of apache and mod_wsgi on centos 6.4.
>
> it was upgraded by web interface and i just replace the source code 
> manually again and it seems fine now.
>
> On Thursday, March 28, 2013 11:32:38 PM UTC+8, Massimo Di Pierro wrote:
>>
>> What Python version? What platform?
>>
>> On Thursday, 28 March 2013 02:08:39 UTC-5, vince wrote:
>>>
>>> i got this error once in a while, usually restart apache will fix it. it 
>>> will only happens when using the auth module for login. any idea? the error 
>>> log is short, any idea on how to trace out the problem?
>>>
>>> i am running web2py 2.4.5-stable+timestamp.2013.03.18.22.46.22
>>>
>>>
>>> Traceback (most recent call last):
>>>   File "/home/web2py/gluon/main.py", line 555, in wsgibase
>>> session._try_store_in_db(request, response)
>>>   File "/home/web2py/gluon/globals.py", line 732, in _try_store_in_db
>>> or self._forget or self._unchanged():
>>>   File "/home/web2py/gluon/globals.py", line 719, in _unchanged
>>> session_pickled = cPickle.dumps(dict(self))
>>>   File "/usr/lib64/python2.6/copy_reg.py", line 84, in _reduce_ex
>>> dict = getstate()
>>> TypeError: 'NoneType' object is not callable
>>>
>>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: weird auth error

2013-04-01 Thread vince
the default version of apache and mod_wsgi on centos 6.4.

it was upgraded by web interface and i just replace the source code 
manually again and it seems fine now.

On Thursday, March 28, 2013 11:32:38 PM UTC+8, Massimo Di Pierro wrote:
>
> What Python version? What platform?
>
> On Thursday, 28 March 2013 02:08:39 UTC-5, vince wrote:
>>
>> i got this error once in a while, usually restart apache will fix it. it 
>> will only happens when using the auth module for login. any idea? the error 
>> log is short, any idea on how to trace out the problem?
>>
>> i am running web2py 2.4.5-stable+timestamp.2013.03.18.22.46.22
>>
>>
>> Traceback (most recent call last):
>>   File "/home/web2py/gluon/main.py", line 555, in wsgibase
>> session._try_store_in_db(request, response)
>>   File "/home/web2py/gluon/globals.py", line 732, in _try_store_in_db
>> or self._forget or self._unchanged():
>>   File "/home/web2py/gluon/globals.py", line 719, in _unchanged
>> session_pickled = cPickle.dumps(dict(self))
>>   File "/usr/lib64/python2.6/copy_reg.py", line 84, in _reduce_ex
>> dict = getstate()
>> TypeError: 'NoneType' object is not callable
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] weird auth error

2013-03-28 Thread vince
i got this error once in a while, usually restart apache will fix it. it 
will only happens when using the auth module for login. any idea? the error 
log is short, any idea on how to trace out the problem?

i am running web2py 2.4.5-stable+timestamp.2013.03.18.22.46.22


Traceback (most recent call last):
  File "/home/web2py/gluon/main.py", line 555, in wsgibase
session._try_store_in_db(request, response)
  File "/home/web2py/gluon/globals.py", line 732, in _try_store_in_db
or self._forget or self._unchanged():
  File "/home/web2py/gluon/globals.py", line 719, in _unchanged
session_pickled = cPickle.dumps(dict(self))
  File "/usr/lib64/python2.6/copy_reg.py", line 84, in _reduce_ex
dict = getstate()
TypeError: 'NoneType' object is not callable

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: ticket uncoverable while login on 2.2.1 ?

2012-11-02 Thread vince
it only occur on the login page, which i am using the web2py auth module. 
not much info from apache log, any suggestion on how can i trace out this 
problem?

[Fri Nov 02 15:36:32 2012] [info] Seeding PRNG with 144 bytes of entropy
[Fri Nov 02 15:36:32 2012] [info] Initial (No.1) HTTPS request received for 
child 4 (server x:443)
[Fri Nov 02 15:36:32 2012] [info] [client x] Connection closed to child 4 
with standard shutdown (server x:443)



On Friday, November 2, 2012 9:20:31 PM UTC+8, Massimo Di Pierro wrote:
>
> No but a ticket unrecoverable should generate a traceback in the apache 
> log.
>
> On Friday, 2 November 2012 01:26:55 UTC-5, vince wrote:
>>
>> i am getting ticket unrecoverable error while using the auth login on 
>> 2.2.1 once in a while.
>>
>> restarting apache will fix it. any idea what's the problem? how do i 
>> trace it out?
>>
>

-- 





[web2py] ticket uncoverable while login on 2.2.1 ?

2012-11-01 Thread vince
i am getting ticket unrecoverable error while using the auth login on 2.2.1 
once in a while.

restarting apache will fix it. any idea what's the problem? how do i trace 
it out?

-- 





[web2py] Re: lock table possible?

2012-10-16 Thread vince
well, i think i did some test before and update from other connect was 
allowed in between the query and update. i will test it again with a 
time.sleep in between.

On Wednesday, October 17, 2012 3:19:42 AM UTC+8, Niphlod wrote:
>
> Disclaimer: I may be wrong
> Reading your example code, you are updating a single record. 
> If done in a single request, web2py wraps all commands in a transaction. 
> In your code, that means that when you want to remove from photolist an 
> item of your publication row, that operation is atomic. Why are you 
> requesting that no other publication can be updated on that single request ?
>
> On Tuesday, October 16, 2012 9:06:08 PM UTC+2, vince wrote:
>>
>> forget it. it's weird that read lock for mysql is read only, i have to 
>> obtain write lock. it seems not possible to block write access only.
>>
>>  
>>
>> On Wednesday, October 17, 2012 2:55:49 AM UTC+8, vince wrote:
>>>
>>> i tried to lock table but with error
>>>  (1099, u"Table 
>>> 'publication' was locked with a READ lock and can't be updated")
>>>
>>>db.executesql('LOCK TABLE publication READ;')
>>>result = db(db.publication.id==pubid).select()[0]
>>>newlist = result.photo_list
>>>newlist.remove(int(pid))
>>>db(db.publication.id==pubid).update(photo_list=newlist)
>>>db.executesql('UNLOCK TABLES;')
>>>
>>> is it possible to use the same connection?
>>>
>>> On Thursday, October 11, 2012 9:32:14 PM UTC+8, Massimo Di Pierro wrote:
>>>>
>>>> You can try:
>>>>
>>>> db.executesql('LOCK TABLE tablename READ;') 
>>>>
>>>>
>>>> http://aarklondatabasetrivia.blogspot.com/2009/04/how-to-lock-and-unlock-tables-in-mysql.html
>>>>
>>>>
>>>> On Thursday, 11 October 2012 01:44:14 UTC-5, vince wrote:
>>>>>
>>>>> can i lock a table as readonly during the transaction? the case is i 
>>>>> need to insert a record to table B which is base on the query result of 
>>>>> table A, i would like to lock table A as readonly until i finish the 
>>>>> insert.
>>>>>
>>>>> i am using mysql at the moment. i know web2py may not have this 
>>>>> feature, what is the best way to use mysql's 'lock table' on web2py?
>>>>>
>>>>> thanks in advance,
>>>>> vince
>>>>>
>>>>

-- 





[web2py] Re: lock table possible?

2012-10-16 Thread vince
forget it. it's weird that read lock for mysql is read only, i have to 
obtain write lock. it seems not possible to block write access only.

 

On Wednesday, October 17, 2012 2:55:49 AM UTC+8, vince wrote:
>
> i tried to lock table but with error
>  (1099, u"Table 
> 'publication' was locked with a READ lock and can't be updated")
>
>db.executesql('LOCK TABLE publication READ;')
>result = db(db.publication.id==pubid).select()[0]
>newlist = result.photo_list
>newlist.remove(int(pid))
>db(db.publication.id==pubid).update(photo_list=newlist)
>db.executesql('UNLOCK TABLES;')
>
> is it possible to use the same connection?
>
> On Thursday, October 11, 2012 9:32:14 PM UTC+8, Massimo Di Pierro wrote:
>>
>> You can try:
>>
>> db.executesql('LOCK TABLE tablename READ;') 
>>
>>
>> http://aarklondatabasetrivia.blogspot.com/2009/04/how-to-lock-and-unlock-tables-in-mysql.html
>>
>>
>> On Thursday, 11 October 2012 01:44:14 UTC-5, vince wrote:
>>>
>>> can i lock a table as readonly during the transaction? the case is i 
>>> need to insert a record to table B which is base on the query result of 
>>> table A, i would like to lock table A as readonly until i finish the insert.
>>>
>>> i am using mysql at the moment. i know web2py may not have this feature, 
>>> what is the best way to use mysql's 'lock table' on web2py?
>>>
>>> thanks in advance,
>>> vince
>>>
>>

-- 





[web2py] Re: lock table possible?

2012-10-16 Thread vince
i tried to lock table but with error
 (1099, u"Table 
'publication' was locked with a READ lock and can't be updated")

   db.executesql('LOCK TABLE publication READ;')
   result = db(db.publication.id==pubid).select()[0]
   newlist = result.photo_list
   newlist.remove(int(pid))
   db(db.publication.id==pubid).update(photo_list=newlist)
   db.executesql('UNLOCK TABLES;')

is it possible to use the same connection?

On Thursday, October 11, 2012 9:32:14 PM UTC+8, Massimo Di Pierro wrote:
>
> You can try:
>
> db.executesql('LOCK TABLE tablename READ;') 
>
>
> http://aarklondatabasetrivia.blogspot.com/2009/04/how-to-lock-and-unlock-tables-in-mysql.html
>
>
> On Thursday, 11 October 2012 01:44:14 UTC-5, vince wrote:
>>
>> can i lock a table as readonly during the transaction? the case is i need 
>> to insert a record to table B which is base on the query result of table A, 
>> i would like to lock table A as readonly until i finish the insert.
>>
>> i am using mysql at the moment. i know web2py may not have this feature, 
>> what is the best way to use mysql's 'lock table' on web2py?
>>
>> thanks in advance,
>> vince
>>
>

-- 





[web2py] Re: auth module not portable between mac and linux?

2012-10-12 Thread vince
oh my mistake, link web2py.app/Contents/MacOS/python to osx's default 
python works fine.

On Saturday, October 13, 2012 10:29:20 AM UTC+8, vince wrote:
>
> i am using osx 10.8 so the default python should be 2.7. however i notice 
> the mac package of web2py 2.0.9 bundle with the python 2.5.1 binary.
>
> i just tried to link the python binary inside web2py.app/Contents/MacOS to 
> the 2.7 version from osx but it fail to start.
>
> On Saturday, October 13, 2012 10:10:33 AM UTC+8, Massimo Di Pierro wrote:
>>
>> I experience the same when I use python25 on my mac and python27 on my 
>> linux vm. I believe it is because of this bug in python25
>>
>> http://bugs.python.org/issue1385
>>
>> Could this be the same case as yours?
>>
>> On Friday, 12 October 2012 20:51:49 UTC-5, vince wrote:
>>>
>>> i tried web2py on linux with source code version and on osx with the mac 
>>> version, both connected to the same mysql backend.
>>>
>>> i have notice the user created on linux can only access on linux, login 
>>> from osx will be invalid login. it's the same on osx the other way around.
>>>
>>>
>>>

-- 





[web2py] Re: auth module not portable between mac and linux?

2012-10-12 Thread vince
i am using osx 10.8 so the default python should be 2.7. however i notice 
the mac package of web2py 2.0.9 bundle with the python 2.5.1 binary.

i just tried to link the python binary inside web2py.app/Contents/MacOS to 
the 2.7 version from osx but it fail to start.

On Saturday, October 13, 2012 10:10:33 AM UTC+8, Massimo Di Pierro wrote:
>
> I experience the same when I use python25 on my mac and python27 on my 
> linux vm. I believe it is because of this bug in python25
>
> http://bugs.python.org/issue1385
>
> Could this be the same case as yours?
>
> On Friday, 12 October 2012 20:51:49 UTC-5, vince wrote:
>>
>> i tried web2py on linux with source code version and on osx with the mac 
>> version, both connected to the same mysql backend.
>>
>> i have notice the user created on linux can only access on linux, login 
>> from osx will be invalid login. it's the same on osx the other way around.
>>
>>
>>

-- 





[web2py] auth module not portable between mac and linux?

2012-10-12 Thread vince
i tried web2py on linux with source code version and on osx with the mac 
version, both connected to the same mysql backend.

i have notice the user created on linux can only access on linux, login 
from osx will be invalid login. it's the same on osx the other way around.


-- 





[web2py] Re: lock table possible?

2012-10-12 Thread vince
oh db.executesql, thx.

will we have any table locking implement on web2py? say an option to lock 
all queried table read only until commit? 

On Thursday, October 11, 2012 9:32:14 PM UTC+8, Massimo Di Pierro wrote:
>
> You can try:
>
> db.executesql('LOCK TABLE tablename READ;') 
>
>
> http://aarklondatabasetrivia.blogspot.com/2009/04/how-to-lock-and-unlock-tables-in-mysql.html
>
>
> On Thursday, 11 October 2012 01:44:14 UTC-5, vince wrote:
>>
>> can i lock a table as readonly during the transaction? the case is i need 
>> to insert a record to table B which is base on the query result of table A, 
>> i would like to lock table A as readonly until i finish the insert.
>>
>> i am using mysql at the moment. i know web2py may not have this feature, 
>> what is the best way to use mysql's 'lock table' on web2py?
>>
>> thanks in advance,
>> vince
>>
>

-- 





[web2py] lock table possible?

2012-10-10 Thread vince
can i lock a table as readonly during the transaction? the case is i need 
to insert a record to table B which is base on the query result of table A, 
i would like to lock table A as readonly until i finish the insert.

i am using mysql at the moment. i know web2py may not have this feature, 
what is the best way to use mysql's 'lock table' on web2py?

thanks in advance,
vince

-- 





[web2py] couchdb access on 2.0.9

2012-10-04 Thread vince
i modify the "welcome" application to test out couchdb support.

in models/db.py
db = DAL('couchdb://admin:admin@127.0.0.1:5984')


register the first user works fine, register another user will result in 
the following error but the new user record is actually stored in couchdb.

Traceback (most recent call last):
  File "/home/web2py/gluon/restricted.py", line 209, in restricted
exec ccode in environment
  File "/home/web2py/applications/test/controllers/default.py" 
<https://10.8.8.18/admin/default/edit/test/controllers/default.py>, line 75, in 

  File "/home/web2py/gluon/globals.py", line 186, in 
self._caller = lambda f: f()
  File "/home/web2py/applications/test/controllers/default.py" 
<https://10.8.8.18/admin/default/edit/test/controllers/default.py>, line 37, in 
user
return dict(form=auth())
  File "/home/web2py/gluon/tools.py", line 1194, in __call__
return getattr(self,args[0])()
  File "/home/web2py/gluon/tools.py", line 2151, in register
self.add_membership(group_id, form.vars.id)
  File "/home/web2py/gluon/tools.py", line 2934, in add_membership
record = membership(user_id = user_id,group_id = group_id)
  File "/home/web2py/gluon/dal.py", line 7646, in __call__
return self._db(query).select(limitby=(0,1),for_update=for_update).first()
  File "/home/web2py/gluon/dal.py", line 8766, in select
return adapter.select(self.query,fields,attributes)
  File "/home/web2py/gluon/dal.py", line 4713, in select
rows = [cols['value'] for cols in ctable.query(fn)]
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/client.py", 
line 984, in __iter__
return iter(self.rows)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/client.py", 
line 1003, in rows
self._fetch()
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/client.py", 
line 990, in _fetch
data = self.view._exec(self.options)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/client.py", 
line 914, in _exec
}, **self._encode_options(options))
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 
399, in post_json
status, headers, data = self.post(*a, **k)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 
381, in post
**params)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 
419, in _request
credentials=self.credentials)
  File 
"/usr/lib/python2.6/site-packages/CouchDB-0.8-py2.6.egg/couchdb/http.py", line 
310, in request
raise ServerError((status, error))
ServerError: (500, ('compilation_error', 'Expression does not eval to a 
function. ((new 
String("(function(auth_membership){if(((auth_membership.group_id == 
241941851531426793913477551088460735945L) && (auth_membership.user_id == 
248642394256806072494078744897341947048L)))emit(auth_membership._id,[auth_membership._id,auth_membership.user_id,auth_membership.group_id]);})")))'))


also, it will always return invalid login when login. when i check out the db, 
password field stored as 

'pbkdf2(1000,20,sha512)$a6cac362671ec7bb$c8795363970bd2014f525150f476aa506ae51bb4'


any idea?

-vince

-- 





Re: [web2py] Re: Instant press 2.1.0 holiday edition (?)

2012-06-06 Thread vince
after the peek into custom_import, it was my mistake of missing __init__.py 
in /applications. actually i just notice we can use standard import instead 
of local_import now.

On Wednesday, June 6, 2012 2:49:29 AM UTC+8, vince wrote:
>
> i am using 1.99.7 with the similar errors, appsettings.py does exist in 
> modules so is it web2py or instantpress's problem?
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
>
> Traceback (most recent call last):
>   File "/home/web2py/gluon/restricted.py", line 205, in restricted
> exec ccode in environment
>   File "/home/web2py/applications/instantpress/models/00main.py" 
> <https://10.8.8.18/admin/default/edit/instantpress/models/00main.py>, line 
> 18, in 
> from appsettings import app_settings
>   File "/home/web2py/gluon/custom_import.py", line 293, in __call__
> fromlist, level)
>   File "/home/web2py/gluon/custom_import.py", line 78, in __call__
> level)
> ImportError: No module named appsettings
>
>
>
>
>
>

Re: [web2py] Re: Instant press 2.1.0 holiday edition (?)

2012-06-05 Thread vince
i am using 1.99.7 with the similar errors, appsettings.py does exist in 
modules so is it web2py or instantpress's problem?

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

Traceback (most recent call last):
  File "/home/web2py/gluon/restricted.py", line 205, in restricted
exec ccode in environment
  File "/home/web2py/applications/instantpress/models/00main.py" 
, line 18, 
in 
from appsettings import app_settings
  File "/home/web2py/gluon/custom_import.py", line 293, in __call__
fromlist, level)
  File "/home/web2py/gluon/custom_import.py", line 78, in __call__
level)
ImportError: No module named appsettings





On Tuesday, December 27, 2011 10:50:54 AM UTC+8, Martin.Mulone wrote:
>
> Requirement:   you need at least version 1.99.4 
>
> Actualizá alan ese web2py es muy viejo.
>
> 2011/12/26 Alan Etkin 
>
>> Here is the last error created (after the service was recovered and
>> tried to access instant press app, i am not the server admin and have
>> no access to the system except by the web2py admin interface)
>>
>> web2py™ Version 1.94.6 (2011-03-27 18:20:38)
>> Python  Python 2.5.2: /usr/bin/python
>> Traceback
>>
>> Traceback (most recent call last):
>>  File "/home/web2py/gluon/restricted.py", line 188, in restricted
>>exec ccode in environment
>>  File "/home/web2py/applications/ipress/models/00main.py", line 18,
>> in 
>>from appsettings import app_settings
>> ImportError: No module named appsettings
>>
>> Regards
>>
>> On 26 dic, 22:43, Martín Mulone  wrote:
>> > Any hint or traceback?.
>> >
>> > 2011/12/26 Alan Etkin 
>> >
>> >
>> >
>> > > Good work Martin. Thanks
>> >
>> > > I tried to load the installer with appadmin on a production server and
>> > > the server stopped working :/
>> > > Anyway, i don't think it is related to instant press issues.
>> >
>> > > By the way, i think the admin access is hard to find in the default
>> > > view for logged-in users. Maybe it could be emphazised (of course,
>> > > that is a really small detail)
>> >
>> > > On 26 dic, 16:49, Ovidio Marinho  wrote:
>> > > > Revolviendo la discursion del post new Post:
>> >
>> > > > no momiento en que se fixa la noticia en Body la primieira viez e en
>> > > > Extarct en primera viez, se tienes en la view principal home la 
>> noticia
>> > > em
>> > > > body e um boton (leia mas) que se lhama a url extract. En segunda 
>> viez
>> > > que
>> > > > actualizo el browse el boton leia mas nao mas se apresenta. Isto es 
>> a si
>> > > > miesmo ou ha algo errado.?
>> >
>> > > > By the time we type the news we have two choices and body extract, I
>> > > > realized thatwhen we put the first time the news on the main page 
>> shows
>> > > a read
>> > > > more button.But if this update the Browse button does not appear 
>> again,
>> > > this
>> > > >  is normal or is something wrong?
>> >
>> > > >Ovidio Marinho Falcao Neto
>> > > > Web Developer
>> > > >  ovidio...@gmail.com
>> > > >   ovidiomari...@itjp.net.br
>> > > >  ITJP - itjp.net.br
>> > > >83   8826 9088 - Oi
>> > > >83   9334 0266 - Claro
>> > > > Brasil
>> >
>> > > > Apóio
>> >
>> > > > 2011/12/26 Martín Mulone 
>> >
>> > > > > ckeditor, tinyMCE, etc all WYSIWYG web editor are xhtml output. 
>> None of
>> > > > > the them support markup languages.
>> >
>> > > > > 2011/12/26 Ovidio Marinho 
>> >
>> > > > >>   Would not it be better to use the CKEditor as to insert 
>> photos
>> > > into
>> > > > >>  a new pageneeds to address in localhost?
>> >
>> > > > >>Ovidio Marinho Falcao Neto
>> > > > >> Web Developer
>> > > > >>  ovidio...@gmail.com
>> > > > >>   ovidiomari...@itjp.net.br
>> > > > >>  ITJP - itjp.net.br
>> > > > >>83   8826 9088 - Oi
>> > > > >>83   9334 0266 - Claro
>> > > > >> Brasil
>> >
>> > > > >> Apóio
>> >
>> > > > >> 2011/12/26 Martín Mulone 
>> >
>> > > > >>> The "Admin" password is only showed the first time, when the 
>> user is
>> > > > >>> created (because is random generated). Delete all the content 
>> inside
>> > > > >>> "databases" folder. And point again to localhost:8000/app/.
>> >
>> > > > >>> You have to see something like this (attached)
>> >
>> > > > >>> 2011/12/26 Ovidio Marinho 
>> >
>> > > >  Once we enter the administrator password is not shown in the 
>> Main
>> > > Menu
>> >
>> > > > Ovidio Marinho Falcao Neto
>> > > >  Web Developer
>> > > >   ovidio...@gmail.com
>> > > >    ovidiomari...@itjp.net.br
>> > > >   ITJP - itjp.net.br
>> > > > 83   8826 9088 - Oi
>> > > > 83   9334 0266 - Claro
>> > > >  Brasil
>> >
>> > > > 

[web2py] Re: possible bug after upgrade from 1.89.5 to 1.91.4

2010-12-25 Thread vince
oh nice, thanks for the info.

On Dec 26, 8:46 am, Bruno Rocha  wrote:
> Guess it is fixed in trunk
>
> http://code.google.com/p/web2py/source/detail?r=ec4532b031eeb19d34fc5...
>
> 2010/12/25 vince 
>
> > upgrade from 1.89.5 to 1.91.4, dal seems to ignore the folder
> > parameter
> > db=DAL('sqlite://storage.db',folder="/home/databases/")
>
> > will create new database files on current directory. reverse back to
> > 1.89.5 and problem fixed.
>
> --
>
> Bruno Rochahttp://about.me/rochacbruno/bio


[web2py] possible bug after upgrade from 1.89.5 to 1.91.4

2010-12-25 Thread vince
upgrade from 1.89.5 to 1.91.4, dal seems to ignore the folder
parameter
db=DAL('sqlite://storage.db',folder="/home/databases/")

will create new database files on current directory. reverse back to
1.89.5 and problem fixed.




[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] 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] 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] 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] 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] 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: 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] 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] 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] 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] 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: 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] 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
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] 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: 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] 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] 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: 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] 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
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] 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: 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] 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] 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: 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
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: 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
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 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 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
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] 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: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: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: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: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: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: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: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: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: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: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:18443] security concern regarding delete record

2009-03-22 Thread vince

if i have this

if have_delete_access:
  form=SQLFORM(db.mytable,thisrecord,deletable=True)
else:
  form=SQLFORM(db.mytable,thisrecord,deletable=False)
 form accept and etc

is that secure? what if user make up their own form post?


-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:18409] Re: ReportLab in application modules?

2009-03-20 Thread vince

yes just pack the reportlab directory into library.zip and import like
this

from reportlab.lib.pagesizes import letter, A4

-vince

On Mar 19, 6:59 pm, carlo  wrote:
> Yes that is the folder I put in myapp modules (just the "reportlab"
> folder): did you try something like
>
> from applications.myapp.modules.reportlab import platypus
> or
> from applications.myapp.modules.reportlab.platypus import *
>
> I got an error about some non existing submodule (platypus.flowables
> for example)
>
> My web2py version is the source version.
>
> carlo
>
> On 18 Mar, 20:59, mdipierro  wrote:
>
> > When you unzip reportlab there is a lot of junk in there. There is
> > another subfolder called reportlab where the .py files are. That is
> > the one you need. If you are using the binary distribution you have to
> > put it in the zip file Libraries.zip (windows) or site-packages.zip
> > (mac)
>
> > On Mar 18, 1:23 pm, carlo  wrote:
>
> > > Are you sure about that?
> > > I put the reportlab folder in myapp.modules but when I try to import a
> > > submodule I get an error.
>
> > > carlo
>
> > > On 18 Mar, 19:05, mdipierro  wrote:
>
> > > > If you just unzip reportlab under web2py/ and rezip web2py it works.
>
> > > > reportlab does not need to be installed and only needs the binaries
> > > > for image manipulation.
>
> > > > Massimo
>
> > > > On Mar 18, 1:02 pm, carlo  wrote:
>
> > > > > thank you Tim.
>
> > > > > Would you suggest any other package to get pdf printing more easily
> > > > > integrated with a web2py app (Pisa??) ? I would like to ship my app
> > > > > with every necessary module without counting on Python system..
>
> > > > > carlo
>
> > > > > On 18 Mar, 18:42, Timothy Farrell  wrote:
>
> > > > > > Do you need to bundle reportlab with an app?
>
> > > > > > Reportlab requires some binary libaries that are not conducive 
> > > > > > Python's
> > > > > > true cross-platformness.  I would say the better way is to just say,
> > > > > > "This app requires Reportlabs 2.x"
>
> > > > > > -tim
>
> > > > > > carlo wrote:
> > > > > > > Anyone succedeed to get ReportLab modules installed under
> > > > > > > applications.myapp.modules (Windows)?
>
> > > > > > > carlo
>
> > > > > > --
> > > > > > Timothy Farrell 
> > > > > > Computer 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:17616] Re: web2py 1.57

2009-03-06 Thread vince

yes i traced back to some incorrect datatime field. funny things is it
works under 1.56.4.
i actually only import from the cvs via appadmin.

thanks

On Mar 6, 9:35 pm, mdipierro  wrote:
> You have corrupted data in database. My guess you are usingsqliteand
> you converted a non 'datetime' field in a 'datetime' field but the
> column contained previous data. 'sqlite' is stupid and does the
> migration without checking for the actual data type.
> You need to reset the values in that column with db(...).update(...)
>
> Massimo
>
> On Mar 6, 2:28 am, vince  wrote:
>
> > i got this error on1.57but not 1.56.4
>
> > it's just a simple select to cresult before the for row in cresult
>
> > Traceback (most recent call last):
> >   File "/private/var/www/web2py/gluon/restricted.py", line 98, in
> > restricted
> >     exec ccode in environment
> >   File "/private/var/www/web2py/applications/cychurch/controllers/
> > donations.py", line 934, in 
> >   File "/private/var/www/web2py/gluon/globals.py", line 75, in
> > 
> >     self._caller = lambda f: f()
> >   File "/private/var/www/web2py/applications/cychurch/controllers/
> > donations.py", line 219, in coderesult
> >     for row in cresult:
> >   File "/private/var/www/web2py/gluon/sql.py", line 2115, in __iter__
> >     yield self[i]
> >   File "/private/var/www/web2py/gluon/sql.py", line 2086, in
> > __getitem__
> >     str(value)[:10].strip().split('-')]
> > ValueError: invalid literal for int() with base 10: ''
--~--~-~--~~~---~--~~
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:17613] Re: web2py 1.57

2009-03-06 Thread vince

yes it's on sqlite but the data are from  the csv import from
appadmin. funny thing is it works under 1.56.4.
it seens ti only happens when the db with over certain amount of row
like over 1000
let me try again and see if i can sort it out

vince

On Mar 6, 9:35 pm, mdipierro  wrote:
> You have corrupted data in database. My guess you are using sqlite and
> you converted a non 'datetime' field in a 'datetime' field but the
> column contained previous data. 'sqlite' is stupid and does the
> migration without checking for the actual data type.
> You need to reset the values in that column with db(...).update(...)
>
> Massimo
>
> On Mar 6, 2:28 am, vince  wrote:
>
> > i got this error on 1.57 but not 1.56.4
>
> > it's just a simple select to cresult before the for row in cresult
>
> > Traceback (most recent call last):
> >   File "/private/var/www/web2py/gluon/restricted.py", line 98, in
> > restricted
> >     exec ccode in environment
> >   File "/private/var/www/web2py/applications/cychurch/controllers/
> > donations.py", line 934, in 
> >   File "/private/var/www/web2py/gluon/globals.py", line 75, in
> > 
> >     self._caller = lambda f: f()
> >   File "/private/var/www/web2py/applications/cychurch/controllers/
> > donations.py", line 219, in coderesult
> >     for row in cresult:
> >   File "/private/var/www/web2py/gluon/sql.py", line 2115, in __iter__
> >     yield self[i]
> >   File "/private/var/www/web2py/gluon/sql.py", line 2086, in
> > __getitem__
> >     str(value)[:10].strip().split('-')]
> > ValueError: invalid literal for int() with base 10: ''
--~--~-~--~~~---~--~~
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:17591] Re: form pre-population fails if field is shown in 1.56.2

2009-03-06 Thread vince

thanks that works great!

it would be nice to have the form.element documented!


On Mar 5, 3:15 am, mdipierro  wrote:
> after accept try
>
> form.element(_name='password')['_value']=''
>
> On Mar 4, 10:46 am,vince wrote:
>
> > oh it was typo.
>
> > db.define_table('person',
> >             db.Field('name'),
> >             db.Field('password','password'),
> >             .
> > )
> > db.person.password.requires = [IS_NOT_EMPTY(), CRYPT()]
> > thisrecord=db(db.person.id==1).select()[0]
> > form=SQLFORM(db.person, thisrecord)
> > if not form.accepts(request.vars,session):
> >    form.vars.password=""
> >    db.person.password.update=""
>
> > i actually want the form password  to be empty. so the user
> > have to input the password again every time the table updated. it's
> > because of the CRYPT(), password select from thisrecord is always a
> > wrong one.
>
> > but this one doesn't work. is there any way to do it?
>
> > -vince
>
> > On Mar 3, 10:26 pm, mdipierro  wrote:
>
> > > should be
>
> > > thisrecord=db(db.person.id==1).select()[0]
> > > form=SQLFORM(db.person, thisrecord) # <<<<
> > > form.vars.name="test"
> > > db.person.name.update="test"
> > > form.accepts(request.vars,session) # <<<<
>
> > > On Mar 3, 4:28 am,vince wrote:
>
> > > > i want to do an update with a specific default input value like this
>
> > > > thisrecord=db(db.person.id==1).select()[0]
> > > > form=SQLFORM(thisrecord)
> > > > form.vars.name="test"
> > > > db.person.name.update="test"
>
> > > > both form.vars or field.update doesn't work as you've mention they are
> > > > visualized field
> > > > is there any way to do this?
>
> > > > -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:17590] Re: web2py 1.57

2009-03-06 Thread vince

i got this error on 1.57 but not 1.56.4

it's just a simple select to cresult before the for row in cresult

Traceback (most recent call last):
  File "/private/var/www/web2py/gluon/restricted.py", line 98, in
restricted
exec ccode in environment
  File "/private/var/www/web2py/applications/cychurch/controllers/
donations.py", line 934, in 
  File "/private/var/www/web2py/gluon/globals.py", line 75, in

self._caller = lambda f: f()
  File "/private/var/www/web2py/applications/cychurch/controllers/
donations.py", line 219, in coderesult
for row in cresult:
  File "/private/var/www/web2py/gluon/sql.py", line 2115, in __iter__
yield self[i]
  File "/private/var/www/web2py/gluon/sql.py", line 2086, in
__getitem__
str(value)[:10].strip().split('-')]
ValueError: invalid literal for int() with base 10: ''
--~--~-~--~~~---~--~~
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:17491] Re: form pre-population fails if field is shown in 1.56.2

2009-03-04 Thread vince

oh it was typo.

db.define_table('person',
db.Field('name'),
db.Field('password','password'),
.
)
db.person.password.requires = [IS_NOT_EMPTY(), CRYPT()]
thisrecord=db(db.person.id==1).select()[0]
form=SQLFORM(db.person, thisrecord)
if not form.accepts(request.vars,session):
   form.vars.password=""
   db.person.password.update=""

i actually want the form password  to be empty. so the user
have to input the password again every time the table updated. it's
because of the CRYPT(), password select from thisrecord is always a
wrong one.

but this one doesn't work. is there any way to do it?

-vince

On Mar 3, 10:26 pm, mdipierro  wrote:
> should be
>
> thisrecord=db(db.person.id==1).select()[0]
> form=SQLFORM(db.person, thisrecord) # <<<<
> form.vars.name="test"
> db.person.name.update="test"
> form.accepts(request.vars,session) # <<<<
>
> On Mar 3, 4:28 am, vince  wrote:
>
> > i want to do an update with a specific default input value like this
>
> > thisrecord=db(db.person.id==1).select()[0]
> > form=SQLFORM(thisrecord)
> > form.vars.name="test"
> > db.person.name.update="test"
>
> > both form.vars or field.update doesn't work as you've mention they are
> > visualized field
> > is there any way to do this?
>
> > -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:17490] Re: form pre-population fails if field is shown in 1.56.2

2009-03-04 Thread vince

oh it was typo.

db.define_table('person',
db.Field('name'),
db.Field('password','password'),
.
)
db.person.password.requires = [IS_NOT_EMPTY(), CRYPT()]
thisrecord=db(db.person.id==1).select()[0]
form=SQLFORM(db.person, thisrecord)
if not form.accepts(request.vars,session):
   form.vars.password=""
   db.person.password.update=""

i actually want the form password  to be empty. so the user
have to input the password again every time the table updated. it's
because of the CRYPT(), password select from thisrecord is always a
wrong one.

-vince

On Mar 3, 10:26 pm, mdipierro  wrote:
> should be
>
> thisrecord=db(db.person.id==1).select()[0]
> form=SQLFORM(db.person, thisrecord) # <<<<
> form.vars.name="test"
> db.person.name.update="test"
> form.accepts(request.vars,session) # <<<<
>
> On Mar 3, 4:28 am, vince  wrote:
>
> > i want to do an update with a specific default input value like this
>
> > thisrecord=db(db.person.id==1).select()[0]
> > form=SQLFORM(thisrecord)
> > form.vars.name="test"
> > db.person.name.update="test"
>
> > both form.vars or field.update doesn't work as you've mention they are
> > visualized field
> > is there any way to do this?
>
> > -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:17489] Re: form pre-population fails if field is shown in 1.56.2

2009-03-04 Thread vince

oh it was typo.

db.define_table('person',
db.Field('name'),
db.Field('password','password'),
.
)
db.person.password.requires = [IS_NOT_EMPTY(), CRYPT()]
thisrecord=db(db.person.id==1).select()[0]
form=SQLFORM(db.person, thisrecord)
if not form.accepts(request.vars,session):
   form.vars.password=""
   db.person.password.update=""

i actually want the form password  to be empty. so the user
update the table will have to input the password again every time it
update the table. it's because of the CRYPT(), password select from
thisrecord is always a wrong one.


rgds,
 Vincent


On Mar 3, 10:26 pm, mdipierro  wrote:
> should be
>
> thisrecord=db(db.person.id==1).select()[0]
> form=SQLFORM(db.person, thisrecord) # <<<<
> form.vars.name="test"
> db.person.name.update="test"
> form.accepts(request.vars,session) # <<<<
>
> On Mar 3, 4:28 am, vince  wrote:
>
> > i want to do an update with a specific default input value like this
>
> > thisrecord=db(db.person.id==1).select()[0]
> > form=SQLFORM(thisrecord)
> > form.vars.name="test"
> > db.person.name.update="test"
>
> > both form.vars or field.update doesn't work as you've mention they are
> > visualized field
> > is there any way to do this?
>
> > -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:17378] Re: form pre-population fails if field is shown in 1.56.2

2009-03-03 Thread vince

i want to do an update with a specific default input value like this

thisrecord=db(db.person.id==1).select()[0]
form=SQLFORM(thisrecord)
form.vars.name="test"
db.person.name.update="test"

both form.vars or field.update doesn't work as you've mention they are
visualized field
is there any way to do this?

-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:15215] request.args proposal

2009-01-21 Thread vince

request.vars.any will return none if it's not exist.
it is possible to add something like request.args.0 or
request.args.id0 in addition to request.args[0].

-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:15205] Re: Web2py performance problems

2009-01-21 Thread vince

actually cherrypy can be faster than apache/mod_wsgi sometimes. but i
often use mod_wsgi do recommend mod_wsgi as  it's quite stable and
flexible.
i am just wondering  how u crash cherrypy even if it's overloaded.


-vince





On Jan 21, 3:59 pm, voltron  wrote:
> Thanks Massimo, I will try that out
>
> On Jan 20, 8:05 pm, mdipierro  wrote:
>
> > Voltron,
>
> > if you have more than 100 cuncurrent users you should not use
> > wsgiserver. You need to use mod_wsgi. I would not swear on wsgiserver
> > on that heavy load.
>
> > You also have 100 database connections. Make sure you are suing
> > pooling.
>
> > Also make sure your app is bytecode compiled.
>
> > My bet is that the database is a bottle neck.
>
> > You can add if statements in your model depending on request.function
> > so that for example, you do not define tables when you do not need
> > them.
>
> > Massimo
>
> > On Jan 19, 11:40 pm, voltron  wrote:
>
> > > Thanks Massimo.
>
> > > All I have in my Apache config are the directives for reverse
> > > proxying, to my greatest dismay, it just does not scale well. I
> > > noticed that anything above 100 concurrent users would just shut the
> > > CherryPY server down. I have to routes activated. Another strange
> > > thing are the performance dips, the response could be fast, but
> > > sometimes they just grind to a halt for no reason, this is not
> > > dependent of database queries oor other processes, just dynamically
> > > rendered "static" pages.
>
> > > This is a headache
>
> > > On Jan 19, 11:46 am, mdipierro  wrote:
>
> > > > Voltron,
>
> > > > sorry but I do not have enough information. First of all. Is this with
> > > > a specific application or can you reproduce the behavior with the
> > > > welcome app as well?
>
> > > > Can you show us you apache configuration as well as your routes.py?
>
> > > > Massimo
>
> > > > On Jan 19, 4:29 am, voltron  wrote:
>
> > > > > I have been having serious performance problems. Some tracking down
> > > > > led to the observation that when using Apache as a reverse proxy,
> > > > > web2py runs up the CPU usage and shuts down after 100 requests. The
> > > > > strangest thing is that when this happens, the CPU is only at 60%
> > > > > usage.
>
> > > > > Is there some setting that I can tune to avod this?
>
> > > > > This is a root server with 2GB memory and an 2GHZ Athlon CPU
>
> > > > > 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:15204] Re: future of T2 is *almost* here

2009-01-21 Thread vince

would it be better if plugin can share between application so we can
only need to maintain one copy? also if the admin page can simplify
the plugin installation that would be great.

-vince

 On Jan 22, 2:05 am, mdipierro  wrote:
> > * I think that the very fact that you can take parts of T2 and
> > incorporate them in the core proves that a plugin is not necessarily
> > an app (in the recognised sense of the word). If Auth is replaceable
> > by a plugin, it is (or may as well be) a plugin itself.  The key
> > element is how that plugin is integrated.  In the case of Auth, I
> > seems it must be via Crud (I could be wrong) but Crud enforces a URL
> > format which surely can't be mandatory to handle authorisation.
>
> Stuff is moved into core only if can be done in a module without
> services, static files and without mandating conventions on how to
> expose them. Nevertheless Auth and Crud do provide a "simple" and
> "naive" way to expose themselves until the developer figures out how
> that can be customized (I will document it eventually).
>
>
>
> > * you say a plugin is an app and "does not deserve a special folder
> > but plugin apps need to identify themselves. I think a PLUGIN file in
> > the app folder should do the task."  But in the previous sentence you
> > say a plugin " can have modules, models, controllers, views, static
> > files, services."  That is contradictory isn't it.
>
> No. the plugin is an app (which already contains modules, static,
> etc.)
> the PLUGIN file is needed to describe via some metadata or text how
> this app exposes services that other apps can use. Thus making it a
> spacial app, the plugin that is.
>
> > * Neither of the above apply to Auth which doesn't have a lot of other
> > files but isnt in an "app folder" either.
>
> The way I am implmenting it does not need to be an app. But class
> CasAuth(Auth):pass needs to be an app because exposes CAS provider
> services.
>
> > * when you say "in the app folder" do you mean "applications" folder
> > or the same folder as the app?   (I'm assuming the latter) So every
> > app that requires Auth must have it's own copy of the plugin? I'm not
> > sure whether that is good/bad.
>
> Every application that requires Auth will just need web2py and do from
> gluon.utils import Auth!
> If an app needs a plugin that extends Auth by providing for example
> CAS would need the plugin (as they need CAS now).
>
> It has. It just has not been explained properly perhaps. It is also
> true that different people expect different things from a "plugin".
> For me a "plugin" is defined as an "app" that provides modules,
> services, views and static files, that can be used by other apps. This
> means I do not want specifications to be too strict. If you are
> expecting more from it perhaps you should explain what you would like.
>
> Massimo
>
> > I'm sorry, it just seems the thing hasn't been thought thru.
>
> > On Jan 21, 4:09 pm, mdipierro  wrote:> Hi Bill,
>
> > > I will try to answer some of the questions you raised in the thread.
>
> > > We had an IRC meeting last week and we agreed that T2 was becoming
> > > common and people started to rely on it. At the same time maintaining
> > > web2py+T2+T3 as separate entities was becoming a nightmare. We agreed
> > > that it was possible to incorporate some parts of T2 (those that we
> > > consider good practice and those that only require python modules)
> > > into web2py.
> > > This includes:
> > > - Authentication
> > > - Role Based Authorization
> > > - Smarter Crud than SQLFORM provides (integration with authentication,
> > > more restful paths)
>
> > > The current T2 would become an example on how to extend this core, in
> > > the same fashion as you suggest.
>
> > > T3 will stay an anonymous app that based only on web2py and perhaps,
> > > once polished, it could be distributed with web2py in the future.
>
> > > About the "concept" of plugin. I agree with almost everything you say
> > > but let me insist: A PLUGIN IS AN APPLICATION. Just a special type of
> > > app. It can have modules, models, controllers, views, static files,
> > > services. It does not deserve a special folder but plugin apps need to
> > > identify themselves. I think a PLUGIN file in the app folder should do
> > > the task.
>
> > > We do need to write API specs on how to write plugins.
>
> > > For exampl

[web2py:15165] Re: Web2py performance problems

2009-01-20 Thread vince

can u send us a demo page with all related model/view/controller
files? i'll test with ab with 100 concurrent connection.

-vince

On Jan 20, 1:40 pm, voltron  wrote:
> Thanks Massimo.
>
> All I have in my Apache config are the directives for reverse
> proxying, to my greatest dismay, it just does not scale well. I
> noticed that anything above 100 concurrent users would just shut the
> CherryPY server down. I have to routes activated. Another strange
> thing are the performance dips, the response could be fast, but
> sometimes they just grind to a halt for no reason, this is not
> dependent of database queries oor other processes, just dynamically
> rendered "static" pages.
>
> This is a headache
>
> On Jan 19, 11:46 am, mdipierro  wrote:
>
> > Voltron,
>
> > sorry but I do not have enough information. First of all. Is this with
> > a specific application or can you reproduce the behavior with the
> > welcome app as well?
>
> > Can you show us you apache configuration as well as your routes.py?
>
> > Massimo
>
> > On Jan 19, 4:29 am, voltron  wrote:
>
> > > I have been having serious performance problems. Some tracking down
> > > led to the observation that when using Apache as a reverse proxy,
> > > web2py runs up the CPU usage and shuts down after 100 requests. The
> > > strangest thing is that when this happens, the CPU is only at 60%
> > > usage.
>
> > > Is there some setting that I can tune to avod this?
>
> > > This is a root server with 2GB memory and an 2GHZ Athlon CPU
>
> > > 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:15085] Re: Questions and Introduction

2009-01-18 Thread vince

actually just buy the web2py manual from lulu  and it comes with
python tutorial too. i got mine too since i don't programming in
python quite often.

-vince

On Jan 18, 12:28 pm, Jonathan Benn  wrote:
> Hi Mick,
>
> Here's a helpful bit of advice:
>
> As a beginner with programming, you should always buy the manual if
> there is one. :)
>
> If you don't have it already, here's a free Python book to help you
> learn Python:http://www.diveintopython.org/
>
> In my view, using purely online sources is something for more advanced
> programmers, because they can fill in the blanks with their
> experience.
>
> --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:15084] Re: Proposal: orderby=[...]

2009-01-18 Thread vince

orderby in a list sounds good. i've to use exec right now for some
dynamic changing sort order with multi column.

-vince

On Jan 18, 9:59 pm, Robin B  wrote:
> To do this:
>
> db().select(db.person.ALL,orderby=˜db.person.name|db.
> person.id)
>
> It would be better to do this:
>
> db().select(db.person.ALL,orderby=[˜db.person.name,db.
> person.id])
>
> Of course this would still work:
>
> db().select(db.person.ALL,orderby=˜db.person.name)
>
> It would be converted to this internally:
>
> db().select(db.person.ALL,orderby=[˜db.person.name])
>
> The benefits of orderby=[...] are that you can more easily add, remove
> or toggle a sort order, not to mention parsing the orderby=[...] in a
> driver becomes trivial.
>
> Downsides?
>
> Robin
--~--~-~--~~~---~--~~
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:15020] Re: predefined label and SQLTABLE header

2009-01-15 Thread vince

i guess we can just do the straight forward one and simply output
"Name, Name"
and let the headers array overwrite the default label if it's a join
table.

-vince

On Jan 16, 12:24 am, mdipierro  wrote:
> I was about to do this when I encountered a logical problem...
>
> db.define_table('table1',SQLField('name',label='Name'))
> db.define_table('table2',SQLField('name',label='Name'),SQLField
> ('other_id',db.table1))
>
> {{=db(db.table1.id==db.table2.other_id).select()}}
>
> this makes a JOIN so the table headers involve two tables.
> currently the header is
>
> table1.name, table2.name
>
> if I use label, the header would be:
>
> Name, Name
>
> because a label makes sense only within the context of a table, not
> two joint tables.
> the current mechanism is to do
>
> {{=db(db.table1.id==db.table2.other_id).select()}}
>
> {{=SQLTABLE(db(db.table1.id==db.table2.other_id).select(),headers=
> {'table1.name':'Fisrt table Name', 'table2.name':'Second Table
> Name'})}}
>
> which makes
>
> First Table Name, Second Table Name
>
> is this sufficient? Pros Cons Suggestions?
>
> Massimo
>
> On Jan 15, 8:02 am, mdipierro  wrote:
>
> > I agree. In 1.56.
>
> > On Jan 15, 5:10 am, vince  wrote:
>
> > > i think SQLTABLE header should read the predefined label as well as
> > > SQLFORM
>
> > > -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:14988] predefined label and SQLTABLE header

2009-01-15 Thread vince

i think SQLTABLE header should read the predefined label as well as
SQLFORM

-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:14980] Re: Labels on table definition

2009-01-14 Thread vince

can you make it work with SQLTABLE's header as well? thanks

-vince

On Jan 15, 3:21 am, mdipierro  wrote:
> should work without T2. which version do you have?
> Massimo
>
> On Jan 14, 12:24 pm, Mike  wrote:
>
> > I recently tried this and it didn't seem to work...so I gather from
> > this thread that T2 is currently required to define a label in the
> > model but the plan is for this feature to migrate into the web2py
> > core?
>
> > Thanks for the clarification...
>
> > Mike
>
> > On Jan 13, 10:54 pm, mdipierro  wrote:
>
> > > It should. This is one of the many features that was added after the
> > > manual was written. As soon as we finish integrating T2 into web2py,
> > > the manual will be revised. Hopefuly in one month.
>
> > > Massimo
>
> > > On Jan 13, 7:48 pm, mfolmos  wrote:
>
> > > > I answer myself: RTFM
> > > > a=SQLField
> > > > (name,'string',length=32,required=False,default=None,requires=IS_NOT_EMPTY
> > > > (),notnull=False,
> > > > unique=False,uploadfield=None,widget=None, label=None)
>
> > > > Why doesn't put this on the cookbook or t2 manual with the examples?
> > > > taken from the t2.pdf
>
> > > > *  models/db.py
> > > > 1  db=SQLDB(』sqlite://storage.db')
>
> > > > 2  db.define_table(』puppy',
> > > > 3   SQLField(』name'),
> > > > 4   SQLField(』image',』upload'))
> > > > 5  db.puppy.name.requires=IS_NOT_EMPTY()
>
> > > > Can be:
> > > > *  models/db.py
> > > > 1  db=SQLDB(』sqlite://storage.db')
>
> > > > 2  db.define_table(』puppy',
> > > > 3   SQLField(』name',label="Puppy name"),
> > > > 4   SQLField(』image',』upload',label="Photo"))
> > > > 5  db.puppy.name.requires=IS_NOT_EMPTY()
>
> > > > Mauricio
>
> > > > On 13 ene, 18:16, mfolmos  wrote:
>
> > > > > My first post in the group:
>
> > > > > I think if web2py have something like this or can be implemented:
> > > > > db.define_table('puppy',
> > > > > SQLField('name',label='A puppy'),
> > > > > SQLField('image','upload', label='Photo'))
>
> > > > > Would be grat, this is for Not having to write:
> > > > > db.puppy.name.label = "A puppy"
> > > > > db.puppy.image.label = "Photo"
>
> > > > > and the forms created with SQLForm() set automaticaly the labels and
> > > > > if not labels defined, the actual behaviour
>
> > > > > Thanks in advance
>
> > > > > Mauricio- Hide quoted text -
>
> > > - Show quoted text -
--~--~-~--~~~---~--~~
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   >