On Friday 08 August 2003 14:58, Max Ischenko wrote:
[...]
>
> SitePage is typically used a as site-wide page parent. You could use
> Page class from WebKit.Page module. mvc.View should work also.
>
> > Now, I can view pure '.page' pages, but the cheetah
> > references are not evaluated.
>
> How's that? If you see .page contents that means that
> TemplateViewServletFactory handler was not registered.
>
> > Is there any possibility for you, just to assemble a 'ready to go'
> > example context, that contains all needed files?
>
> __init__.py:
>
> from WebKit.Page import Page
> import mvc
>
> def contextInitialize(app, path):
> mvcfactory = mvc.TemplateViewServletFactory(app, SitePage)
> mvcfactory.adjustWebKitConfig(app.config())
> app.addServletFactory(mvcfactory)
>
>
> Hope this helps.
Sorry, not really:
If I have 'Page' as an argument in TemplateViewServletFactory above, I get the
following error message:
-------------------------------------------------------------------------------------------------------------------
...
File "/opt/projects/svn/trunk/WebwareTest/MyContext/__init__.py", line 5, in
contextInitialize
mvcfactory = mvc.TemplateViewServletFactory(app, Page)
File "/opt/projects/svn/trunk/WebwareTest/MyContext/mvc.py", line 243, in
__init__
self.ext = ['.' + viewClass.viewFileSuffix]
AttributeError: class Page has no attribute 'viewFileSuffix'
--------------------------------------------------------------------------------------------------------------------
I don't have this error message, if I use 'mvc.View', so the above is not
really a problem.I'm a pure view with implicit controller
If I point my browser to 'PureView', I get
----------------------------------------------------------------------------------------------------------------------
I'm a pure view with implicit controller
Controller is <MyContext.mvc.View instance at 0x40520bec>, request is .
----------------------------------------------------------------------------------------------------------------------
A call to 'Another' gives
----------------------------------------------------------------------------------------------------------------------
This page has not yet customized its content.
----------------------------------------------------------------------------------------------------------------------
And 'Another.page' gives
----------------------------------------------------------------------------------------------------------------------
self.writeHTML()
File "/opt/projects/svn/trunk/WebwareTest/MyContext/mvc.py", line 158, in
writeHTML
self.handleRequest()
File "/opt/projects/svn/trunk/WebwareTest/MyContext/mvc.py", line 175, in
handleRequest
self.renderView()
File "/opt/projects/svn/trunk/WebwareTest/MyContext/mvc.py", line 206, in
renderView
raise Error(e)
Error: Error in Another view: can't resolve reference records
-----------------------------------------------------------------------------------------------------------------------
So, something is missing somehow and I suspect that you did something to your
'SitePage', that plays nicely with mvc, but that nobody else knows about.
I'm using webware 0.8.1 with python 2.3 on a linux system.
Cheers
Stephan
|