Jonathan Vanasco wrote:
> because i won't know the name of appconfig.py
> 
> i'm creating a subclassable framework for distribution
> 
> DerivedApp/
> DerivedApp/model
> 
> BaseApp/
> BaseApp/lib/helpers
> 
> I'm trying to get the BaseApp/lib/helpers to access Globals, so that
> it can access objects in DerivedApp/model (which might have overrides)

You'll need to use a function to get the variable from g.  The only way 
to import things like that is if you use another proxy (the pylons.g and 
pylons.request objects are proxies), and that's really not worth it.

Or, you might be able to do something with subclassing, e.g., have your 
model subclass by DerivedApp.

In the case of helpers, of course, it's pretty easy: just have 
lib.helpers in DerivedApp do from baseapp.lib.helpers import *.  No need 
to get too fancy there.  That is, you might generally find things to be 
easier if you simply phrase BaseApp as a library and not anything more 
fancy.  You could make the library itself mostly a class, and have the 
class instantiated by DerivedApp with whatever customizations it needs.

-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to