Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Romain Courteaud
erp5_rtl_support
Commits
05ff36dd
Commit
05ff36dd
authored
Oct 17, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop some compatibility code for ZODB < 3.5
parent
ba690b47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
product/ERP5Type/dynamic/persistent_migration.py
product/ERP5Type/dynamic/persistent_migration.py
+2
-5
product/ERP5Type/dynamic/portal_type_class.py
product/ERP5Type/dynamic/portal_type_class.py
+1
-3
No files found.
product/ERP5Type/dynamic/persistent_migration.py
View file @
05ff36dd
...
...
@@ -77,7 +77,6 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
"""Function-like class to update obsolete references in pickle"""
def
__new__
(
cls
,
obj
,
recursive
=
False
):
assert
cls
.
get
,
"Persistent migration of pickle requires ZODB >= 3.5"
self
=
object
.
__new__
(
cls
)
obj
=
aq_base
(
obj
)
connection
=
obj
.
_p_jar
...
...
@@ -88,7 +87,7 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
oid_set
=
set
((
obj
.
_p_oid
,))
while
oid_set
:
oid
=
oid_set
.
pop
()
obj
=
self
.
get
(
oid
)
obj
=
ObjectReader
.
load_oid
(
self
,
oid
)
obj
.
_p_activate
()
klass
=
obj
.
__class__
self
.
lazy
=
None
...
...
@@ -123,8 +122,6 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
self
.
setGhostState
(
obj
,
self
.
serialize
(
obj
))
obj
.
_p_changed
=
1
get
=
getattr
(
ObjectReader
,
'load_oid'
,
None
)
def
getOid
(
self
,
obj
):
if
isinstance
(
obj
,
(
Persistent
,
type
,
wref
.
WeakRef
)):
return
getattr
(
obj
,
'_p_oid'
,
None
)
...
...
@@ -134,7 +131,7 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
if
self
.
lazy
:
return
self
.
lazy
(
oid
)
self
.
oid_set
.
add
(
oid
)
return
self
.
get
(
oid
)
return
ObjectReader
.
load_oid
(
self
,
oid
)
def
load_persistent
(
self
,
oid
,
klass
):
obj
=
ObjectReader
.
load_persistent
(
self
,
oid
,
klass
)
...
...
product/ERP5Type/dynamic/portal_type_class.py
View file @
05ff36dd
...
...
@@ -364,9 +364,7 @@ def synchronizeDynamicModules(context, force=False):
tool
.
__class__
=
getattr
(
erp5
.
portal_type
,
tool
.
portal_type
)
if
migrate
:
from
Products.ERP5Type.dynamic.persistent_migration
import
PickleUpdater
if
PickleUpdater
.
get
:
portal
.
migrateToPortalTypeClass
()
portal
.
migrateToPortalTypeClass
()
portal
.
portal_skins
.
changeSkin
(
None
)
TransactionalResource
(
tpc_finish
=
lambda
txn
:
_bootstrapped
.
add
(
portal
.
id
))
...
...
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