[Zope] Categorised listings/access levels

Phillip Hutchings sitharus at gmail.com
Tue Dec 21 04:24:16 EST 2004


OK, bit of an odd problem.

I'm trying to create a Zope product that will display a series of
items. The items have a title, URL and description displayed. They
will also be sorted by categories - two main categories (mine, others)
and many subcategories. An item can only have one main category and
one subcategory.

When displayed the items will be sorted main category->sub
category->title, in alphabetic order, but I might want to sort in
other ways.

So, to get to the point, I was wondering what the Zope method of
actually doing this would be. In PHP I'd create a table referencing
the main/subcategories and just use an ORDER BY. In Zope I was
thinking of using two classes - a container (subclass ObjectManager)
and an item class. The item would have all the properties and I'd sort
through those, possibly using a ZCatalog or something to index.

I was wondering if that was the 'correct' approach, and if so what
could I do to optimise searching?

Secondly, a related problem. I want one user to have read/write access
to the product, and others to have a read-only access, and anonymous
to have no access. I assume that to give the access levels I'd create
roles using SecurityManager calls in the Product class, and for the
read/write role I'd use a local role. I would also guess that I'd
assign local roles for each person with read/write access, as it would
need to be set on a per-instance basis.

I'm still making the PHP->Zope transition. Let me know if I'm
completely up the wrong tree ;)

-- 
Phillip Hutchings
http://www.sitharus.com/
sitharus at gmail.com / sitharus at sitharus.com


More information about the Zope mailing list