Skip to Content.
Sympa Menu

pcplantdb - Re: [pcplantdb] ZClass

pcplantdb@lists.ibiblio.org

Subject: pcplantdb

List archive

Chronological Thread  
  • From: John Schinnerer <john@eco-living.net>
  • To: pcplantdb@lists.ibiblio.org
  • Subject: Re: [pcplantdb] ZClass
  • Date: Fri, 20 Aug 2004 23:26:51 +0000

Aloha,

Forget ZClasses. They are not very useful in the long run. Might be good for some quick prototyping of simpler stuff but that's about all. You've already bumped into some of their limitations.

Zope products are where it's all at. ZClasses were created to provide a TTW way to whip out simple products, but they won't take you too far and are difficult to impossible to modify once created (unless you already know enough about the guts of it all to just write a product instead...!)

One way to start with Zope products - get mxmEasyProduct on the zope site

http://zope.org/Members/maxm/files/mxm.zip

and play with that. It provides a basic Object product class and a basic ObjectManager (e.g. folderish - can contain other objects) product class that you can simply subclass to get started on more complex products.

Main failing of mxmEasyProduct is that it only imports DTML support - don't bother with DTML either, it's just another HTML-munge. Go straight to ZPT (Zope Page Templates). To use them in products you create based on mxm, you need to do this in your imports:

from Products.PageTemplates.PageTemplateFile import PageTemplateFile

and then for example use this:

index_html = PageTemplateFile('www/index_html', globals())

...where index_html is a page template object in the www subfolder of your product folder

instead of this:

index_html = HTMLFile('www/index_html', globals())

...where index_html is a DTML document object in the www subfolder of your product folder

There are a couple of basic zope product tutorials available also, including a Hello World example - don't have links handy, just check zope.org...


Richard Morris wrote:
Zope Wizzards
Trying to implement my Hello World example using ZClasses

what I'd like is is two classes

class BotName
string Latin
string Author

class HGPlant
BotName acceptedName
BotName[] synonyms

the bit I'm stuck on is how you can do a list of non primative objects.

Feeling at the moment is that for the plant DB side
the zope object model model might be a bit week,
it focussed around objects with simple properties
rather than more java like objects.

There also seems to be a strong tree structure to the object nameing
i.e. objects are located by position in a folder structure (i.e. a tree). For relationships we need a more general graph structure.

How would we represent the fact that carrots and tomatoes are compaion plants. Do we have

root/plants/tomato/relationships/carrot
root/plants/carrot/relationships/tomato

root/relationships/carrot_tomato

This is not making sense is it! Basically its a question
of expressiveness. Given the fairly complex data model for a plant with potentially lots of complex inderdependancies how do we model this in Zope.

Oh an a minor qibble it does not seem posible through the Zope front end to add a new base class to a Zclass, you can create them on first creation but you can't seem to add them later.

Still don't know enough about zope to really grok how to
implement the db (and it seems like you need to know all of zope
to do that)

Forgive rambeling!

Rich

--
Plants for a Future: 7000 useful plants
Web: http://www.pfaf.org/ same as http://www.comp.leeds.ac.uk/pfaf/
Post: 1 Lerryn View, Lerryn, Lostwithiel, Cornwall, PL22 0QJ
Tel: 01208 872 963 / 0845 458 4719 Email: webmaster@pfaf.org
PFAF electronic mailing list http://groups.yahoo.com/group/pfaf


_______________________________________________
pcplantdb mailing list
pcplantdb@lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/pcplantdb


--

John Schinnerer - MA, Whole Systems Design
------------------------------------------
- Eco-Living -
Whole Systems Design Services
People - Place - Learning - Integration
john@eco-living.net
http://eco-living.net




Archive powered by MHonArc 2.6.24.

Top of Page