Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
b9bed178
Commit
b9bed178
authored
Sep 18, 1997
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deletable object filters added
parent
1cbeef98
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
33 deletions
+52
-33
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+44
-25
lib/python/OFS/main.dtml
lib/python/OFS/main.dtml
+4
-4
lib/python/OFS/properties.dtml
lib/python/OFS/properties.dtml
+4
-4
No files found.
lib/python/OFS/ObjectManager.py
View file @
b9bed178
__doc__
=
"""Object Manager
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.
9 1997/09/18 20:03:37
brian Exp $"""
$Id: ObjectManager.py,v 1.
10 1997/09/18 22:48:45
brian Exp $"""
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
10
$'
[
11
:
-
2
]
from
SingleThreadedTransaction
import
Persistent
from
SingleThreadedTransaction
import
Persistent
...
@@ -82,8 +82,6 @@ class ObjectManager(Acquirer,Management,Persistent):
...
@@ -82,8 +82,6 @@ class ObjectManager(Acquirer,Management,Persistent):
return
(
self
.
aq_parent
,)
return
(
self
.
aq_parent
,)
except
:
pass
except
:
pass
return
()
return
()
#try: return (self.aq_parent,)
#except: return ()
def
_setObject
(
self
,
id
,
object
):
def
_setObject
(
self
,
id
,
object
):
self
.
_checkId
(
id
)
self
.
_checkId
(
id
)
...
@@ -94,8 +92,8 @@ class ObjectManager(Acquirer,Management,Persistent):
...
@@ -94,8 +92,8 @@ class ObjectManager(Acquirer,Management,Persistent):
def
_delObject
(
self
,
id
):
def
_delObject
(
self
,
id
):
delattr
(
self
,
id
)
delattr
(
self
,
id
)
self
.
_objects
=
tuple
(
filter
(
lambda
i
,
n
=
id
:
i
[
'id'
]
!=
n
,
self
.
_objects
=
tuple
(
filter
(
lambda
i
,
n
=
id
:
i
[
'id'
]
!=
n
,
self
.
_objects
))
self
.
_objects
))
def
objectIds
(
self
,
t
=
None
):
def
objectIds
(
self
,
t
=
None
):
# Return a list of subobject ids
# Return a list of subobject ids
if
t
is
not
None
:
if
t
is
not
None
:
...
@@ -124,7 +122,34 @@ class ObjectManager(Acquirer,Management,Persistent):
...
@@ -124,7 +122,34 @@ class ObjectManager(Acquirer,Management,Persistent):
self
.
_objects
))
self
.
_objects
))
return
map
(
lambda
i
,
s
=
self
:
(
i
[
'id'
],
getattr
(
s
,
i
[
'id'
])),
return
map
(
lambda
i
,
s
=
self
:
(
i
[
'id'
],
getattr
(
s
,
i
[
'id'
])),
self
.
_objects
)
self
.
_objects
)
def
objectMap
(
self
):
# Return a tuple of mappings containing subobject meta-data
return
self
.
_objects
def
objectIds_d
(
self
,
t
=
None
):
v
=
self
.
objectIds
(
t
)
try
:
n
=
self
.
_reserved_names
except
:
return
v
return
filter
(
lambda
x
,
r
=
n
:
x
not
in
r
,
v
)
def
objectValues_d
(
self
,
t
=
None
):
v
=
self
.
objectIds
(
t
)
try
:
n
=
self
.
_reserved_names
except
:
return
map
(
lambda
i
,
s
=
self
:
getattr
(
s
,
i
),
v
)
return
map
(
lambda
i
,
s
=
self
:
getattr
(
s
,
i
),
filter
(
lambda
x
,
r
=
n
:
x
not
in
r
,
v
))
def
objectItems_d
(
self
,
t
=
None
):
v
=
self
.
objectItems
(
t
)
try
:
n
=
self
.
_reserved_names
except
:
return
v
return
filter
(
lambda
x
,
r
=
n
:
x
[
0
]
not
in
r
,
v
)
def
objectMap_d
(
self
,
t
=
None
):
v
=
self
.
_objects
try
:
n
=
self
.
_reserved_names
except
:
return
v
return
filter
(
lambda
x
,
r
=
n
:
x
[
'id'
]
not
in
r
,
v
)
def
superIds
(
self
,
t
):
def
superIds
(
self
,
t
):
if
type
(
t
)
==
type
(
's'
):
t
=
(
t
,)
if
type
(
t
)
==
type
(
's'
):
t
=
(
t
,)
...
@@ -212,21 +237,6 @@ class ObjectManager(Acquirer,Management,Persistent):
...
@@ -212,21 +237,6 @@ class ObjectManager(Acquirer,Management,Persistent):
x
=
x
+
1
x
=
x
+
1
return
vals
return
vals
def
objectMap
(
self
):
# Return a tuple of mappings containing subobject meta-data
return
self
.
_objects
def
manage_addObject
(
self
,
type
,
REQUEST
):
def
manage_addObject
(
self
,
type
,
REQUEST
):
"""Add a subordinate object"""
"""Add a subordinate object"""
for
t
in
self
.
meta_types
:
for
t
in
self
.
meta_types
:
...
@@ -239,8 +249,8 @@ class ObjectManager(Acquirer,Management,Persistent):
...
@@ -239,8 +249,8 @@ class ObjectManager(Acquirer,Management,Persistent):
def
manage_delObjects
(
self
,
ids
,
REQUEST
):
def
manage_delObjects
(
self
,
ids
,
REQUEST
):
"""Delete a subordinate object"""
"""Delete a subordinate object"""
try
:
p
=
map
(
lambda
d
:
d
[
'id'
],
self
.
__class__
.
_objects
)
try
:
p
=
self
.
_reserved_names
except
:
p
=
[]
except
:
p
=
()
for
n
in
ids
:
for
n
in
ids
:
if
n
in
p
:
if
n
in
p
:
return
MessageDialog
(
title
=
'Not Deletable'
%
n
,
return
MessageDialog
(
title
=
'Not Deletable'
%
n
,
...
@@ -277,6 +287,12 @@ class ObjectManager(Acquirer,Management,Persistent):
...
@@ -277,6 +287,12 @@ class ObjectManager(Acquirer,Management,Persistent):
# Return a tuple of mappings, giving meta-data for properties
# Return a tuple of mappings, giving meta-data for properties
return
self
.
_properties
return
self
.
_properties
def
propertyMap_d
(
self
):
v
=
self
.
_properties
try
:
n
=
self
.
_reserved_names
except
:
return
v
return
filter
(
lambda
x
,
r
=
n
:
x
[
'id'
]
not
in
r
,
v
)
def
manage_addProperty
(
self
,
id
,
value
,
type
,
REQUEST
):
def
manage_addProperty
(
self
,
id
,
value
,
type
,
REQUEST
):
"""Add a new property (www)"""
"""Add a new property (www)"""
self
.
_setProperty
(
id
,
value
,
type
)
self
.
_setProperty
(
id
,
value
,
type
)
...
@@ -292,8 +308,8 @@ class ObjectManager(Acquirer,Management,Persistent):
...
@@ -292,8 +308,8 @@ class ObjectManager(Acquirer,Management,Persistent):
def
manage_delProperties
(
self
,
ids
,
REQUEST
):
def
manage_delProperties
(
self
,
ids
,
REQUEST
):
"""Delete one or more properties"""
"""Delete one or more properties"""
try
:
p
=
map
(
lambda
d
:
d
[
'id'
],
self
.
__class__
.
_properties
)
try
:
p
=
self
.
_reserved_names
except
:
p
=
[]
except
:
p
=
()
for
n
in
ids
:
for
n
in
ids
:
if
n
in
p
:
if
n
in
p
:
return
MessageDialog
(
return
MessageDialog
(
...
@@ -375,6 +391,9 @@ class ObjectManager(Acquirer,Management,Persistent):
...
@@ -375,6 +391,9 @@ class ObjectManager(Acquirer,Management,Persistent):
##############################################################################
##############################################################################
#
#
# $Log: ObjectManager.py,v $
# $Log: ObjectManager.py,v $
# Revision 1.10 1997/09/18 22:48:45 brian
# Deletable object filters added
#
# Revision 1.9 1997/09/18 20:03:37 brian
# Revision 1.9 1997/09/18 20:03:37 brian
# Added superX type sniffer
# Added superX type sniffer
#
#
...
...
lib/python/OFS/main.dtml
View file @
b9bed178
...
@@ -46,7 +46,7 @@ To add a new item, select an item type and click "Add".
...
@@ -46,7 +46,7 @@ To add a new item, select an item type and click "Add".
</FORM>
</FORM>
</TD>
</TD>
</TR>
</TR>
<!--#if objectValues-->
<!--#if objectValues
_d
-->
<TR>
<TR>
<TD VALIGN="TOP">
<TD VALIGN="TOP">
To delete items, select one or more items and click "Delete".
To delete items, select one or more items and click "Delete".
...
@@ -54,15 +54,15 @@ To delete items, select one or more items and click "Delete".
...
@@ -54,15 +54,15 @@ To delete items, select one or more items and click "Delete".
<TD VALIGN="TOP">
<TD VALIGN="TOP">
<FORM ACTION="<!--#var PARENT_URL-->/manage_delObjects" METHOD="GET">
<FORM ACTION="<!--#var PARENT_URL-->/manage_delObjects" METHOD="GET">
<SELECT NAME="ids:list" MULTIPLE SIZE="4">
<SELECT NAME="ids:list" MULTIPLE SIZE="4">
<!--#in objectValues-->
<!--#in objectValues
_d
-->
<OPTION VALUE="<!--#var id-->"><!--#var title_and_id-->
<OPTION VALUE="<!--#var id-->"><!--#var title_and_id-->
<!--#/in objectValues-->
<!--#/in objectValues
_d
-->
</SELECT><BR>
</SELECT><BR>
<INPUT TYPE="SUBMIT" VALUE="Delete">
<INPUT TYPE="SUBMIT" VALUE="Delete">
</FORM>
</FORM>
</TD>
</TD>
</TR>
</TR>
<!--#/if objectValues-->
<!--#/if objectValues
_d
-->
</TABLE>
</TABLE>
</BODY>
</BODY>
</HTML>
</HTML>
lib/python/OFS/properties.dtml
View file @
b9bed178
...
@@ -79,7 +79,7 @@ property below and click "Add".
...
@@ -79,7 +79,7 @@ property below and click "Add".
</TABLE>
</TABLE>
</FORM>
</FORM>
<!--#if propertyMap-->
<!--#if propertyMap
_d
-->
<P>
<P>
<FORM ACTION="<!--#var URL1-->/manage_delProperties" METHOD="POST">
<FORM ACTION="<!--#var URL1-->/manage_delProperties" METHOD="POST">
To delete properties, select one or more property ids
To delete properties, select one or more property ids
...
@@ -89,9 +89,9 @@ from the list below and click "Delete".
...
@@ -89,9 +89,9 @@ from the list below and click "Delete".
<TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT" VALIGN="TOP">
<SELECT NAME="ids:list" SIZE="5" MULTIPLE>
<SELECT NAME="ids:list" SIZE="5" MULTIPLE>
<!--#in propertyMap mapping-->
<!--#in propertyMap
_d
mapping-->
<OPTION VALUE="<!--#var id-->"><!--#var id fmt=nicify-->
<OPTION VALUE="<!--#var id-->"><!--#var id fmt=nicify-->
<!--#/in propertyMap-->
<!--#/in propertyMap
_d
-->
</SELECT>
</SELECT>
<BR>
<BR>
<INPUT TYPE="SUBMIT" VALUE="Delete">
<INPUT TYPE="SUBMIT" VALUE="Delete">
...
@@ -99,7 +99,7 @@ from the list below and click "Delete".
...
@@ -99,7 +99,7 @@ from the list below and click "Delete".
</TR>
</TR>
</TABLE>
</TABLE>
</FORM>
</FORM>
<!--#/if propertyMap-->
<!--#/if propertyMap
_d
-->
</BODY>
</BODY>
</HTML>
</HTML>
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