[web2py:38287] Re: membership manager plugin

2010-01-03 Thread KMax
The issue is: links inside ajax loaded content on click does not update ajax loaded data, but sent browser to /welcome/plugin_groups/ index/1 # correct and about this guess? I guess only 'post' are modified to ajax compatible way, but not 'get' links. On 4 янв, 00:21, mdipierro wrote: > correct

[web2py:38286] Re: SQLFORM.factory or a better way for custom forms

2010-01-03 Thread K.R.Arun
hi, Is that mean I can use LOAD function in the register button's href attribute. You can see from my code that, my form needs some customization, that's why I used separate view. Now how can I load the form via ajax. can I load separate view within another view? what's the target for the AJAX load

[web2py:38285] Re: Web2Py talk and Demo

2010-01-03 Thread mdipierro
good luck with your talk. If you need anything else please just ask. Whatever I have I am happy to share. Massimo On Jan 3, 9:27 pm, Anand Vaidya wrote: > Hi Skip, > > Thanks, you are right. I completely missed the link. This is the file > I am looking for. > > Regards > Anand > > On Jan 4, 10:5

[web2py:38284] Re: Web2Py talk and Demo

2010-01-03 Thread Anand Vaidya
Hi Skip, Thanks, you are right. I completely missed the link. This is the file I am looking for. Regards Anand On Jan 4, 10:50 am, s...@pobox.com wrote: > > "Anand" == Anand Vaidya writes: > >     Anand> Is it possible to get your slides in PPT or ODP (openoffice, >     Anand> preferably)

Re: [web2py:38283] Web2Py talk and Demo

2010-01-03 Thread skip
> "Anand" == Anand Vaidya writes: Anand> Is it possible to get your slides in PPT or ODP (openoffice, Anand> preferably) so that I modify and reuse the slides, instead of Anand> recreating another set. Not sure what slides you're referring to, but there is a cookbook tutorial wit

[web2py:38282] Web2Py talk and Demo

2010-01-03 Thread Anand Vaidya
Hi, I will be giving a short intro as well as a demo to Web2Py at the upcoming Singapore Python Users Group. Details: http://www.facebook.com/event.php?eid=233724570755 Massimo, Is it possible to get your slides in PPT or ODP (openoffice, preferably) so that I modify and reuse the slides, ins

[web2py:38281] Re: Experimental in trunk: GAE StringListProperty

2010-01-03 Thread mdipierro
The new DAL structure (which you can see in gluon/dal.py) has a standard API (DAL, Table, Field, etc) and delegates everything to an adapter. There are adapters for all supported RDBS (CPython and Jython) and there will be some for NODB as well. Adapters have a hierarchical structure that basically

[web2py:38280] Re: Total size of uploaded files

2010-01-03 Thread mdipierro
yes. def filesize(filename): import os, stat return os.stat(os.path.join(request.folder,filename)) [stat.ST_MTIME] db.define_table('mytable', Field('file','upload'), Field ('file_size','integer',readable=False,writable=False,compute=lambda r: filesize(r['file']))) On Jan 3, 7:10 pm, Al

[web2py:38279] Re: Experimental in trunk: GAE StringListProperty

2010-01-03 Thread Yarko Tymciurak
On Jan 3, 12:19 pm, mdipierro wrote: > I agree. I think there should be a web2py type that merges the > functionalities of ListProperty on GAE and IS_IN_SET(multiple=True) This is one instance of what I imagined has to happen when (some time ago) I mentioned that potentially there would be a sepa

Re: [web2py:38278] Re: Blogitizor

2010-01-03 Thread Thadeus Burgess
If a planetplanet like application is made for web2py, then I made an RSS just for web2py category. http://thadeusb.com/weblog/feed.rss/category/Web2py -Thadeus On Sun, Jan 3, 2010 at 7:17 PM, Thadeus Burgess wrote: > Basically it gets parsed into request.args. > > So > > http://thadeusb.co

Re: [web2py:38277] Re: Blogitizor

2010-01-03 Thread Thadeus Burgess
Basically it gets parsed into request.args. So http://thadeusb.com/weblog/category/Web Development has a request.args of ['Web Development',] So I then take that name, query my category database to pull its 'id', and then use db.page.categories.like('|'+id+'|') since categories are a one-to-ma

