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
Carlos Ramos Carreño
erp5
Commits
66f6fead
Commit
66f6fead
authored
Mar 29, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PersistentBroken py3
parent
3a9dc261
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
product/ERP5Type/dynamic/lazy_class.py
product/ERP5Type/dynamic/lazy_class.py
+16
-18
No files found.
product/ERP5Type/dynamic/lazy_class.py
View file @
66f6fead
...
@@ -22,25 +22,13 @@ from . import persistent_migration
...
@@ -22,25 +22,13 @@ from . import persistent_migration
from
ZODB.POSException
import
ConflictError
from
ZODB.POSException
import
ConflictError
import
six
import
six
if
six
.
PY2
:
class
ERP5BaseBroken_
(
Broken
,
ERP5Base
,
PersistentBroken
):
pass
else
:
class
ERP5BaseBroken_
(
ERP5Base
,
PersistentBroken
):
pass
class
ERP5BaseBroken
(
ERP5BaseBroken_
):
# PersistentBroken can't be reused directly
# because its « layout differs from 'GhostPortalType' »
# This prevents serialize (ZODB) from reloading the class during commit
# (which would look for __Broken_newargs__ which is not present)
__getnewargs__
=
None
def
__metaclass__
(
name
,
base
,
d
):
class
PersistentBrokenMetaClass
(
type
):
def
__new__
(
cls
,
name
,
bases
,
d
):
d
=
dict
(
PersistentBroken
.
__dict__
,
**
d
)
d
=
dict
(
PersistentBroken
.
__dict__
,
**
d
)
for
x
in
'__dict__'
,
'__metaclass__'
,
'__weakref__'
:
del
d
[
'__dict__'
]
del
d
[
x
]
del
d
[
'__weakref__'
]
def
get
(
x
):
def
get
(
x
):
def
get
(
self
):
def
get
(
self
):
d
=
self
.
__dict__
d
=
self
.
__dict__
...
@@ -51,7 +39,17 @@ class ERP5BaseBroken(ERP5BaseBroken_):
...
@@ -51,7 +39,17 @@ class ERP5BaseBroken(ERP5BaseBroken_):
return
property
(
get
)
return
property
(
get
)
for
x
in
'id'
,
'title'
:
for
x
in
'id'
,
'title'
:
d
[
x
]
=
get
(
x
)
d
[
x
]
=
get
(
x
)
return
type
(
name
,
base
,
d
)
return
type
(
name
,
bases
,
d
)
@
six
.
add_metaclass
(
PersistentBrokenMetaClass
)
class
ERP5BaseBroken
(
Broken
,
ERP5Base
,
PersistentBroken
):
# PersistentBroken can't be reused directly
# because its « layout differs from 'GhostPortalType' »
# This prevents serialize (ZODB) from reloading the class during commit
# (which would look for __Broken_newargs__ which is not present)
__getnewargs__
=
None
def
__getattr__
(
self
,
name
):
def
__getattr__
(
self
,
name
):
try
:
try
:
...
...
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