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
ce63a28b
Commit
ce63a28b
authored
Oct 19, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a ZClass registry, initially for use with SQL methods.
.
parent
c221df67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
lib/python/ZClasses/ZClass.py
lib/python/ZClasses/ZClass.py
+20
-4
No files found.
lib/python/ZClasses/ZClass.py
View file @
ce63a28b
...
@@ -355,8 +355,8 @@ class ZClass(OFS.SimpleItem.SimpleItem):
...
@@ -355,8 +355,8 @@ class ZClass(OFS.SimpleItem.SimpleItem):
def
_register
(
self
):
def
_register
(
self
):
if
not
dbVersionEquals
(
'3'
):
return
# Register the global id of the managed class:
z
=
self
.
_zclass_
z
=
self
.
_zclass_
class_id
=
z
.
__module__
class_id
=
z
.
__module__
if
not
class_id
:
return
if
not
class_id
:
return
...
@@ -368,15 +368,31 @@ class ZClass(OFS.SimpleItem.SimpleItem):
...
@@ -368,15 +368,31 @@ class ZClass(OFS.SimpleItem.SimpleItem):
globals
[
class_id
]
=
z
globals
[
class_id
]
=
z
# Register self as a ZClass:
self
.
aq_acquire
(
'_manage_add_product_data'
)(
'zclasses'
,
product
=
self
.
aq_inner
.
aq_parent
.
id
,
id
=
self
.
id
,
meta_type
=
z
.
meta_type
or
''
,
meta_class
=
self
,
)
def
_unregister
(
self
):
def
_unregister
(
self
):
if
not
dbVersionEquals
(
'3'
):
return
# Unregister the global id of the managed class:
class_id
=
self
.
_zclass_
.
__module__
class_id
=
self
.
_zclass_
.
__module__
if
not
class_id
:
return
if
not
class_id
:
return
globals
=
self
.
_p_jar
.
root
()[
'ZGlobals'
]
globals
=
self
.
_p_jar
.
root
()[
'ZGlobals'
]
if
globals
.
has_key
(
class_id
):
if
globals
.
has_key
(
class_id
):
del
globals
[
class_id
]
del
globals
[
class_id
]
# Unregister self as a ZClass:
self
.
aq_acquire
(
'_manage_remove_product_data'
)(
'zclasses'
,
product
=
self
.
aq_inner
.
aq_parent
.
id
,
id
=
self
.
id
,
)
def
manage_afterClone
(
self
,
item
):
def
manage_afterClone
(
self
,
item
):
self
.
setClassAttr
(
'__module__'
,
None
)
self
.
setClassAttr
(
'__module__'
,
None
)
self
.
propertysheets
.
methods
.
manage_afterClone
(
item
)
self
.
propertysheets
.
methods
.
manage_afterClone
(
item
)
...
...
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