Commit bcd22bf2 authored by Nicolas Wavrant's avatar Nicolas Wavrant

WIP

parent 7233208a
......@@ -624,6 +624,18 @@ class CategoryTool(BaseTool):
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 ,
# 'category_list: %s' % str(category_list))
# XXX We must use filters in the future
......
......@@ -27,6 +27,7 @@
##############################################################################
from Base import Setter
from zLOG import LOG
# Creation of default constructor
class func_code: pass
......@@ -53,6 +54,8 @@ class Reindex(Setter):
self._accessor_id = accessor_id
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)
modified_object_list = method(*args, **kw)
# private methods can return a list of modified objects that this
......
......@@ -48,6 +48,8 @@ class SetSetter(BaseSetter):
self._warning = warning
def __call__(self, instance, *args, **kw):
if instance.getTitle() == 'NW':
import pdb;pdb.set_trace()
if self._warning:
LOG("ERP5Type Deprecated Setter Id:",0, self._id)
instance._setValue(self._key, set(args[0]),
......@@ -67,6 +69,8 @@ class ListSetter(SetSetter):
_need__name__=1
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:
LOG("ERP5Type Deprecated Setter Id:",0, self._id)
instance._setValue(self._key, args[0],
......@@ -88,6 +92,7 @@ class DefaultSetter(SetSetter):
_need__name__=1
def __call__(self, instance, *args, **kw):
LOG("NICOLAS", 0, instance, *args, **kw)
if self._warning:
LOG("ERP5Type Deprecated Setter Id:",0, self._id)
instance._setDefaultValue(self._key, args[0],
......@@ -228,6 +233,7 @@ class UidSetSetter(BaseSetter):
self._warning = warning
def __call__(self, instance, *args, **kw):
LOG("NICOLAS", 0, instance, *args, **kw)
if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id)
instance._setValueUidList(self._key, set(args[0]),
......@@ -244,6 +250,7 @@ class UidListSetter(UidSetSetter):
_need__name__=1
def __call__(self, instance, *args, **kw):
LOG("NICOLAS", 0, instance, *args, **kw)
if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id)
instance._setValueUidList(self._key, args[0],
......@@ -263,6 +270,7 @@ class UidDefaultSetter(UidSetSetter):
_need__name__=1
def __call__(self, instance, *args, **kw):
LOG("NICOLAS", 0, instance, *args, **kw)
if self._warning:
LOG("ERP5Type Deprecated Getter Id:",0, self._id)
instance._setDefaultValueUid(self._key, args[0],
......
......@@ -29,6 +29,7 @@
from struct import unpack
from copy import copy
import inspect
import warnings
import types
import thread, threading
......@@ -1833,6 +1834,8 @@ class Base( CopyContainer,
# categories
def _setValue(self, id, target, spec=(), filter=None, portal_type=(), keep_default=1,
checked_permission=None):
from zLOG import LOG
LOG("NICOLAS-Base_setValue", 0, id, target)
getRelativeUrl = self.getPortalObject().portal_url.getRelativeUrl
def cleanupCategory(path):
......@@ -2119,6 +2122,7 @@ class Base( CopyContainer,
# Private accessors for the implementation of categories
def _setCategoryMembership(self, *args, **kw):
self.log('NICOLAS_setCategoryMembership')
self._getCategoryTool()._setCategoryMembership(self, *args, **kw)
#self.activate().edit() # Do nothing except call workflow method
# 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