[Zope] Refreshing products

Peter Bengtsson mail@peterbe.com
Wed, 09 Oct 2002 15:37:03 +0100


--=======C80699B=======
Content-Type: text/plain; x-avg-checked=avg-ok-5D9B2CD4; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit


>
>
>On Wed, 2002-10-09 at 01:47, Peter Bengtsson wrote:
> > Yes, also be careful with your base classes. You need to inherit the
> > Persistance class which is included in OFS.Folder and ObjectManager and
> > SimpleItem.
>
>My product class is inherited from SimpleItem, and so from Persistent.
>But do you mean also that internal fields should also inherit from
>Persistent instead of being simple classes ??

That should be enough. As long as you inherit from SimpleItem you shouldn't 
have to do something else.

>I've found also (after sending my mail :-(( ) that it's also possible to
>use the "self._p_changed = 1" instruction to store these kinds of
>properties. What's the best way to use ??

That shouldn't be necessary. As long as you use the Persistance class and 
save properties as instructed in a previous email you should be fine.

Won't work:

def addName(self,name):
     self.names.append(name)


Will work:

def addName(self,name):
     all_names = self.names
     all_names.append(name)
     self.names = all_names


>Thanks,
>
>   Thierry
>
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.391 / Virus Database: 222 - Release Date: 2002-09-19

--=======C80699B=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-5D9B2CD4
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 2002-09-19

--=======C80699B=======--