Re: Delete dex class
Mike Metcalfe <mike-Aj4agZGutx/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.user |
|---|---|
| Message-ID | <CAF8+HLFAa=qN0iU233HTL2umrxKrKccMmrDL0uZn+B9Wa6g3VQ@mail.gmail.com> |
Sorry to have you guessing. I have an upgrade step that finds and deletes
all instances of a class and now I'd like to delete the class itself. Is
this the correct way:
ttool = getToolByName(portal, 'portal_types')
ttool.manage_delObjects([id])
On 18 January 2015 at 16:31, Alex Clark <[email protected]> wrote:
> On 1/15/15 6:54 AM, Luca Fabbri wrote:
> >
> >
> > On Thu, Jan 15, 2015 at 9:13 AM, Mike Metcalfe
> > <mike-Aj4agZGutx/[email protected]
> > <mailto:mike-Aj4agZGutx/[email protected]>> wrote:
> >
> > Hi,
> >
> > Can anyone tell me how to delete an obsolete class in an upgrade
> step?
>
> I'm going to guess he means instances of a class which has been removed.
> And I'm also going to guess the answer is something like [1]:
>
> - Include code somewhere to alias modules for obsolete classes e.g.
> my.old.class = my.new.class
>
> - Create new instances e.g. for i in my.old.class.instances(): j =
> my.new.class.instance(); [j.field = i.field for i.fields in i]
>
> Otherwise you have broken objects in the ZODB which can't be as easily
> handled.
>
> [1] Disclaimer: It's been a while, so I could be wrong.
>
> >
> >
> > What you mean with "delete a class" ?
> >
> >
> >
> >
> >
> > --
> > Mike Metcalfe
> >
> > 082 903 8268
> > mike-Aj4agZGutx/[email protected] <mailto:mike-Aj4agZGutx/[email protected]>
> > www.webtide.co.za <http://www.webtide.co.za/>
> >
> >
> >
> ------------------------------------------------------------------------------
> > New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> > GigeNET is offering a free month of service with a new server in
> > Ashburn.
> > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > Higher redundancy.Lower latency.Increased capacity.Completely
> compliant.
> > http://p.sf.net/sfu/gigenet
> > _______________________________________________
> > Plone-Users mailing list
> > [email protected]
> > <mailto:[email protected]>
> > https://lists.sourceforge.net/lists/listinfo/plone-users
> >
> >
> >
> >
> > --
> > -- luca
> >
> > twitter: http://twitter.com/keul
> > linkedin: http://linkedin.com/in/lucafbb
> > blog: http://blog.keul.it/
> >
> >
> >
> ------------------------------------------------------------------------------
> > New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> > GigeNET is offering a free month of service with a new server in Ashburn.
> > Choose from 2 high performing configs, both with 100TB of bandwidth.
> > Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> > http://p.sf.net/sfu/gigenet
> >
> >
> >
> > _______________________________________________
> > Plone-Users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/plone-users
> >
>
>
> --
> Alex Clark · http://about.me/alex.clark
>
>
>
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> Plone-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/plone-users
>
--
Mike Metcalfe
082 903 8268
mike-Aj4agZGutx/[email protected]
www.webtide.co.za
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Plone-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plone-users