Hi group,
I've just installed pylons yesterday, so I apologize if the question
I'm asking is too trivial.
Here it is: I tried to redefine TemplateController as suggested in
it's documentation string:
from ljeye.lib.base import *
import myghty.exception
class TemplateController(BaseController):
def view(self, url):
try:
return render_response('/'+url)
except myghty.exception.ComponentNotFound:
return Response(code=404)
I also placed file called 'help.myt' under /templates.
Now, when I'm trying to access localhost:5000/help.myt, I'm getting
the following error:
Error(AttributeError): 'unicode' object has no attribute
'is_file_component'
The reason for this error lies in the way Myghty handles unicode
components:
Error:
Error(AttributeError): 'unicode' object has no attribute
'is_file_component'
File:
/usr/lib/python2.5/site-packages/Myghty-1.1-py2.5.egg/myghty/
request.py line 227
Context:
224: try:
225: if type(component) == types.StringType:
226: component =
self.fetch_lead_component(component)
227: elif component.is_file_component():
228: self.request_path = component.path
229:
230: self.request_component = component
For some reason, component in my case is u'help.myt', and hence the
type(component)==types.StringType comparison failes.
Note that I'm using freshly downloaded 0.9.5 Pylons, python2.5 etc.,
and I'm just playing with freshly created pylons project.
I would appreciate if you could clarify that for me.
Best Regards,
Victor.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---