Re: [Zope3-Users] Vocabulary with objects and persistence problem

2009-04-16 Thread Nylan
Solved!

Thanks to Thierry Florac for pointing in the right direction:


Thierry Florac wrote:

Well, not absolutely sure but the problem may come that "source"
attribute is automatically defined as a 'simple' list (see introspector
to be sure), and not as a persistent one ; as a list is a mutable
object, changing one of it's attributes or adding/removing an item
doesn't flag the list as modified "from the persistent object point of
view", so it isn't stored into the ZODB when the transaction is
committed.

So you may have two solutions to handle this in the "removeSource"
method :

1. sources = self.source
sources.remove(source)
self.source = sources

2. self.source.remove(source)
self._p_changed = True

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Vocabulary with objects and persistence problem

2009-04-04 Thread NYLAN
I've checked everything. There are no error messages and transaction seems to 
comit fine.

Does a way exist to trace a transaction?

Best regards

 Original-Nachricht 
> Datum: Fri, 03 Apr 2009 11:14:30 -0400
> Von: "Warner, Christopher" 
> An: Nylan , Zope3-users 
> Betreff: Re: [Zope3-Users] Vocabulary with objects and persistence problem

> Are you sure the transaction commit isn't failing in some way?
> 
> -- 
> Christopher Warner
> Manager, Content Management Systems
> New York Media | 75 Varick St, 4th Fl
> New York, NY 10013
> phone: 212.508.0542
> cell: 646.334.6780
> 
> 
> 
> On 4/3/09 11:08 AM, "Nylan"  wrote:
> 
> > Hello,
> > I'm having some weird problem using objects references in a vocabulary.
> > 
> > Following situation:
> > Container A -  Objects type X
> > Container B -  objects type Y with zope.schema.Choice based on
> vocabulary of
> > objects X
> > 
> > After deleting object X1 in container A and removing
> > manually(ObjectRemovedEvent
> > iterating container B, removing reference and transaction.commit) the
> > reference
> > in object Y, X1 doesn't show up and everything looks fine.
> > 
> > After restarting zope i get a LookupError. Object Y has again a
> reference to X
> > in the list.
> > 
> > It happens only when deleting some object X referenced in Object Y.
> Changing
> > other attributes of Object Y works fine.
> > 
> > Do i miss something?
> > 
> > Best regards!
> > 
> > Nylan
> > 
> > 
> > 
> > 
> > ___
> > Zope3-users mailing list
> > Zope3-users@zope.org
> > http://mail.zope.org/mailman/listinfo/zope3-users

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss 
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Vocabulary with objects and persistence problem

2009-04-03 Thread Warner, Christopher
Are you sure the transaction commit isn't failing in some way?

-- 
Christopher Warner
Manager, Content Management Systems
New York Media | 75 Varick St, 4th Fl
New York, NY 10013
phone: 212.508.0542
cell: 646.334.6780



On 4/3/09 11:08 AM, "Nylan"  wrote:

> Hello,
> I'm having some weird problem using objects references in a vocabulary.
> 
> Following situation:
> Container A -  Objects type X
> Container B -  objects type Y with zope.schema.Choice based on vocabulary of
> objects X
> 
> After deleting object X1 in container A and removing
> manually(ObjectRemovedEvent
> iterating container B, removing reference and transaction.commit) the
> reference
> in object Y, X1 doesn't show up and everything looks fine.
> 
> After restarting zope i get a LookupError. Object Y has again a reference to X
> in the list.
> 
> It happens only when deleting some object X referenced in Object Y. Changing
> other attributes of Object Y works fine.
> 
> Do i miss something?
> 
> Best regards!
> 
> Nylan
> 
> 
> 
> 
> ___
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users