Re: [web2py:38276] Re: Total size of uploaded files

2010-01-03 Thread Alexandre
But I didnt want to query the size of the files every time I needed them, isnt there a way I can keep them on the db? Also, how to retrieve the original filename of the uploaded file? Thanks, Alexandre On 03/01/2010, mdipierro wrote: > def filesize(filename): >import os, stat >return os

[web2py:38275] New features not documented in Book (2nd edition)

2010-01-03 Thread DenesL
New features not documented in Book (2nd edition) 1.74.5 * auth.user_id (shortcut for auth.user.id, defaults to None if not logged in) * support for all native types on GAE (e.g. StringListProperty) * cache.ram usage statistics * no more auth menu in scaffolding * no more splash screen with -Q * e

[web2py:38274] Re: Total size of uploaded files

2010-01-03 Thread mdipierro
def filesize(filename): import os, stat return os.stat(os.path.join(request.folder,filename)) [stat.ST_MTIME] On Jan 3, 6:20 pm, Alexandre wrote: > Hi, > > I want to get the number of uploaded files and also the total size of > them, how I do that? Can I assume all files are in the uploade

[web2py:38273] Re: introspection?

2010-01-03 Thread mdipierro
how about python web2py.py -S myapp -M >>> help(db.define_table) On Jan 3, 6:18 pm, s...@pobox.com wrote: > I'm trying to take advantage of Python's introspection capabilities to find > out what certain objects can do.  I'm not getting very far though.  Here's > what I've discovered so far about

[web2py:38272] Total size of uploaded files

2010-01-03 Thread Alexandre
Hi, I want to get the number of uploaded files and also the total size of them, how I do that? Can I assume all files are in the uploaded files? Also, I want to display the size of each individual file next to their name, how I do that? Thanks -- Alexandre Rosenfeld Eng Comp 06 - USP São Carl

[web2py:38271] introspection?

2010-01-03 Thread skip
I'm trying to take advantage of Python's introspection capabilities to find out what certain objects can do. I'm not getting very far though. Here's what I've discovered so far about db.define_table and db itself: In[14]: import pydoc Out[14]: In[15]: pydoc.help(db.define_table)

[web2py:38270] Re: persistent background process

2010-01-03 Thread Richard
I was doing that but sometimes the process crashed or was killed by my hosting provider, so I need a way to continue it automatically. Also I may want to execute a number of background tasks in parallel. And it uses extra resources that aren't needed, which is a problem on my hosting where I am rea

Re: [web2py:38269] UliPad as IDE for web2py

