Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hugo Ricateau
erp5
Commits
c7cb5665
Commit
c7cb5665
authored
May 16, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make set setter reuse more list setter
parent
e60fe89f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
22 deletions
+2
-22
product/ERP5Type/Accessor/Category.py
product/ERP5Type/Accessor/Category.py
+2
-22
No files found.
product/ERP5Type/Accessor/Category.py
View file @
c7cb5665
...
...
@@ -88,23 +88,10 @@ class DefaultSetter(BaseSetter):
checked_permission
=
kw
.
get
(
'checked_permission'
,
None
))
return
(
instance
,
)
class
SetSetter
(
Base
Setter
):
class
SetSetter
(
List
Setter
):
"""
Sets a set of category
"""
_need__name__
=
1
# Generic Definition of Method Object
# This is required to call the method form the Web
func_code
=
func_code
()
func_code
.
co_varnames
=
(
'self'
,
'category'
)
func_code
.
co_argcount
=
2
func_defaults
=
()
def
__init__
(
self
,
id
,
key
):
self
.
_id
=
id
self
.
__name__
=
id
self
.
_key
=
key
def
__call__
(
self
,
instance
,
value
,
*
args
,
**
kw
):
"""
...
...
@@ -113,14 +100,7 @@ class SetSetter(BaseSetter):
"""
if
type
(
value
)
not
in
(
set
,
frozenset
):
value
=
frozenset
(
value
)
instance
.
_setCategoryMembership
(
self
.
_key
,
tuple
(
value
),
spec
=
kw
.
get
(
'spec'
,()),
filter
=
kw
.
get
(
'filter'
,
None
),
portal_type
=
kw
.
get
(
'portal_type'
,()),
base
=
kw
.
get
(
'base'
,
0
),
keep_default
=
1
,
checked_permission
=
kw
.
get
(
'checked_permission'
,
None
))
return
(
instance
,
)
return
ListSetter
.
__call__
(
self
,
instance
,
value
,
*
args
,
**
kw
)
class
DefaultGetter
(
BaseGetter
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment