to be visible throughout your application, you can put it in any file in
your models folder  (if you want it to be visible in your db.py or other
files in models, remember that files are read in alphabetical order in that
file - so for example db.py would not see utils.py if both were in the
models folder, since db.py would be parsed before utils.py - you would want
to name something like 0_utils.py to take care of that).

Another alternative is to put utilities into your modules folder (or it can
be of another application name on the same web2py instance) and import the
utilities in an appropriately early place in one of the files in your
application's models file.   Search recent posts for more details on this
(eg. __init__.py file, format of the import).

On Tue, Jul 7, 2009 at 8:35 AM, Jonathan Lundell <jlund...@pobox.com> wrote:

>
> On Jul 6, 2009, at 8:55 PM, mdipierro wrote:
>
> > You can already define something like:
> >
> > def url(f,args=request.args): return URL(r=request,f=f,args=args)
> >
> > I always do it together with some of my other favorite shortcuts.
>
> Where does one put something like that, in order to be visible
> throughout an application?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to