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
9f93b7f5
Commit
9f93b7f5
authored
Feb 20, 2013
by
Marius Gedminas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Typo fixes
parent
cb8fe119
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
src/ZODB/persistentclass.py
src/ZODB/persistentclass.py
+4
-4
src/ZODB/persistentclass.txt
src/ZODB/persistentclass.txt
+4
-4
No files found.
src/ZODB/persistentclass.py
View file @
9f93b7f5
...
@@ -22,9 +22,9 @@ $Id$
...
@@ -22,9 +22,9 @@ $Id$
# Persistent classes are non-ghostable. This has some interesting
# Persistent classes are non-ghostable. This has some interesting
# ramifications:
# ramifications:
#
#
# - When an object is invalidated, it must reload it
'
s state
# - When an object is invalidated, it must reload its state
#
#
# - When an object is loaded from the database, it
'
s state must be
# - When an object is loaded from the database, its state must be
# loaded. Unfortunately, there isn't a clear signal when an object is
# loaded. Unfortunately, there isn't a clear signal when an object is
# loaded from the database. This should probably be fixed.
# loaded from the database. This should probably be fixed.
#
#
...
@@ -65,7 +65,7 @@ class _p_DataDescr(object):
...
@@ -65,7 +65,7 @@ class _p_DataDescr(object):
class
_p_oid_or_jar_Descr
(
_p_DataDescr
):
class
_p_oid_or_jar_Descr
(
_p_DataDescr
):
# Special descr for _p_oid and _p_jar that loads
# Special descr for _p_oid and _p_jar that loads
# state when set if both are set and
and
_p_changed is None
# state when set if both are set and _p_changed is None
#
#
# See notes above
# See notes above
...
@@ -84,7 +84,7 @@ class _p_oid_or_jar_Descr(_p_DataDescr):
...
@@ -84,7 +84,7 @@ class _p_oid_or_jar_Descr(_p_DataDescr):
jar
.
setstate
(
inst
)
jar
.
setstate
(
inst
)
class
_p_ChangedDescr
(
object
):
class
_p_ChangedDescr
(
object
):
# descriptor to handle special weird emantics of _p_changed
# descriptor to handle special weird
s
emantics of _p_changed
def
__get__
(
self
,
inst
,
cls
):
def
__get__
(
self
,
inst
,
cls
):
if
inst
is
None
:
if
inst
is
None
:
...
...
src/ZODB/persistentclass.txt
View file @
9f93b7f5
...
@@ -39,7 +39,7 @@ the methods outside of the class. Why? Because all of the items in a
...
@@ -39,7 +39,7 @@ the methods outside of the class. Why? Because all of the items in a
persistent class must be picklable. We defined the methods as global
persistent class must be picklable. We defined the methods as global
functions to make them picklable.
functions to make them picklable.
Also note that we explictly set the module. Persistent classes don't
Also note that we explic
i
tly set the module. Persistent classes don't
live in normal Python modules. Rather, they live in the database. We
live in normal Python modules. Rather, they live in the database. We
use information in ``__module__`` to record where in the database. When
use information in ``__module__`` to record where in the database. When
we want to use a database, we will need to supply a custom class
we want to use a database, we will need to supply a custom class
...
@@ -138,7 +138,7 @@ We can open another connection and access the class there.
...
@@ -138,7 +138,7 @@ We can open another connection and access the class there.
>>> c2.bar()
>>> c2.bar()
bar other
bar other
If we make changes without commiting them:
If we make changes without commit
t
ing them:
>>> C.bar = baz
>>> C.bar = baz
>>> c.bar()
>>> c.bar()
...
@@ -225,7 +225,7 @@ able to access the root object and it must be loaded first. If the
...
@@ -225,7 +225,7 @@ able to access the root object and it must be loaded first. If the
instance was in the root object, we'd be unable to create it while
instance was in the root object, we'd be unable to create it while
loading the root object.
loading the root object.
Now, if we try to load it, we get a broken oject:
Now, if we try to load it, we get a broken o
b
ject:
>>> connection2.sync()
>>> connection2.sync()
>>> connection2.root()['obs']['p']
>>> connection2.root()['obs']['p']
...
...
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