[Zope3-Users] Problem viewing an object in the browser.

Roger Ineichen dev at projekt01.ch
Wed Jun 10 19:33:43 EDT 2009


Hi Jeff

> Betreff: Re: [Zope3-Users] Problem viewing an object in the browser.
> 
> Thanks,
> 
> I got it to work.  I learned a couple things:  
> 
> 1) The ZMI doesn't work for beans in Chrome...it's virtually 
> unusable, and
> 2) The object wants the default view to be named index.html, 
> which makes some sense now that I have a better understanding 
> of things.
> 
> What I _wanted_ to do was define multiple views for an 
> object.  Zope is perfectly happy to let you do that.  Then 
> you realize, how can an object have more than one default 
> view?  It's no different than Zope2 in that respect and why 
> would it be?  If I wanted an XML view for an object I made an 
> object, set the content-type and delivered the proper data, 
> if I wanted the same data returned as JSON it required a 
> different object, it's just the same here. 
> 
> So unless I am still missing something, I can move on. And 
> thanks for the help.

Zope uses different request factories for each content type.
Or at least you can use different factories one for each
request type.

Each request can have an own default skin.
This allows you to serve one single object with a
different default view per content-type based on a default skin.

See the ISkinnable concept which allows a very clean
separation for your and other similar use cases.

http://svn.zope.org/repos/main/zope.publisher/trunk/src/zope/publisher/skinn
able.py

Regards
Roger Ineichen

> Jeff. 
> 
> 
> -----Original Message-----
> From: Michael Howitz [mailto:mh at gocept.com]
> Sent: Monday, June 08, 2009 2:47 AM
> To: Jeffrey D Peterson
> Cc: zope3-users at zope.org
> Subject: Re: [Zope3-Users] Problem viewing an object in the browser.
> 
> Am 05.06.2009 um 19:38 schrieb Jeffrey D Peterson:
> [...]
> > I click on those in the ZMI or if I browse to them at:
> >
> > http://zopevm.crary.com:15080/serialnumberlog
> > http://zopevm.crary.com:15080/sernolog.json
> > http://zopevm.crary.com:15080/sernolog.xml
> >
> > I get "The page that you are trying to access is not available"
> 
> Hi,
> 
> put a Pdb into the __call__ method of your views to see 
> whether they are called and do not raise an exception. (Which 
> later on gets masked by the message you get displayed.)
> 
> 
> Mit freundlichen Grüßen
> --
> Michael Howitz · mh at gocept.com · software developer gocept 
> gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · 
> germany http://gocept.com · tel +49 345 1229889 8 · fax +49 
> 345 1229889 1 Zope and Plone consulting and development
> 
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
> 



More information about the Zope3-users mailing list