Re: __class__ Attribut einer Instanz änd ern

Andreas Jung <[email protected]>
Newsgroups gmane.comp.web.zope.german
Organization ZOPYX Ltd & Co. KG
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


http://pypi.python.org/pypi/Products.contentmigration/2.0a3

- -aj
Nico Grubert wrote:
> Hallo zusammen
> 
> Ich habe einige Content-Objekte, die mit Plone2 und Archetypes erstellt
> wurden. Nun habe ich ein Plone 3 Produkt geschrieben, das im Prinzip
> fast identisch zum alten Produkt ist.
> 
> Angenommen, 'self' wäre eine Instanz eines alten Content Objekts.
> Dann erhalte ich mit self.__class__ folgendes:
> <class 'Products.MyOldProduct.MyOldContentObject.MyOldContentObject'>
> 
> Erstelle ich eine Instanz mit dem neuen Produkt, erhalte ich mit
> self.__class__ für die neue Instanz folgendes:
> <class 'my.package.content.MyNewContentObject.MyNewContentObject'>
> 
> Besteht die Möglichkeit, dass ich den alten Instanzen irgendwie das neue
> Produkt unterschieben kann, so dass das __class__ Attribut auf das neue
> Produkt angepasst wird?
> 
> Falls das nicht geht, müsste würde ich ein Migrations-Skript schreiben
> müssen, das die Daten aller alten Content-Objekte ausliest und damit
> neue Content-Objekte erstellt, die Instanzen des neuen Produkts sind.
> 
> 
> Gruss
> Nico
> 
> 
> _______________________________________________
> zope mailing list
> [email protected]
> https://mail.dzug.org/mailman/listinfo/zope


- -- 
ZOPYX Limited           | zopyx group
Charlottenstr. 37/1     | The full-service network for Zope & Plone
D-72070 Tübingen        | Produce & Publish
www.zopyx.com           | www.produce-and-publish.com
- ------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvFcRkACgkQCJIWIbr9KYw56ACfSCljAdScp1bpOXG4+bKyEwVn
2ucAoLtBP3Z3ydF7+/izgfSCYN1hpjdt
=Z6wo
-----END PGP SIGNATURE-----



_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lists.vcf (text/x-vcard, 316 B)
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[email protected]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.