2010-01-03 Thread Vasile Ermicioi
Not on topic: Just took a look at uliweb project website and here are my impressions: - is not easier to use than web2py (install, editing, project start-up) - use sqlalchemy as his orm that means no gae orm support - web2py is much often updated, uliweb last update ( http://code.google.com/p/uliw

[web2py:38268] Re: web2py authentication for non-web2py apps?

2010-01-03 Thread mdipierro
It really depends on a lot of details but you may want to look into this: https://www.web2py.com/cas instead of using the built-in web2py auth. Massimo On Jan 3, 3:16 pm, JimK wrote: > Hello Everyone, > > I'm working on a project that is controlled via a web2py app and > grants permissions to ot

[web2py:38267] web2py authentication for non-web2py apps?

2010-01-03 Thread JimK
Hello Everyone, I'm working on a project that is controlled via a web2py app and grants permissions to other non-web2py applications. Does anyone have any insight on how I can first direct the user to register/login to his account via the web2py app and then allow the users to access the other ap

[web2py:38266] Re: On Login failure

2010-01-03 Thread mdipierro
I think there is a problem with stable version in case there is a redirect, a login failure and a second redirect. I think I have fixed it in trunk. Since it required a lot of change it needs to be tested. Can you please give it a try and let us know? Massimo On Jan 3, 1:53 am, kbochert wrote:

[web2py:38265] Re: Inherit common columns

2010-01-03 Thread mdipierro
from gluon.sql import Table a=Table(None,'tmp',Field('xxx',..),Field(...)) db.define_table('mytable1',a,Field(...)) db.define_table('mytable2',a,Field(...)) you get db.mytable1.xxx and db.mytable2.xxx Massimo On Jan 3, 12:36 pm, villas wrote: > See Web2py 2nd Version Book/Manual Pg 179, secti

[web2py:38264] Re: Inherit common columns

2010-01-03 Thread villas
See Web2py 2nd Version Book/Manual Pg 179, section Table Inheritance. On Jan 3, 4:56 pm, werner wrote: > Is it possible to define common db columns, e.g. posted_by, posted_on > etc once and define on the appropriate table to just inherit these > common columns? > > Werner -- You received this m

[web2py:38263] Re: SQLFORM.factory or a better way for custom forms

2010-01-03 Thread mdipierro
{{=LOAD(a,b,args=args,vars=vars,ajax=ajax,ajax_trap=ajax_trap)}} a,b,args,vars are used to build the URL URL(request.application,c=a,f=b,args=args,vars=vars) if ajax=False the URL is called BEFORE the page is served if ajax=True the URL LOAD just generate JS code to request tha page via AJAX if a

[web2py:38262] Re: persistent background process

2010-01-03 Thread mdipierro
I normally just start a separate web2py process. python web2py.py -S app -M -S thescript On Jan 3, 11:58 am, Michael Toomim wrote: > Great!  I am also trying to implement this.  Richard and Auden, have > you gotten anything working yet?  How about we share solutions? > > My current difficulty is

[web2py:38261] Re: membership manager plugin

2010-01-03 Thread mdipierro
correct On Jan 3, 11:53 am, KMax wrote: > Thank you for comments. > I was looking to .belongs side, but did not find correct one query. > > Searching for documentation make me think that all plugin_* stuff are > not so complicatated. > Just admin Plugins division. All my creating could be done us

[web2py:38260] Re: Experimental in trunk: GAE StringListProperty

2010-01-03 Thread mdipierro
I agree. I think there should be a web2py type that merges the functionalities of ListProperty on GAE and IS_IN_SET(multiple=True) On Jan 3, 11:52 am, Yarko Tymciurak wrote: > This is directly obvious, but I will state it anyway: > > On Dec 30 2009, 1:17 am, mdipierro wrote: > > > I changed this

[web2py:38259] Re: SQLFORM.factory or a better way for custom forms

2010-01-03 Thread K.R.Arun
On Jan 3, 1:25 am, mdipierro wrote: > well, you can do it with FROM (not SQLFORM.factory) but You would not > gain anything in your case. > > About AJAX. > > You could make something like > > def ajax_user(): return auth() # instead of dict(form=auth()) > > and then in a page > > {{=LOAD('defaul

[web2py:38258] Re: persistent background process

2010-01-03 Thread Michael Toomim
Great! I am also trying to implement this. Richard and Auden, have you gotten anything working yet? How about we share solutions? My current difficulty is figuring out where to create the persistent background thread. - If I spawn it in a controller or model file will it be limited to 10 seco

[web2py:38257] Re: NameError: name 'auth' is not defined

2010-01-03 Thread Yarko Tymciurak
On Jan 3, 8:07 am, joscha wrote: > Hello. > > The example starts on page 72(scribd page number. Its page 56 in the > documentation). The following page contains the db.py example. ... yeah, there are 16 physical pages before page numbering starts w/ "1" (in the PDF you notice this)... > > I thou

[web2py:38256] Re: membership manager plugin

2010-01-03 Thread KMax
Thank you for comments. I was looking to .belongs side, but did not find correct one query. Searching for documentation make me think that all plugin_* stuff are not so complicatated. Just admin Plugins division. All my creating could be done using usual controller with corresponding view. Is not

[web2py:38255] Re: Experimental in trunk: GAE StringListProperty

2010-01-03 Thread Yarko Tymciurak
This is directly obvious, but I will state it anyway: On Dec 30 2009, 1:17 am, mdipierro wrote: > I changed this. It was UGLY. > > Now you can do: > >     from gluon.contrib.gql import gae >     db.define_table('person',Field('names',gae.StringListProperty())) for a DAL (abstraction layer), this

Re: [web2py:38254] Re: SQLFORM.factory or a better way for custom forms

2010-01-03 Thread Alex Fanjul
Hi Massimo, In relation to this, there is one previous but important big thread talking about tableless forms that I would add to web2py roadmap somehow. http://www.mail-archive.com/web2py@googlegroups.com/msg27116.html I think it's a recurrent subject in this forum, and there was some attempts

[web2py:38253] Inherit common columns

2010-01-03 Thread werner
Is it possible to define common db columns, e.g. posted_by, posted_on etc once and define on the appropriate table to just inherit these common columns? Werner -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to

Re: [web2py:38252] Re: writable=False on foreign keys makes crud fail

2010-01-03 Thread Miguel Lopes
On Sun, Jan 3, 2010 at 4:17 PM, mdipierro wrote: > If it is not writable you may aso want to give it a default when you > crud.create it. > Yes! The better I understand crud the more of SQLFORMs I see disappearing in my app :-) Miguel -- You received this message because you are subscribed to t

