Commit bcd22bf2 authored by Nicolas Wavrant's avatar Nicolas Wavrant

WIP

parent 7233208a
...@@ -624,6 +624,18 @@ class CategoryTool(BaseTool): ...@@ -624,6 +624,18 @@ class CategoryTool(BaseTool):
to filter the object on to filter the object on
""" """
"""
self = <erp5.portal_type.Category Tool object at 0x7f19b1b14758 oid 0xd7 in <Connection at 7f19b6084f10>>
context = <erp5.portal_type.Person object at 0x7f19b0065f50>
base_category_list = subordination
category_list = <erp5.portal_type.Organisation object at 0x7f19ab059d70>
base = 0
keep_default = 0
spec = ()
filter = None
checked_permission = None
kw = {'portal_type': ()}
"""
# LOG("CategoryTool, setCategoryMembership", 0 , # LOG("CategoryTool, setCategoryMembership", 0 ,
# 'category_list: %s' % str(category_list)) # 'category_list: %s' % str(category_list))
# XXX We must use filters in the future # XXX We must use filters in the future
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
############################################################################## ##############################################################################
from Base import Setter from Base import Setter
from zLOG import LOG
# Creation of default constructor # Creation of default constructor
class func_code: pass class func_code: pass
...@@ -53,6 +54,8 @@ class Reindex(Setter): ...@@ -53,6 +54,8 @@ class Reindex(Setter):
self._accessor_id = accessor_id self._accessor_id = accessor_id
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
LOG("NICOLAS-Alias", 0, instance, args, kw)
instance.log('NICOLAS log: %s %s %s %s' % (self, instance, args, kw))
method = getattr(instance, self._accessor_id) method = getattr(instance, self._accessor_id)
modified_object_list = method(*args, **kw) modified_object_list = method(*args, **kw)
# private methods can return a list of modified objects that this # private methods can return a list of modified objects that this
......
...@@ -48,6 +48,8 @@ class SetSetter(BaseSetter): ...@@ -48,6 +48,8 @@ class SetSetter(BaseSetter):
self._warning = warning self._warning = warning
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
if instance.getTitle() == 'NW':
import pdb;pdb.set_trace()
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Setter Id:",0, self._id) LOG("ERP5Type Deprecated Setter Id:",0, self._id)
instance._setValue(self._key, set(args[0]), instance._setValue(self._key, set(args[0]),
...@@ -67,6 +69,8 @@ class ListSetter(SetSetter): ...@@ -67,6 +69,8 @@ class ListSetter(SetSetter):
_need__name__=1 _need__name__=1
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
#if Base not in value.__class__.__mro__:
# raise TypeError('Value setter only takes ERP5 objects as parameters')
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Setter Id:",0, self._id) LOG("ERP5Type Deprecated Setter Id:",0, self._id)
instance._setValue(self._key, args[0], instance._setValue(self._key, args[0],
...@@ -88,6 +92,7 @@ class DefaultSetter(SetSetter): ...@@ -88,6 +92,7 @@ class DefaultSetter(SetSetter):
_need__name__=1 _need__name__=1
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
LOG("NICOLAS", 0, instance, *args, **kw)
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Setter Id:",0, self._id) LOG("ERP5Type Deprecated Setter Id:",0, self._id)
instance._setDefaultValue(self._key, args[0], instance._setDefaultValue(self._key, args[0],
...@@ -228,6 +233,7 @@ class UidSetSetter(BaseSetter): ...@@ -228,6 +233,7 @@ class UidSetSetter(BaseSetter):
self._warning = warning self._warning = warning
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
LOG("NICOLAS", 0, instance, *args, **kw)
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
instance._setValueUidList(self._key, set(args[0]), instance._setValueUidList(self._key, set(args[0]),
...@@ -244,6 +250,7 @@ class UidListSetter(UidSetSetter): ...@@ -244,6 +250,7 @@ class UidListSetter(UidSetSetter):
_need__name__=1 _need__name__=1
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
LOG("NICOLAS", 0, instance, *args, **kw)
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
instance._setValueUidList(self._key, args[0], instance._setValueUidList(self._key, args[0],
...@@ -263,6 +270,7 @@ class UidDefaultSetter(UidSetSetter): ...@@ -263,6 +270,7 @@ class UidDefaultSetter(UidSetSetter):
_need__name__=1 _need__name__=1
def __call__(self, instance, *args, **kw): def __call__(self, instance, *args, **kw):
LOG("NICOLAS", 0, instance, *args, **kw)
if self._warning: if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id) LOG("ERP5Type Deprecated Getter Id:",0, self._id)
instance._setDefaultValueUid(self._key, args[0], instance._setDefaultValueUid(self._key, args[0],
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
from struct import unpack from struct import unpack
from copy import copy from copy import copy
import inspect
import warnings import warnings
import types import types
import thread, threading import thread, threading
...@@ -1833,6 +1834,8 @@ class Base( CopyContainer, ...@@ -1833,6 +1834,8 @@ class Base( CopyContainer,
# categories # categories
def _setValue(self, id, target, spec=(), filter=None, portal_type=(), keep_default=1, def _setValue(self, id, target, spec=(), filter=None, portal_type=(), keep_default=1,
checked_permission=None): checked_permission=None):
from zLOG import LOG
LOG("NICOLAS-Base_setValue", 0, id, target)
getRelativeUrl = self.getPortalObject().portal_url.getRelativeUrl getRelativeUrl = self.getPortalObject().portal_url.getRelativeUrl
def cleanupCategory(path): def cleanupCategory(path):
...@@ -2119,6 +2122,7 @@ class Base( CopyContainer, ...@@ -2119,6 +2122,7 @@ class Base( CopyContainer,
# Private accessors for the implementation of categories # Private accessors for the implementation of categories
def _setCategoryMembership(self, *args, **kw): def _setCategoryMembership(self, *args, **kw):
self.log('NICOLAS_setCategoryMembership')
self._getCategoryTool()._setCategoryMembership(self, *args, **kw) self._getCategoryTool()._setCategoryMembership(self, *args, **kw)
#self.activate().edit() # Do nothing except call workflow method #self.activate().edit() # Do nothing except call workflow method
# XXX This is a problem - it is used to circumvent a lack of edit # XXX This is a problem - it is used to circumvent a lack of edit
......
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