At 12:57 PM 10/31/2001 -0700, Jack Moffitt wrote:
> From looking at Classes.csv, I don't see an easy way to do something
>similar, and I was wondering if there is an easy way to associate some
>class with a file object on disk, without using any database specific
>mechanism. Is there a way say the attribute type is a unique integer?
>Or a serial integer (from Postgresql)?
>
>Or is there some other way to associate a file with a class besides just
>having the full filename or a relative path?
Every MK object has a serial number that is unique within it's exact class:
objs = store.fetchObjectsOfClass('Image')
for obj in objs:
print obj.serialNumber()
These are stored in the database and are critical to MK's obj ref and list
attribute support.
If you need an identifier that is unique among all objects regardless of
class (like maybe your Image class has subclasses), you can throw in the
klass name or id.
for obj in objs:
print obj.klass().name(), obj.klass().id(), obj.serialNumber()
Sometimes I wonder why I didn't call it "serialNumber" for Klass as well
(instead of "id").
-Chuck
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss