Commit ba59a5b4 authored by Jean-Paul Smets's avatar Jean-Paul Smets

better implementation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2481 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cdd8b6fd
No related merge requests found
......@@ -282,26 +282,28 @@ class VariantMovementGroup(RootMovementGroup):
allow_class(VariantMovementGroup)
from copy import copy
class CategoryMovementGroup(RootMovementGroup):
"""
This seems to be a useless class
"""
def __init__(self,movement,**kw):
RootMovementGroup.__init__(self,movement,**kw)
self.category_list = movement.getCategoriesList()
self.category_list = list(movement.getCategoryList())
if self.category_list is None:
self.category_list = []
self.category_list.sort()
def test(self,movement):
# we must have the same number of categories
categories_identity = 0
movement_category_list = movement.getCategoriesList()
movement_category_list = list(movement.getCategoryList())
if movement_category_list is None:
movement_category_list = []
if len(self.category_list) == len(movement_category_list) :
for category in movement_category_list :
if not category in self.category_list :
break
else :
categories_identity = 1
return categories_identity
movement_category_list.sort()
if self.category_list == movement_category_list:
return 1
return 0
allow_class(CategoryMovementGroup)
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