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
236f4d0a
Commit
236f4d0a
authored
Oct 02, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backported c115442, 115445 and 115501 from trunk to deal with changes in ZODB 3.9.6
parent
1e7fb77a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
doc/CHANGES.rst
doc/CHANGES.rst
+3
-0
src/Products/PluginIndexes/DateIndex/DateIndex.py
src/Products/PluginIndexes/DateIndex/DateIndex.py
+5
-3
src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
+3
-1
No files found.
doc/CHANGES.rst
View file @
236f4d0a
...
...
@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed
++++++++++
- Adjusted overflow logic in DateIndex and DateRangeIndex to work with latest
ZODB 3.9.7.
- Fixed ``testZODBCompat`` tests in ZopeTestCase to match modern ZODB
semantics.
...
...
src/Products/PluginIndexes/DateIndex/DateIndex.py
View file @
236f4d0a
...
...
@@ -53,6 +53,8 @@ else:
DSTOFFSET
=
STDOFFSET
DSTDIFF
=
DSTOFFSET
-
STDOFFSET
MAX32
=
int
(
2
**
31
-
1
)
class
LocalTimezone
(
tzinfo
):
...
...
@@ -262,9 +264,9 @@ class DateIndex(UnIndex, PropertyManager):
t_val
=
(
(
(
(
yr
*
12
+
mo
)
*
31
+
dy
)
*
24
+
hr
)
*
60
+
mn
)
if
isinstance
(
t_val
,
long
)
:
# t_val must be
IntType, not LongTyp
e
raise
OverflowError
,
(
if
t_val
>
MAX32
:
# t_val must be
integer fitting in the 32bit rang
e
raise
OverflowError
(
"%s is not within the range of indexable dates (index: %s)"
%
(
value
,
self
.
id
))
...
...
src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
View file @
236f4d0a
...
...
@@ -40,6 +40,7 @@ from Products.PluginIndexes.common.util import parseIndexRequest
from
Products.PluginIndexes.interfaces
import
IDateRangeIndex
_dtmldir
=
os
.
path
.
join
(
package_home
(
globals
()
),
'dtml'
)
MAX32
=
int
(
2
**
31
-
1
)
class
DateRangeIndex
(
UnIndex
):
...
...
@@ -421,7 +422,8 @@ class DateRangeIndex(UnIndex):
elif
isinstance
(
value
,
DateTime
):
value
=
value
.
millis
()
/
1000
/
60
# flatten to minutes
result
=
int
(
value
)
if
isinstance
(
result
,
long
):
# this won't work (Python 2.3)
if
result
>
MAX32
:
# t_val must be integer fitting in the 32bit range
raise
OverflowError
(
'%s is not within the range of dates allowed'
'by a DateRangeIndex'
%
value
)
return
result
...
...
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