Re: issue on upgrading to 0.9.7

2009-02-17 Thread Max Ischenko


       import OpenSnPylons
       h = getattr(__import__( '%s.lib' % OpenSnPylons.appname , {},
 {}, ['']), 'helpers')
       model = getattr(__import__(OpenSnPylons.appname, {}, {}, ['']),
 'model')

 This works perfectly on 0.9.6 - using it on multiple production sites.

 On 0.9.7 , a paster serve command fails with this message:

     AttributeError: 'module' object has no attribute 'helpers'

 I can't figure out how/why the change happened -- or what the fix is.

 hoping someone has a suggestion.

Probably 'helpers' is not automatically imported, as it were 0.9.6
(though I don't know for sure).

Try replacing this obscure code with simple imports to see where it
fails exactly. Try to run bare 0.9.7 app that does not use your
extensions.

HTH,
Max.
--~--~-~--~~~---~--~~
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 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



issue on upgrading to 0.9.7

2009-02-09 Thread Jonathan Vanasco

this is a little complex, so bear with me...

we developed a 'framework' that runs on pylons and consolidates core
functionality for the kind of webapps we build or consult on.

something peculiar to the framework is that we need to access the
real application's model , helpers , etc from the framework classes
at times.

to handle this:

on startup we import the OpenSnPylons module and set variable
OpenSnPylons.appname

in library routines like a environment.py extension, there is code
like this:

  import OpenSnPylons
  h = getattr(__import__( '%s.lib' % OpenSnPylons.appname , {},
{}, ['']), 'helpers')
  model = getattr(__import__(OpenSnPylons.appname, {}, {}, ['']),
'model')

This works perfectly on 0.9.6 - using it on multiple production sites.

On 0.9.7 , a paster serve command fails with this message:

AttributeError: 'module' object has no attribute 'helpers'

I can't figure out how/why the change happened -- or what the fix is.

hoping someone has a suggestion.
--~--~-~--~~~---~--~~
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 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---