Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Kirill Smelkov
ZODB
Commits
e8a853a3
Commit
e8a853a3
authored
Jun 17, 2016
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
document load_current, including its somewhat tenuous nature.
parent
347b9f5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
src/ZODB/utils.py
src/ZODB/utils.py
+12
-0
No files found.
src/ZODB/utils.py
View file @
e8a853a3
...
@@ -379,6 +379,18 @@ else:
...
@@ -379,6 +379,18 @@ else:
import
ZODB.POSException
import
ZODB.POSException
def
load_current
(
storage
,
oid
,
version
=
''
):
def
load_current
(
storage
,
oid
,
version
=
''
):
"""Load the most recent revision of an object by calling loadBefore
Starting in ZODB 5, it's no longer necessary for storages to
provide a load method.
This function is mainly intended to facilitate transitioning from
load to loadBefore. It's mainly useful for tests that are meant
to test storages, but do so by calling load on the storages.
This function will likely become unnecessary and be deprecated
some time in the future.
"""
assert
not
version
assert
not
version
r
=
storage
.
loadBefore
(
oid
,
maxtid
)
r
=
storage
.
loadBefore
(
oid
,
maxtid
)
if
r
is
None
:
if
r
is
None
:
...
...
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