[ZODB-Dev] zodb questions

Dieter Maurer dieter at handshake.de
Sun Jul 25 18:09:44 EDT 2004


Guy Robinson wrote at 2004-7-25 00:11 +1200:
>....
>1.. Can the security classes from zope be used without the full zope install? As 
>the applications are built on top of twisted should I just use there security model?

Almost surely...
However, it may take a bit of time to figure out what
packages beside "AccessControl" need to be included...

>2.. If I want a last-modified attribute for my application classes do I need to 
>implement this or can I get this attribute from zodb? If zodb does store this 
>attr how do I access it?

Look at what "Zope" calls "bobobase_modification_time" (what a horrible
name). Its in effect a "DateTime" representation of "_p_serial".

Note, however, that this is the timestamp (used as transaction id)
when the object was last changed in ZODB terms.
When you copy or import an object, it gets changed in ZODB terms.
This may not be what you want...

It is probably better to use you own modification time attribute...
This way, you have much more control when you want to change it
(or leave it alone).

>2.. Is there any guide lines or examples on how best to reference 
>files/documents in a zodb?

The ZODB allows you to store the same object in different places.
However, I would not recommend it: it will probably be restricted in
Zope 3 and in Zope 2 the objects appears to be in different places
(the same object has different URLs, physical paths, ...).

Usually, references are a path to the object.

AT (and soon CMF) uses unique references to identify objects
and a catalog search to locate the object.


-- 
Dieter


More information about the ZODB-Dev mailing list