[web2py:37878] a problem with gluon.shell.env

2009-12-27 Thread 王怀玉
to reuse model definition in a module, so i use gluon.shell.env . code in module is like this: module code start ### os.chdir(/path/to/web2py/) from gluon.shell import env globals().update(env('my_application_name', import_models=True)) while True: print "count", db(db.myt

[web2py:37879] Re: Add buttons to form=auth() form

2009-12-27 Thread annet
Massimo, > What do you mean by "doesn't work"? You do not see the buttons? Yes. > Try this: > > def user(): >     form=auth() >     form[0][-1][1].append(INPUT(_type="reset",_value="Reset")) >     form[0][-1][1].append(INPUT > (_type="button",_value="Cancel",_onclick="window.location='%s';"%URL

[web2py:37880] Confirmation at delete

2009-12-27 Thread annet
The jQuery code for confirmation on delete connects the onclick event of the checkbox with a confirmation dialog, I have never seen this convention before, in the applications I have seen sofar the confirmation dialog is triggered by a submit. Is it possible to re- write the code in web2py_ajax.htm

[web2py:37881] Re: files under a subdomain.

2009-12-27 Thread annet
Massimo, > yes but you will need to hardcode the URLs instead of using URL(...). So the URLs in web2py_ajax and the custom controller would read like: > > response.files.insert(0,URL(r=request,c='static',f='jquery.js')) response.files.insert(0,'http://files.example.com/js/jquery.js') > > resp

[web2py:37882] DAL, transactions

2009-12-27 Thread Thadeus Burgess
Does the DAL perform all queries on a transaction basis... that happens to commit() at the end of a successful request? and on an error the transaction is rolled back? -Thadeus -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this gro

[web2py:37883] WSGI and wsgihandler.py

2009-12-27 Thread annet
I am working my way through setting up my account at Webfaction using the WebFaction and web2py User Guides and this post: http://forum.webfaction.com/viewtopic.php?pid=8844#p8844 Since this post is almost a year old, and web2py has evolved rapidly, I wonder whether the procedure is still accurate

[web2py:37884] internatinalization for auth fields

2009-12-27 Thread Frank
regarding default auth fields, we can use {{if not auth.is_logged_in():response.write(auth.login())}} as login form, you will see field names like username, password etc in login form in English, we want translate field names of login form into other languages, T method is not the solution obviousl

[web2py:37885] Re: Hosting at Webfaction

2009-12-27 Thread annet
Hi Mengu, > so basically, you need to fire up another terminal window to ssh into > your webfaction account and use kill -SIGTERM 9813. that's what it > means. I thought web2py is a long running process but from these instructions: from another terminal, kill web2py process according to web2py's

[web2py:37886] xmlrpc usage

2009-12-27 Thread Oguz Yarimtepe
Hi, I was checking xmlrpc usage[1] at web2py. I have an application names "test". I created xmlrpctest.py under it and added the below lines: from gluon.tools import Service service = Service(globals()) @service.xmlrpc def add(a,b): return a+b @service.xmlrpc def sub(a,b): return a-b def call

[web2py:37887] Re: starting web2py in the foreground for debugging

2009-12-27 Thread jep
Tnx, it works :) Best wishes, On Dec 22, 3:57 pm, mdipierro wrote: > Hi Jep, > > create a file routes.py and in it > > routes_onerror=[('*/*','/logging/default/index')] > > and the create an app "logging" with a "controllers/default.py" that > does the following: > > from gluon.admin import *

[web2py:37888] Re: starting web2py in the foreground for debugging

2009-12-27 Thread jep
For the record, i changed the import line in the index() function to: {{{ from gluon.restricted import RestrictedError }}} Else the browser gives me an errorpage, that it gets a redirect that will never complete. -- You received this message because you are subscribed to the Google Groups

[web2py:37889] Editor from browser

2009-12-27 Thread Joan Miller
Since that web2py comes with an editor in HTML/Js to develop from browser, this could make you smile. Bespin is a Mozilla's project to have a full IDE from browser; it's free/open source and there is a server built on python so it could be integrated in web2py. * http://ajaxian.com/archives/bes

[web2py:37890] Re: a problem with gluon.shell.env

2009-12-27 Thread mdipierro
If I understand the problem, you need to do db.commit() On Dec 27, 3:45 am, 王怀玉 wrote: > to reuse model definition in a module, so i use gluon.shell.env . > code in module is like this: > module code start ### > os.chdir(/path/to/web2py/) > from gluon.shell import env > glo

[web2py:37891] Re: Confirmation at delete

2009-12-27 Thread mdipierro
I do not object and I would take a patch to do it if it does not conflict with the ajax capture of form submission. On Dec 27, 4:53 am, annet wrote: > The jQuery code for confirmation on delete connects the onclick event > of the checkbox with a confirmation dialog, I have never seen this > conve

[web2py:37892] Re: DAL, transactions

2009-12-27 Thread mdipierro
yes On Dec 27, 5:55 am, Thadeus Burgess wrote: > Does the DAL perform all queries on a transaction basis... that > happens to commit() at the end of a successful request? and on an > error the transaction is rolled back? > > -Thadeus -- You received this message because you are subscribed to th

Re: [web2py:37893] Re: DAL, transactions

2009-12-27 Thread Vasile Ermicioi
any changes in DAL about GAE transactions? On Sun, Dec 27, 2009 at 5:35 PM, mdipierro wrote: > yes > > On Dec 27, 5:55 am, Thadeus Burgess wrote: > > Does the DAL perform all queries on a transaction basis... that > > happens to commit() at the end of a successful request? and on an > > error t

[web2py:37894] Re: WSGI and wsgihandler.py

2009-12-27 Thread mdipierro
Look into the script described here: http://www.web2pyslices.com/main/slices/take_slice/29 On Dec 27, 6:28 am, annet wrote: > I am working my way through setting up my account at Webfaction using > the WebFaction and web2py User Guides and this > post:http://forum.webfaction.com/viewtopic.php?pi

[web2py:37895] Re: internatinalization for auth fields

2009-12-27 Thread mdipierro
db.auth_user.password.label=T('The Password') On Dec 27, 7:14 am, Frank wrote: > regarding default auth fields, we can use > {{if not auth.is_logged_in():response.write(auth.login())}} as login form, you > will see field names like username, password etc in login form in English, we > want transl

[web2py:37896] Re: Confirmation at delete

2009-12-27 Thread annet
Massimo, I am a complete novice when it comes to programming in Python. Maybe one of the group members could provide a patch? Kind regards, Annet -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@goog

Re: [web2py:37897] Re: Confirmation at delete

2009-12-27 Thread Vasile Ermicioi
I guess you can do that with javascript (client side) On Sun, Dec 27, 2009 at 5:42 PM, annet wrote: > Massimo, > > I am a complete novice when it comes to programming in Python. > Maybe one of the group members could provide a patch? > > Kind regards, > > Annet > > -- > > You received this messa

[web2py:37898] Re: WSGI and wsgihandler.py

2009-12-27 Thread annet
Massimo, Thanks for the link. I have another question, in the forum post mentioned above I also read: > from another terminal, kill web2py process according to web2py's > output instructions > Start your app: >~/webapps/apachewsgi/apach2/bin/start To which Mengu added: > when you start

Re: [web2py:37899] Re: DAL, transactions

2009-12-27 Thread Thadeus Burgess
Is it possible to disable auto_commit() so that it must be explicitly called? And are the Transactions shared between threads? Or must they be committed to be seen in other threads? -Thadeus On Sun, Dec 27, 2009 at 9:38 AM, Vasile Ermicioi wrote: > any changes in DAL about GAE transactions?

Re: [web2py:37900] Re: Confirmation at delete

2009-12-27 Thread Thadeus Burgess
That delete alert box is all on the javascript side -Thadeus On Sun, Dec 27, 2009 at 9:53 AM, Vasile Ermicioi wrote: > I guess you can do that with javascript (client side) > > On Sun, Dec 27, 2009 at 5:42 PM, annet wrote: >> >> Massimo, >> >> I am a complete novice when it comes to program

[web2py:37901] Re: WSGI and wsgihandler.py

2009-12-27 Thread mdipierro
> On my Mac Server I used Screen Sharing to start web2py, and run web2py > as a long running process, that is, I didn't 'kill' it. How does that > work at WebFaction > is web2py started everytime there is a request an then stopped? This happens ONLY if you use cgihandler.py. It does not happen wit

[web2py:37902] Re: DAL, transactions

2009-12-27 Thread mdipierro
You can commit db.commit() and db.rollback() explicitly. Just do it when you need. The concept of cross-thread transaction is not well defined and would be very unsafe. Perhaps if you tell us what you are tring to achieve we can suggest a better way. On Dec 27, 10:29 am, Thadeus Burgess wrote:

[web2py:37903] Re: xmlrpc usage

2009-12-27 Thread mdipierro
You should get some kid of error if the URL were wrong. Anyway try: import xmlrpclib server=xmlrpclib.ServerProxy('http://127.0.0.1:8000/app/xmlrpctest/ call/xmlrpc') print str(server.add(3,4)+server.sub(3,4)) (assuming the port is 8000). On Dec 27, 8:59 am, Oguz Yarimtepe wrote: > Hi, > > I

[web2py:37904] Re: Editor from browser

2009-12-27 Thread mdipierro
I would like to see people build alternatives to default admin app. I do not think it is a good idea to replace admin because I like the fact that it has no dependencies, but more experienced users should be able to use more powerful alternatives like the one you suggest. Ideally I would like to ha

Re: [web2py:37905] Re: DAL, transactions

2009-12-27 Thread Thadeus Burgess
Just curious in how it works in web2py. In SQLAlchemy sessions are thread safe.. so uncommitted transactions are accessible from other threads. -Thadeus On Sun, Dec 27, 2009 at 1:44 PM, mdipierro wrote: > You can commit db.commit() and db.rollback() explicitly. Just do it > when you need. >

[web2py:37906] sad without buttons

2009-12-27 Thread Thadeus Burgess
Hrm... no BUTTON helper :*( -Thadeus -- 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 opti

[web2py:37907] Re: Editor from browser

2009-12-27 Thread Timbo
A more featureful admin app would be nIce but I support Massimo in keeping the current one. A point of clarification, Bespin is merely an editor. Their goal is to eventually create an IDE but it is far from that at present. Other problems include no IE support and it suffers from the same highlig

[web2py:37908] Re: DAL, transactions

2009-12-27 Thread mdipierro
Web2py does have the equivalent of SQLAlchemy sessions. When a request arrives web2py creates a new database connection object or pools an existing connection from a connection pool, then it creates a cursor object. All db IO in the request is done via the cursor object. This is thread-safe in the

[web2py:37909] Re: sad without buttons

2009-12-27 Thread mdipierro
TAG.BUTTON you can can make any helper you need with TAG.anything On Dec 27, 2:48 pm, Thadeus Burgess wrote: > Hrm... no BUTTON helper :*( > > -Thadeus -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web..

[web2py:37910] interesting issue and a proposal

2009-12-27 Thread mdipierro
This thread http://groups.google.com/group/google-appengine-python/browse_thread/thread/ceebac3397625019# raises an interesting issue and proposes an interesting solution that works on GAE. Executive summary: In GAE you can define computed fields that are computed now when data is extracted but

[web2py:37911] Re: interesting issue and a proposal

2009-12-27 Thread mdipierro
It was easy to add it to the current DAL (will work on GAE too) massimo-di-pierros-macbook:web2py mdipierro$ python web2py.py -S welcome >>> db=DAL('sqlite://storage.sqlite') >>> db.define_table('a',Field('b'),Field('c',compute=lambda r: r['b'].lower())) >>> db.a.insert(b='HELLO') >>> for row in d

Re: [web2py:37912] Re: internatinalization for auth fields

2009-12-27 Thread Frank
mdipierro writes: > > db.auth_user.password.label=T('The Password') > > > -- > it works, thanks, Frank -- 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

Re: [web2py:37913] Re: sad without buttons

2009-12-27 Thread Thadeus Burgess
Its the principle of the thing! I do like my buttons. They are special! -Thadeus On Sun, Dec 27, 2009 at 3:51 PM, mdipierro wrote: > TAG.BUTTON > > you can can make any helper you need with TAG.anything > > On Dec 27, 2:48 pm, Thadeus Burgess wrote: >> Hrm... no BUTTON helper :*( >> >> -Th

[web2py:37914] Re: interesting issue and a proposal

2009-12-27 Thread Mengu
is there any difference with this and our virtualfields? On 28 Aralık, 00:39, mdipierro wrote: > It was easy to add it to the current DAL (will work on GAE too) > > massimo-di-pierros-macbook:web2py mdipierro$ python web2py.py -S > welcome>>> db=DAL('sqlite://storage.sqlite') > >>> db.define_tabl

[web2py:37915] Re: interesting issue and a proposal

2009-12-27 Thread mdipierro
Yes. The values of virtualfields are not stored in the database. They are computed every time a record is extracted. In the above case the values are computed when a record is inserted and they are stored in the database. In RDBS this is not really a good idea but you may need it in non relational

Re:[web2py:37916] Re: a problem with gluon.shell.env

2009-12-27 Thread 王怀玉
i had done as your advice. no change at all . you can try it by yourself. thank you very very much ! 在2009-12-27,mdipierro 写道: >If I understand the problem, you need to do > >db.commit() > >On Dec 27, 3:45 am, 王怀玉 wrote: >> to reuse model definition in a module, so i use gluon.shell.env . >>

[web2py:37917] Re: a problem with gluon.shell.env

2009-12-27 Thread mdipierro
How do you insert the row? The commit goes after you insert the row. Massimo On Dec 27, 8:15 pm, 王怀玉 wrote: > i had done as your advice. > > no change at all . > you can try it by yourself. > > thank you very very much ! > > 在2009-12-27,mdipierro 写道: > > >If I understand the problem, you need t

[web2py:37918] Multiple DB keys in from pull down menu

2009-12-27 Thread Christopher Helck
I apologize if this is more of a DB question than a web2py question, but I'm having trouble with populating a drop down menu in the admin interface. I have a table (called 'version') with two keys ('name' and 'version') and a third column 'component_id'. This table records which versions of an ap

[web2py:37919] Re: Multiple DB keys in from pull down menu

2009-12-27 Thread mdipierro
First of all let me congratulate for the clear format of your question. This line: db.report.from_id.requires = IS_IN_DB(db, db.version.id, '%(name)s %(version)s')# Again, I want a set, not a list. does not display the cartesian product of name and version but only a list of name, version

[web2py:37920] cache.increment

2009-12-27 Thread Thadeus Burgess
def increment(self, key, value=1): self.locker.acquire() try: if key in self.storage: value = self.storage[key][1] + value self.storage[key] = (time.time(), value) except BaseException, e: self.locker.release()