Permalink
Browse files

The ``dateutil`` requirement is now optional. Thanks to arthurnn for …

…the report.
  • Loading branch information...
1 parent c2e3ecc commit 1f8c2322f9cf2c9e5f3e91e4524c2374ac11d99d @toastdriven toastdriven committed Jan 4, 2012
Showing with 11 additions and 7 deletions.
  1. +7 −0 docs/management_commands.rst
  2. +4 −1 haystack/management/commands/update_index.py
  3. +0 −6 setup.py
@@ -37,6 +37,13 @@ wish to delete the entire index.
``update_index``
================
+.. note::
+
+ If you use the ``--start/--end`` flags on this command, you'll need to
+ install dateutil_ to handle the datetime parsing.
+
+ .. _dateutil: http://pypi.python.org/pypi/python-dateutil/1.5
+
The ``update_index`` command will freshen all of the content in your index. It
iterates through all indexed models and updates the records in the index. In
addition to the standard management command options, it accepts the following
@@ -1,5 +1,4 @@
import datetime
-from dateutil.parser import parse as dateutil_parse
import os
import warnings
from optparse import make_option
@@ -171,12 +170,16 @@ def handle(self, *items, **options):
self.start_date = datetime.datetime.now() - datetime.timedelta(hours=int(age))
if start_date is not None:
+ from dateutil.parser import parse as dateutil_parse
+
try:
self.start_date = dateutil_parse(start_date)
except ValueError:
pass
if end_date is not None:
+ from dateutil.parser import parse as dateutil_parse
+
try:
self.end_date = dateutil_parse(end_date)
except ValueError:
View
@@ -24,12 +24,6 @@
'templates/search_configuration/*',
]
},
- requires=[
- 'python_dateutil(>=1.5, < 2.0)',
- ],
- install_requires=[
- 'python_dateutil >= 1.5, < 2.0',
- ],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',

0 comments on commit 1f8c232

Please sign in to comment.