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
9152ce44
Commit
9152ce44
authored
Aug 04, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the actual max value clearer
parent
a5a09083
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
src/Products/PluginIndexes/DateIndex/DateIndex.py
src/Products/PluginIndexes/DateIndex/DateIndex.py
+3
-4
src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
+2
-2
No files found.
src/Products/PluginIndexes/DateIndex/DateIndex.py
View file @
9152ce44
...
...
@@ -51,7 +51,8 @@ else:
DSTOFFSET
=
STDOFFSET
DSTDIFF
=
DSTOFFSET
-
STDOFFSET
MAX32
=
2
**
31
MAX32
=
2
**
31
-
1
class
LocalTimezone
(
tzinfo
):
...
...
@@ -264,9 +265,7 @@ class DateIndex(UnIndex, PropertyManager):
t_val
=
(
(
(
(
yr
*
12
+
mo
)
*
31
+
dy
)
*
24
+
hr
)
*
60
+
mn
)
if
t_val
>=
MAX32
:
if
t_val
>
MAX32
:
# t_val must be integer fitting in the 32bit range
raise
OverflowError
(
"%s is not within the range of indexable dates (index: %s)"
...
...
src/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
View file @
9152ce44
...
...
@@ -37,7 +37,7 @@ from Products.PluginIndexes.common.util import parseIndexRequest
from
Products.PluginIndexes.interfaces
import
IDateRangeIndex
_dtmldir
=
os
.
path
.
join
(
package_home
(
globals
()
),
'dtml'
)
MAX32
=
2
**
31
MAX32
=
2
**
31
-
1
class
DateRangeIndex
(
UnIndex
):
...
...
@@ -398,7 +398,7 @@ class DateRangeIndex(UnIndex):
elif
isinstance
(
value
,
DateTime
):
value
=
value
.
millis
()
/
1000
/
60
# flatten to minutes
result
=
int
(
value
)
if
result
>
=
MAX32
:
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
)
...
...
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