Pylons/pyramid — Issue #379: config.add_view package layer issue
Author: hqman
Created: 2011-12-20 08:50:02+00:00
State: open

hi there is a bug if configure like this

i define view in model xxx.views.userview

def people_view(request):
..................

config.add_view('xxx.views.userview.people_view',
context='meside.resources.People',
renderer="people.html")

when i run paster serve
i got error : __import__(used)
ImportError: No module named userview

so i review the code pyramid/util.py
line 129:

for n in name:
used += '.' + n
try:
found = getattr(found, n)
except AttributeError:
__import__(used)
found = getattr(found, n) # pragma: no cover

return found

it seems like pyramid only allow one layer module to find view call code