Re: When does controllers/template/view get called?

2007-01-26 Thread Max Ischenko

Hi,

On Jan 26, 6:02 am, Skip Montanaro [EMAIL PROTECTED] wrote:
 I modified controllers/template/view to

 def view(self, url):
 raise TypeError, url
 print  sys.stderr, url
 return render_response(/%s.myt % url)

 If I visit (for example)http://localhost:5001/nonexistentI don't see
 anything like a TypeError.  Instead, I get this traceback:

Works just fine here. May be it's the version of Python interpreter
(2.6)? What if you remove raise statement?

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: When does controllers/template/view get called?

2007-01-26 Thread Skip Montanaro

 Works just fine here. May be it's the version of
 Python interpreter (2.6)? What if you remove
 raise statement?

The raise statement was only my last attempt to get something to work.
Note also the print and the unprotected call to render_response().  If
I define view() as suggested in its docstring:

def view(self, url):
try:
return render_response('/'+url)
except myghty.exception.ComponentNotFound:
return Response(code=404)

I get the same result.

In case it's a routing issue here's my config/routing.make_map sans
comments:

def make_map(global_conf={}, app_conf={}):
root_path =
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

mapper = Mapper(directory=os.path.join(root_path, 'controllers'))

mapper.connect('error/:action/:id', controller='error')
mapper.connect('', controller='hello', action='index')
mapper.connect(':controller/:action/:id')
mapper.connect('*url', controller='template', action='view')

return mapper

Skip


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