[Zope-CMF] Is there a way to change the meta-type of a number of object types

seb bacon seb@jamkit.com
Sun, 29 Jul 2001 12:22:40 +0100


Because all your Documents are instances of a Document class, if your
Order class is different, you'll have to write a script to generate
new objects using the old data.  Something like

 for item in YourDocumentList:
   context.invokeFactory("Card", item.getId())
   context[item.getId()].edit(item.some_property, item.some_other_property)

That's a bit wrong, because you'll also want to get the correct folder
for the object rather than the current context, which you can get
using the getpath Catalog method...  

However, I'm not sure what you mean by 'Subject topics'.  If you've
just changed the metadata, but the actual instance is identical, you
can probably get away with changing the Type / meta_types of your
Document instances.  Not advisable though, if you subsequently change
the Card class.

Hopefully that points you in the right direction...

seb

* Norman Khine <khine@btinternet.com> [010729 11:13]:
> Hi,
> I have over 300 Documents that are a document type, I have now created a new
> type called Card which is based on the Document type, but this type only has
> a number of Subject topics taken from the original Document type.
> 
> So now I want to take all Documents with the specific topics and make them
> the new Card type.
> 
> I can create a Topic query which can list these items, but I don't think it
> is possible to change them, or is it?
> 
> Where in the system, does an object stores these detail and can it be
> changed?
> 
> Many thanks
> 
> Norman
> 
> zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
> zz/********/z/****\zzz|****\*\zz|*******|z
> z/^^^^^^^^/z/******\zz|*^^^^|*|z|*|^^^^^|z norman khine
> zzzzzz/**/z|**/^^\**|z|*|zzz|*|z|*|zzzzzzz mailto:norman@khine.net
> zzzzz/**/zz|*|zzzz|*|z|****/*/zz|*****|zzz purley
> z/******/zz|*|zzzz|*|z|*|^^zzzzz|*|^^^|zzz UK
> zzZ/**/zzzz|**\^^/**|z|*|zzzzzzz|*|zzzzzzz
> zz/******/zz\******/zz|*|zzzzzzz|*|*****|z
> z/^^^^^^/zzzz\^^^^/zzz|^|zzzzzzz|^^^^^^^|z
> zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
> 
> 
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
> 
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature requests

-- 

   [] j a m k i t 
           
        seb bacon
T:  020 7749 7218
F:  020 7739 8683
M:  07968 301 336
W: www.jamkit.com