Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-16 Thread Martín Mulone
Up. How do I use LOAD in the module? 2011/5/9 Jonathan Lundell > On May 9, 2011, at 12:57 PM, Bruno Rocha wrote: > > On Mon, May 9, 2011 at 3:46 PM, Martín Mulone > wrote: > >> current.db = DAL(..) >> > > The db doesn't belongs to app? > > current.app.db = DAL(...) > > > Yes, I think that's be

Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Jonathan Lundell
On May 9, 2011, at 12:57 PM, Bruno Rocha wrote: > On Mon, May 9, 2011 at 3:46 PM, Martín Mulone wrote: > current.db = DAL(..) > > The db doesn't belongs to app? > > current.app.db = DAL(...) > Yes, I think that's better.

Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Bruno Rocha
On Mon, May 9, 2011 at 3:46 PM, Martín Mulone wrote: > current.db = DAL(..) > The db doesn't belongs to app? current.app.db = DAL(...)

Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Martín Mulone
I started to rewrite powerpack :S to make use of this. Just to clarify, this is ok?, this is something that I don't want to change again :P: current.app = Storage() current.app.settings = Storage() #settings of the current app current.db = DAL(..) current.app.auth = Auth(..) current.app.plugins =

Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Jonathan Lundell
On May 9, 2011, at 9:50 AM, Massimo Di Pierro wrote: > > Assuming current.app ... > > why > current.plugins > instead of > current.app.plugins That would be better, I suppose. > > but yes to > > current.app.auth > > I think we need a policy before we decide on a case by case basis but > I h

[web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Massimo Di Pierro
Assuming current.app ... why current.plugins instead of current.app.plugins but yes to current.app.auth I think we need a policy before we decide on a case by case basis but I have not given much thought to the matter. On May 9, 9:07 am, Jonathan Lundell wrote: > On May 9, 2011, at 6:52 AM, M

Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Jonathan Lundell
On May 9, 2011, at 6:52 AM, Massimo Di Pierro wrote: > > I agree. But should be call it application? Fir of all the settings > are request level, not app level. And it may create confusion between > > current.application > current.request.application > > how about one of the following: > current

[web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Massimo Di Pierro
I agree. But should be call it application? Fir of all the settings are request level, not app level. And it may create confusion between current.application current.request.application how about one of the following: current.info current.settings current.parameters current.storage and we set it

Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Jonathan Lundell
On May 9, 2011, at 6:24 AM, Massimo Di Pierro wrote: > >> Jonathan actually mentioned having a current.application Storage that would >> store things like auth and db that are created in models. I would REALLY >> like to see this. I still need to have my z_import_modules.py in order to to >> set t

[web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Massimo Di Pierro
On May 9, 7:41 am, Ross Peoples wrote: > Just wanted to give an update: > > I moved one of my projects with about 10 modules over to the new import > method, and so far it's working perfectly. I should also mention that the > new method has greatly simplified the way I write modules. I used to h

Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-09 Thread Ross Peoples
Just wanted to give an update: I moved one of my projects with about 10 modules over to the new import method, and so far it's working perfectly. I should also mention that the new method has greatly simplified the way I write modules. I used to have a z_import_modules.py model that should run

Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-06 Thread Ross Peoples
That would be nice. Also might I suggest a way to import gluon.storage.Storage when doing 'from gluon import *'. I find myself using Storage a lot, so having that load as a part of 'from gluon import *' would be awesome.

Re: [web2py] Re: some new cool stuff in trunk under testing

2011-05-06 Thread Jonathan Lundell
On May 6, 2011, at 10:56 AM, Ross Peoples wrote: > Ignore the part about 'from gluon import current' not working in the models. > Restarting the web2py server fixed the problem. I may have forgotten to do > that after updating from trunk. > > But out of curiosity, is there a reason other model v

[web2py] Re: some new cool stuff in trunk under testing

2011-05-06 Thread Ross Peoples
Ignore the part about 'from gluon import current' not working in the models. Restarting the web2py server fixed the problem. I may have forgotten to do that after updating from trunk. But out of curiosity, is there a reason other model variables (auth, db, etc) are showing up in current?

[web2py] Re: some new cool stuff in trunk under testing

2011-05-06 Thread Ross Peoples
I am still in the process of rewriting my modules and I've run into a problem. First, I noticed that auth is not part of current. Only cache, session, request, response, and T are a part of current. I have z_import_modules.py model that I used to use to import modules using local_import(). Howe

[web2py] Re: some new cool stuff in trunk under testing

2011-05-06 Thread Christopher Steel
whoops replace: plugin_py_template_path = os.path.join(current_app,'static','plugin_plugin','template_plugin_plugin_py') with: controller_py_template_path = os.path.join(current_app,'static','plugin_plugin','template_plugin_controller_py') sorry... On May 6, 7:31 am, Christopher Steel wrote:

[web2py] Re: some new cool stuff in trunk under testing

2011-05-06 Thread Christopher Steel
The effect is similar (but the method is not the same) to creating a new Web2py application from the Welcome application only we are doing it with plugins using templates so the new plugin comes with as standard skeleton which includes menus, plugin_config and plugin admin users and whatever else y

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Massimo Di Pierro
good. I am lost about the second part. What is plugin generator? On May 5, 10:17 pm, Christopher Steel wrote: > Thanks Massimo, That was a really good call! I think I messed things > up while I was creating a prototype for an automated plugin creator > made some, um, adjustments so that my gener

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Christopher Steel
Thanks Massimo, That was a really good call! I think I messed things up while I was creating a prototype for an automated plugin creator made some, um, adjustments so that my generated plugins where really organized, but apparently not functioning as expected because I forgot about that little exce

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread luckysmack
Wow this os great. This also looks like it may effect things like autocomplete in ide's. For me, learning web2py, that was always one thing that made it more difficult to learn. Not that it was hard. On May 5, 7:25 pm, Plumo wrote: > fantastic news! > This should let me move a lot of code from mo

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Plumo
fantastic news! This should let me move a lot of code from models in to modules.

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Massimo Di Pierro
I doubt this is an issue with the new import or the new gluon.current tread local object. This is probably to the new use of subfolder in models. Do you have subfolders under models/ ? On May 5, 7:52 pm, Christopher Steel wrote: > my menu.py in my plugin no longer show up at the apps index and on

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Christopher Steel
my menu.py in my plugin no longer show up at the apps index and only display "in" the plugin directory. Is this due to the new current scope? Is their a way to get this working again or a "current scope" toggle ? I have a lot of plugins that use this for menu's so any help on this is very appreciat

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Ross Peoples
Thanks for clearing that up. I'll start rewriting my modules and let you know how it all turns out.

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Massimo Di Pierro
Almost. You cannot do do this: self.env = Storage(globals()) self.cache = self.env.cache self.request = self.env.request self.response = self.env.response self.db = self.env.db self.obj1 = self.env.obj1 self.obj2 = self.env.obj2 but you can

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Ross Peoples
I made a typo in my second 'z_import_modules.py' model: obj1 = Object1() obj1 = Object1() Should be: obj1 = Object1() obj2 = Object2() obj3 = Object3() Sorry about that.

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Ross Peoples
I work a lot with modules, so I have a question. I have a 'z_import_modules.py' model that would look something like this: DEBUG = True module1 = local_import('module1', reload=DEBUG) module2 = local_import('module2', reload=DEBUG) module3 = local_import('module3', reload=DEBUG) obj1 = module1.O

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread carlo
what a great work! I just want to thank all developers for this wonderful framework which is improving weekly: I can not understand why big media publishers are still ignoring web2py and not aware about its growing user base. carlo On May 4, 11:09 pm, Massimo Di Pierro wrote: > Hello everybody.

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Massimo Di Pierro
Not really. These changes made the code simpler and shorter. On May 5, 6:53 am, Stodge wrote: > This should make it more attractive to a wider audience, especially as > web2py has a decent feature list overall. I know web2py has a mantra > of retaining backward compatibility, but at what cost? Do

[web2py] Re: some new cool stuff in trunk under testing

2011-05-05 Thread Stodge
This should make it more attractive to a wider audience, especially as web2py has a decent feature list overall. I know web2py has a mantra of retaining backward compatibility, but at what cost? Does it complicate the code? Not a fair comment I know --> but look where it got Microsoft. ;) On May 4

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread Massimo Di Pierro
Basically now if you just write a controller and input modules from yourapp/modules/... web2py can works a lot like Flask while preserving all the other functionality that web2py normally provides.

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread pbreit
Fixed in fe58378e989b. Thanks!

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread Massimo Di Pierro
This is correct in trunk, else you can impersonate without being logged in yourself. On May 4, 6:16 pm, pbreit wrote: > My bad, I forgot about an edit I made to tools.py. > > If it matters, to get impersonate working, I needed to make this edit: > >         #if not self.is_logged_in() or not > se

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread Massimo Di Pierro
try again, please. ;-) On May 4, 6:27 pm, pbreit wrote: > Here's a problem I ran into. I have sub-classed (proper terminology?) Auth() > in order to customize navbar(). I'll probably re-write it not to sub-class > Auth(). > > auth = MyAuth(globals(),db) > > class MyAuth(Auth): > >     def navbar(

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread Massimo Di Pierro
... and Pierre for the custom import which is a critical piece. On May 4, 4:35 pm, Martín Mulone wrote: > +1 Thank you Massimo and Jonathan (of course all the other collaborators) > > 2011/5/4 Bruno Rocha > > > > > > > > > > > I am testing right now, at this point I have 2 apps running with no >

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread pbreit
Here's a problem I ran into. I have sub-classed (proper terminology?) Auth() in order to customize navbar(). I'll probably re-write it not to sub-class Auth(). auth = MyAuth(globals(),db) class MyAuth(Auth): def navbar(self, prefix='', action=None): request = self.environment.req

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread pbreit
My bad, I forgot about an edit I made to tools.py. If it matters, to get impersonate working, I needed to make this edit: #if not self.is_logged_in() or not self.environment.request.post_vars: if not self.is_logged_in():

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread pbreit
I got this: Traceback (most recent call last): File "/Users/pbreit/web2py/gluon/restricted.py", line 181, in restricted exec ccode in environment File "applications/init/models/0_settings.py", line 2, in from gluon.tools import Mail File "/Users/pbreit/web2py/gluon/custom_import.py"

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread DenesL
+1 On May 4, 5:09 pm, Massimo Di Pierro wrote: > Hello everybody > > Jonathan and I have been working on an internal web2py rewrite that while > keeping everything backward compatible will allow you to do this > > modules/mymodule.py > from gluon import * > def f(): return DIV(A(current

[web2py] Re: some new cool stuff in trunk under testing

2011-05-04 Thread Gregory Hellings
On May 4, 4:09 pm, Massimo Di Pierro wrote: > Hello everybody > > Jonathan and I have been working on an internal web2py rewrite that while > keeping everything backward compatible will allow you to do this > > modules/mymodule.py > from gluon import * > def f(): return DIV(A(current.r