[web2py:38251] Re: writable=False on foreign keys makes crud fail

2010-01-03 Thread mdipierro
If it is not writable you may aso want to give it a default when you crud.create it. On Jan 3, 10:16 am, Miguel Lopes wrote: > On Sun, Jan 3, 2010 at 4:01 PM, Miguel Lopes wrote: > > I have: > > > form=crud.update(db.contact,contact) > > > which raises an exception due to the model having writab

[web2py:38250] Re: writable=False on foreign keys makes crud fail

2010-01-03 Thread Miguel Lopes
On Sun, Jan 3, 2010 at 4:01 PM, Miguel Lopes wrote: > I have: > > form=crud.update(db.contact,contact) > > which raises an exception due to the model having writable=False on a > relation: > > db.define_table('contact', >    ... >    Field('account_id',db.account,writable=False), >    ... > ) > >

[web2py:38249] Re: persistent background process

2010-01-03 Thread mdipierro
This is what I would do: db.define_table('queue',Field('status'),Field('descr')) In actions db.queue.insert(status='PENDING',descr='whatever') In your own scrips that you can run via CRON or via background process while True: tasks = db(db.queue.status=='PENDING').select(limitby=(0,10)).fi

[web2py:38248] UliPad as IDE for web2py

2010-01-03 Thread werner
I think the idea behind this is quit nice as the web based editing is .. However I find the current support a bit limited/repetitive. Is there anyway that one could have UliPad start up on pressing the "edit" link (or can one set "Toggle editor" to unchecked by default) and when one saves can

[web2py:38247] writable=False on foreign keys makes crud fail

2010-01-03 Thread Miguel Lopes
I have: form=crud.update(db.contact,contact) which raises an exception due to the model having writable=False on a relation: db.define_table('contact', ... Field('account_id',db.account,writable=False), ... ) Is this correct? How can I use crud without allowing for the relation to b

[web2py:38246] Re: membership manager plugin

2010-01-03 Thread mdipierro
A couple of things: query = 'SELECT auth_user.id FROM auth_user,auth_membership where auth_user.id>0 and auth_user.id not in (select auth_membership.user_id from auth_membership where auth_membership.group_id='+str(group_id)+') group by auth_user.id' rows = db.executesql(query) would be rows =

[web2py:38245] Re: NameError: name 'auth' is not defined

2010-01-03 Thread joscha
Hello. The example starts on page 72(scribd page number. Its page 56 in the documentation). The following page contains the db.py example. I thought I have to replace the existing content. That was my fault. Thx a lot. On 2 Jan., 22:52, mdipierro wrote: > Hi, > > just to make sure I understand.

[web2py:38244] Re: Experimental in trunk: GAE StringListProperty

2010-01-03 Thread Richard
great! The updated API is much better. On Dec 30 2009, 6:17 pm, mdipierro wrote: > I changed this. It was UGLY. > > Now you can do: > >     from gluon.contrib.gql import gae >     db.define_table('person',Field('names',gae.StringListProperty())) > > and you can do: > >     db.person.insert(name

[web2py:38243] Re: persistent background process

2010-01-03 Thread Richard
I haven't implemented this yet, but my plan on Linux to keep a background process running is: - Define a task table, which is checked on every request - If the task table is empty then start the background task with subprocess and store the pid in the task table - If the task table has an entry bu

[web2py:38242] Re: membership manager plugin

2010-01-03 Thread KMax
I have some progress here. Code might looks ugly, please excuse my newbie try. As you can see I use raw sql query to my postgress, since I fail to make same by web2py dal --begin of plugin controller-- def index(): group_id=request.args(0) if IS_IN_DB(db(db.auth_user.id==request.vars.id),db