Commit 446511a6 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added support for keep_default.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10018 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d6a27a3c
...@@ -30,7 +30,7 @@ from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Metho ...@@ -30,7 +30,7 @@ from Base import func_code, type_definition, list_types, ATTRIBUTE_PREFIX, Metho
from zLOG import LOG from zLOG import LOG
from Products.ERP5Type.PsycoWrapper import psyco from Products.ERP5Type.PsycoWrapper import psyco
class Setter(Method): class ListSetter(Method):
""" """
Sets a category Sets a category
""" """
...@@ -53,9 +53,13 @@ class Setter(Method): ...@@ -53,9 +53,13 @@ class Setter(Method):
instance._setCategoryMembership(self._key, args[0], instance._setCategoryMembership(self._key, args[0],
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',())) portal_type=kw.get('portal_type',()),
base=kw.get('base', 0),
keep_default=0)
if self._reindex: instance.reindexObject() if self._reindex: instance.reindexObject()
Setter = ListSetter
class DefaultSetter(Method): class DefaultSetter(Method):
""" """
Sets a category Sets a category
...@@ -79,7 +83,8 @@ class DefaultSetter(Method): ...@@ -79,7 +83,8 @@ class DefaultSetter(Method):
instance._setDefaultCategoryMembership(self._key, args[0], instance._setDefaultCategoryMembership(self._key, args[0],
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',())) portal_type=kw.get('portal_type',()),
base=kw.get('base', 0))
if self._reindex: instance.reindexObject() if self._reindex: instance.reindexObject()
class SetSetter(Method): class SetSetter(Method):
...@@ -116,7 +121,9 @@ class SetSetter(Method): ...@@ -116,7 +121,9 @@ class SetSetter(Method):
instance._setCategoryMembership(self._key, new_list, instance._setCategoryMembership(self._key, new_list,
spec=kw.get('spec',()), spec=kw.get('spec',()),
filter=kw.get('filter', None), filter=kw.get('filter', None),
portal_type=kw.get('portal_type',())) portal_type=kw.get('portal_type',()),
base=kw.get('base', 0),
keep_default=1)
if self._reindex: instance.reindexObject() if self._reindex: instance.reindexObject()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment