I am attempting to query my database for a DateField.  I use the
following lines to set the qset in my view code.

query = request.GET.get('q','')
if query:
   (
      Q(end__icontains=query) |
      Q(maintenance_contractor__name__icontains=query) |
      Q(purchase_order__icontains=query)
   )

   results = Maintenance_item.objects.filter(qset).distinct()
else:
   results=[]

This code fails and the gives the following dump when I attempt to
query on date,
P.S. even an input with an exact match will fail with the same error.
note the example is a partial match on year.

thanks for any help.  --

james


Warning at /search/
Incorrect date value: '%'2007'%' for column 'end' at row 1
Request Method:         GET
Request URL:    http://localhost:8000/search/
Exception Type:         Warning
Exception Value:        Incorrect date value: '%'2007'%' for column 'end' at
row 1
Exception Location:     /opt/csw/lib/python/warnings.py in warn_explicit,
line 102
Template error

In template /export/home/jhartley/djcode/mysite/templates/search.html,
error at line 18
Caught an exception while rendering: Incorrect date value: '%'2007'%'
for column 'end' at row 1
8       <h1>Search</h1>
9       <form action="." method="GET">
10      <label for="q">Search: </label>
11      <input type="text" name="q" value="{{ query|escape }}">
12      <input type="submit" value="Search">
13      </form>
14
15      {% if query %}
16      </h2>Results for "{{ query|escape }}":</h2>
17
18      {% if results %}
19      <ul>
20      {% for maintenance_item in results %}
21      <li>{{ maintenance_item }}</li>
22      {% endfor %}
23      </ul>
24      {% else %}
25      <p>No Maintenance Items Found</p>
26      {% endif %}
27      {% endif %}
28      </body>
Traceback (innermost last)
Switch to copy-and-paste view

    * /opt/csw/lib/python/site-packages/django/template/__init__.py in
render_node
       716.
       717. def render_node(self, node, context):
       718. return(node.render(context))
       719.
       720. class DebugNodeList(NodeList):
       721. def render_node(self, node, context):
       722. try:
       723. result = node.render(context) ...
       724. except TemplateSyntaxError, e:
       725. if not hasattr(e, 'source'):
       726. e.source = node.source
       727. raise
       728. except Exception, e:
       729. from sys import exc_info
      ▶ Local vars
      Variable  Value
      context
      Error in formatting:Incorrect date value: '%'2007'%' for column
'end' at row 1
      e
      Warning("Incorrect date value: '%'2007'%' for column 'end' at
row 1",)
      exc_info
      <built-in function exc_info>
      node
      <If node>
      self
      [<Text Node: ' </h2>Results for "'>, <Variable Node: query|
escape>, <Text Node: '":</h2> '>, <If node>, <Text Node: ' '>]
      wrapped
      TemplateSyntaxError("Caught an exception while rendering:
Incorrect date value: '%'2007'%' for column 'end' at row 1",)
    * /opt/csw/lib/python/site-packages/django/template/defaulttags.py
in render
       201. def render(self, context):
       202. if self.link_type == IfNode.LinkTypes.or_:
       203. for ifnot, bool_expr in self.bool_exprs:
       204. try:
       205. value = bool_expr.resolve(context, True)
       206. except VariableDoesNotExist:
       207. value = None
       208. if (value and not ifnot) or (ifnot and not value): ...
       209. return self.nodelist_true.render(context)
       210. return self.nodelist_false.render(context)
       211. else:
       212. for ifnot, bool_expr in self.bool_exprs:
       213. try:
       214. value = bool_expr.resolve(context, True)
      ▶ Local vars
      Variable  Value
      bool_expr
      <django.template.FilterExpression object at 0x870310c>
      context
      Error in formatting:Incorrect date value: '%'2007'%' for column
'end' at row 1
      ifnot
      False
      self
      <If node>
      value
      Error in formatting:Incorrect date value: '%'2007'%' for column
'end' at row 1
    * /opt/csw/lib/python/site-packages/django/db/models/query.py in
__len__
        98. # PYTHON MAGIC METHODS #
        99. ########################
       100.
       101. def __repr__(self):
       102. return repr(self._get_data())
       103.
       104. def __len__(self):
       105. return len(self._get_data()) ...
       106.
       107. def __iter__(self):
       108. return iter(self._get_data())
       109.
       110. def __getitem__(self, k):
       111. "Retrieve an item or slice from the set of results."
      ▶ Local vars
      Variable  Value
      self
      Error in formatting:Incorrect date value: '%'2007'%' for column
'end' at row 1
    * /opt/csw/lib/python/site-packages/django/db/models/query.py in
_get_data
       463. if (self._order_by is not None and len(self._order_by) >
0) and \
       464. (combined._order_by is None or len(combined._order_by) ==
0):
       465. combined._order_by = self._order_by
       466. return combined
       467.
       468. def _get_data(self):
       469. if self._result_cache is None:
       470. self._result_cache = list(self.iterator()) ...
       471. return self._result_cache
       472.
       473. def _get_sql_clause(self):
       474. opts = self.model._meta
       475.
       476. # Construct the fundamental parts of the query: SELECT X
FROM Y WHERE Z.
      ▶ Local vars
      Variable  Value
      self
      Error in formatting:Incorrect date value: '%'2007'%' for column
'end' at row 1
    * /opt/csw/lib/python/site-packages/django/db/models/query.py in
iterator
       176. raise StopIteration
       177.
       178. # self._select is a dictionary, and dictionaries' key
order is
       179. # undefined, so we convert it to a list of tuples.
       180. extra_select = self._select.items()
       181.
       182. cursor = connection.cursor()
       183. cursor.execute("SELECT " + (self._distinct and "DISTINCT "
or "") + ",".join(select) + sql, params) ...
       184. fill_cache = self._select_related
       185. index_end = len(self.model._meta.fields)
       186. while 1:
       187. rows = cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)
       188. if not rows:
       189. raise StopIteration
      ▶ Local vars
      Variable  Value
      cursor
      <django.db.backends.util.CursorDebugWrapper object at 0x86fbe6c>
      extra_select
      []
      params
      ["%'2007'%", "%'2007'%", "%'2007'%"]
      select
      ['`mts_maintenance_item`.`id`',
'`mts_maintenance_item`.`maintenance_contractor_id`',
'`mts_maintenance_item`.`vendor_id`',
'`mts_maintenance_item`.`cacicontact_id`',
'`mts_maintenance_item`.`cacibuyer_id`',
'`mts_maintenance_item`.`start`', '`mts_maintenance_item`.`end`',
'`mts_maintenance_item`.`endoflife`',
'`mts_maintenance_item`.`startofwarantee`',
'`mts_maintenance_item`.`endofwarantee`',
'`mts_maintenance_item`.`costperunit`',
'`mts_maintenance_item`.`totalcost`',
'`mts_maintenance_item`.`numberofunits`',
'`mts_maintenance_item`.`description`',
'`mts_maintenance_item`.`comments`',
'`mts_maintenance_item`.`serial_number`',
'`mts_maintenance_item`.`purchase_order`',
'`mts_maintenance_item`.`vendor_part_number`',
'`mts_maintenance_item`.`manufacturer_part_number`']
      self
      Error in formatting:Incorrect date value: '%'2007'%' for column
'end' at row 1
      sql
      ' FROM `mts_maintenance_item` INNER JOIN
`mts_maintenance_contractor` AS
`mts_maintenance_item__maintenance_contractor` ON
`mts_maintenance_item`.`maintenance_contractor_id` =
`mts_maintenance_item__maintenance_contractor`.`id` WHERE
((`mts_maintenance_item`.`end` LIKE %s OR
`mts_maintenance_item__maintenance_contractor`.`name` LIKE %s OR
`mts_maintenance_item`.`purchase_order` LIKE %s))'
    * /opt/csw/lib/python/site-packages/django/db/backends/util.py in
execute
         5. def __init__(self, cursor, db):
         6. self.cursor = cursor
         7. self.db = db
         8.
         9. def execute(self, sql, params=()):
        10. start = time()
        11. try:
        12. return self.cursor.execute(sql, params) ...
        13. finally:
        14. stop = time()
        15. # If params was a list, convert it to a tuple, because
string
        16. # formatting with '%' only works with tuples or dicts.
        17. if not isinstance(params, (tuple, dict)):
        18. params = tuple(params)
      ▶ Local vars
      Variable  Value
      params
      ("%'2007'%", "%'2007'%", "%'2007'%")
      self
      <django.db.backends.util.CursorDebugWrapper object at 0x86fbe6c>
      sql
      'SELECT DISTINCT
`mts_maintenance_item`.`id`,`mts_maintenance_item`.`maintenance_contractor_id`,`mts_maintenance_item`.`vendor_id`,`mts_maintenance_item`.`cacicontact_id`,`mts_maintenance_item`.`cacibuyer_id`,`mts_maintenance_item`.`start`,`mts_maintenance_item`.`end`,`mts_maintenance_item`.`endoflife`,`mts_maintenance_item`.`startofwarantee`,`mts_maintenance_item`.`endofwarantee`,`mts_maintenance_item`.`costperunit`,`mts_maintenance_item`.`totalcost`,`mts_maintenance_item`.`numberofunits`,`mts_maintenance_item`.`description`,`mts_maintenance_item`.`comments`,`mts_maintenance_item`.`serial_number`,`mts_maintenance_item`.`purchase_order`,`mts_maintenance_item`.`vendor_part_number`,`mts_maintenance_item`.`manufacturer_part_number`
FROM `mts_maintenance_item` INNER JOIN `mts_maintenance_contractor` AS
`mts_maintenance_item__maintenance_contractor` ON
`mts_maintenance_item`.`maintenance_contractor_id` =
`mts_maintenance_item__maintenance_contractor`.`id` WHERE
((`mts_maintenance_item`.`end` LIKE %s OR
`mts_maintenance_item__maintenance_contractor`.`name` LIKE %s OR
`mts_maintenance_item`.`purchase_order` LIKE %s))'
      start
      1209429131.723309
      stop
      1209429131.726963
    * /opt/csw/lib/python/site-packages/MySQLdb/cursors.py in execute
       161. self.errorhandler(self, TypeError, m)
       162. except:
       163. exc, value, tb = exc_info()
       164. del tb
       165. self.messages.append((exc, value))
       166. self.errorhandler(self, exc, value)
       167. self._executed = query
       168. if not self._defer_warnings: self._warning_check() ...
       169. return r
       170.
       171. def executemany(self, query, args):
       172.
       173. """Execute a multi-row query.
 174.
      ▶ Local vars
      Variable  Value
      ListType
      <type 'list'>
      TupleType
      <type 'tuple'>
      args
      ["%'2007'%", "%'2007'%", "%'2007'%"]
      charset
      'utf8'
      db
      <weakproxy at 86040f4 to Connection at 8645154>
      exc_info
      <built-in function exc_info>
      query
      "SELECT DISTINCT
`mts_maintenance_item`.`id`,`mts_maintenance_item`.`maintenance_contractor_id`,`mts_maintenance_item`.`vendor_id`,`mts_maintenance_item`.`cacicontact_id`,`mts_maintenance_item`.`cacibuyer_id`,`mts_maintenance_item`.`start`,`mts_maintenance_item`.`end`,`mts_maintenance_item`.`endoflife`,`mts_maintenance_item`.`startofwarantee`,`mts_maintenance_item`.`endofwarantee`,`mts_maintenance_item`.`costperunit`,`mts_maintenance_item`.`totalcost`,`mts_maintenance_item`.`numberofunits`,`mts_maintenance_item`.`description`,`mts_maintenance_item`.`comments`,`mts_maintenance_item`.`serial_number`,`mts_maintenance_item`.`purchase_order`,`mts_maintenance_item`.`vendor_part_number`,`mts_maintenance_item`.`manufacturer_part_number`
FROM `mts_maintenance_item` INNER JOIN `mts_maintenance_contractor` AS
`mts_maintenance_item__maintenance_contractor` ON
`mts_maintenance_item`.`maintenance_contractor_id` =
`mts_maintenance_item__maintenance_contractor`.`id` WHERE
((`mts_maintenance_item`.`end` LIKE '%\\'2007\\'%' OR
`mts_maintenance_item__maintenance_contractor`.`name` LIKE '%\\'2007\
\'%' OR `mts_maintenance_item`.`purchase_order` LIKE '%\\'2007\\'%'))"
      r
      0L
      self
      <MySQLdb.cursors.Cursor object at 0x86fbdec>
    * /opt/csw/lib/python/site-packages/MySQLdb/cursors.py in
_warning_check
        75. warnings = self._get_db().show_warnings()
        76. if warnings:
        77. # This is done in two loops in case
        78. # Warnings are set to raise exceptions.
        79. for w in warnings:
        80. self.messages.append((self.Warning, w))
        81. for w in warnings:
        82. warn(w[-1], self.Warning, 3) ...
        83. elif self._info:
        84. self.messages.append((self.Warning, self._info))
        85. warn(self._info, self.Warning, 3)
        86.
        87. def nextset(self):
        88. """Advance to the next result set.
      ▶ Local vars
      Variable  Value
      self
      <MySQLdb.cursors.Cursor object at 0x86fbdec>
      w
      ('Warning', 1292L, "Incorrect date value: '%'2007'%' for column
'end' at row 1")
      warn
      <function warn at 0x80cabfc>
      warnings
      (('Warning', 1292L, "Incorrect date value: '%'2007'%' for column
'end' at row 1"),)
    * /opt/csw/lib/python/warnings.py in warn
        55. except AttributeError:
        56. # embedded interpreters don't have sys.argv, see bug
#839151
        57. filename = '__main__'
        58. if not filename:
        59. filename = module
        60. registry = globals.setdefault("__warningregistry__", {})
        61. warn_explicit(message, category, filename, lineno, module,
registry,
        62. globals) ...
        63.
        64. def warn_explicit(message, category, filename, lineno,
        65. module=None, registry=None, module_globals=None):
        66. if module is None:
        67. module = filename or "<unknown>"
        68. if module[-3:].lower() == ".py":
      ▶ Local vars
      Variable  Value
      caller
      <frame object at 0x8739fcc>
      category
      <class '_mysql_exceptions.Warning'>
      filename
      '/opt/csw/lib/python/site-packages/django/db/backends/util.py'
      fnl
      '/opt/csw/lib/python/site-packages/django/db/backends/util.pyc'
      globals
      {'CursorDebugWrapper': <class
'django.db.backends.util.CursorDebugWrapper'>, '__builtins__':
{'ArithmeticError': <type 'exceptions.ArithmeticError'>,
'AssertionError': <type 'exceptions.AssertionError'>,
'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException':
<type 'exceptions.BaseException'>, 'DeprecationWarning': <type
'exceptions.DeprecationWarning'>, 'EOFError': <type
'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError':
<type 'exceptions.EnvironmentError'>, 'Exception': <type
'exceptions.Exception'>, 'False': False, 'FloatingPointError': <type
'exceptions.FloatingPointError'>, 'FutureWarning': <type
'exceptions.FutureWarning'>, 'GeneratorExit': <type
'exceptions.GeneratorExit'>, 'IOError': <type 'exceptions.IOError'>,
'ImportError': <type 'exceptions.ImportError'>, 'ImportWarning': <type
'exceptions.ImportWarning'>, 'IndentationError': <type
'exceptions.IndentationError'>, 'IndexError': <type
'exceptions.IndexError'>, 'KeyError': <type 'exceptions.KeyError'>,
'KeyboardInterrupt': <type 'exceptions.KeyboardInterrupt'>,
'LookupError': <type 'exceptions.LookupError'>, 'MemoryError': <type
'exceptions.MemoryError'>, 'NameError': <type 'exceptions.NameError'>,
'None': None, 'NotImplemented': NotImplemented, 'NotImplementedError':
<type 'exceptions.NotImplementedError'>, 'OSError': <type
'exceptions.OSError'>, 'OverflowError': <type
'exceptions.OverflowError'>, 'PendingDeprecationWarning': <type
'exceptions.PendingDeprecationWarning'>, 'ReferenceError': <type
'exceptions.ReferenceError'>, 'RuntimeError': <type
'exceptions.RuntimeError'>, 'RuntimeWarning': <type
'exceptions.RuntimeWarning'>, 'StandardError': <type
'exceptions.StandardError'>, 'StopIteration': <type
'exceptions.StopIteration'>, 'SyntaxError': <type
'exceptions.SyntaxError'>, 'SyntaxWarning': <type
'exceptions.SyntaxWarning'>, 'SystemError': <type
'exceptions.SystemError'>, 'SystemExit': <type
'exceptions.SystemExit'>, 'TabError': <type 'exceptions.TabError'>,
'True': True, 'TypeError': <type 'exceptions.TypeError'>,
'UnboundLocalError': <type 'exceptions.UnboundLocalError'>,
'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>,
'UnicodeEncodeError': <type 'exceptions.UnicodeEncodeError'>,
'UnicodeError': <type 'exceptions.UnicodeError'>,
'UnicodeTranslateError': <type 'exceptions.UnicodeTranslateError'>,
'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'UserWarning':
<type 'exceptions.UserWarning'>, 'ValueError': <type
'exceptions.ValueError'>, 'Warning': <type 'exceptions.Warning'>,
'ZeroDivisionError': <type 'exceptions.ZeroDivisionError'>, '_':
<function first_time_gettext at 0x8191f44>, '__debug__': True,
'__doc__': "Built-in functions, exceptions, and other objects.\n
\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in
slices.", '__import__': <built-in function __import__>, '__name__':
'__builtin__', 'abs': <built-in function abs>, 'all': <built-in
function all>, 'any': <built-in function any>, 'apply': <built-in
function apply>, 'basestring': <type 'basestring'>, 'bool': <type
'bool'>, 'buffer': <type 'buffer'>, 'callable': <built-in function
callable>, 'chr': <built-in function chr>, 'classmethod': <type
'classmethod'>, 'cmp': <built-in function cmp>, 'coerce': <built-in
function coerce>, 'compile': <built-in function compile>, 'complex':
<type 'complex'>, 'copyright': Copyright (c) 2001-2007 Python Software
Foundation. All Rights Reserved. Copyright (c) 2000 BeOpen.com. All
Rights Reserved. Copyright (c) 1995-2001 Corporation for National
Research Initiatives. All Rights Reserved. Copyright (c) 1991-1995
Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved.,
'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a
cast of thousands for supporting Python development. See www.python.org
for more information., 'delattr': <built-in function delattr>, 'dict':
<type 'dict'>, 'dir': <built-in function dir>, 'divmod': <built-in
function divmod>, 'enumerate': <type 'enumerate'>, 'eval': <built-in
function eval>, 'execfile': <built-in function execfile>, 'exit': Use
exit() or Ctrl-D (i.e. EOF) to exit, 'file': <type 'file'>, 'filter':
<built-in function filter>, 'float': <type 'float'>, 'frozenset':
<type 'frozenset'>, 'getattr': <built-in function getattr>, 'globals':
<built-in function globals>, 'hasattr': <built-in function hasattr>,
'hash': <built-in function hash>, 'help': Type help() for interactive
help, or help(object) for help about object., 'hex': <built-in
function hex>, 'id': <built-in function id>, 'input': <built-in
function input>, 'int': <type 'int'>, 'intern': <built-in function
intern>, 'isinstance': <built-in function isinstance>, 'issubclass':
<built-in function issubclass>, 'iter': <built-in function iter>,
'len': <built-in function len>, 'license': Type license() to see the
full license text, 'list': <type 'list'>, 'locals': <built-in function
locals>, 'long': <type 'long'>, 'map': <built-in function map>, 'max':
<built-in function max>, 'min': <built-in function min>, 'object':
<type 'object'>, 'oct': <built-in function oct>, 'open': <built-in
function open>, 'ord': <built-in function ord>, 'pow': <built-in
function pow>, 'property': <type 'property'>, 'quit': Use quit() or
Ctrl-D (i.e. EOF) to exit, 'range': <built-in function range>,
'raw_input': <built-in function raw_input>, 'reduce': <built-in
function reduce>, 'reload': <built-in function reload>, 'repr': <built-
in function repr>, 'reversed': <type 'reversed'>, 'round': <built-in
function round>, 'set': <type 'set'>, 'setattr': <built-in function
setattr>, 'slice': <type 'slice'>, 'sorted': <built-in function
sorted>, 'staticmethod': <type 'staticmethod'>, 'str': <type 'str'>,
'sum': <built-in function sum>, 'super': <type 'super'>, 'tuple':
<type 'tuple'>, 'type': <type 'type'>, 'unichr': <built-in function
unichr>, 'unicode': <type 'unicode'>, 'vars': <built-in function
vars>, 'xrange': <type 'xrange'>, 'zip': <built-in function zip>},
'__doc__': None, '__file__': '/opt/csw/lib/python/site-packages/django/
db/backends/util.pyc', '__name__': 'django.db.backends.util',
'__warningregistry__': {}, '_dict_helper': <function _dict_helper at
0x831b0d4>, 'datetime': <module 'datetime' from '/opt/csw/lib/python/
lib-dynload/datetime.so'>, 'dictfetchall': <function dictfetchall at
0x831b17c>, 'dictfetchmany': <function dictfetchmany at 0x831b144>,
'dictfetchone': <function dictfetchone at 0x831b10c>,
'rev_typecast_boolean': <function rev_typecast_boolean at 0x831b09c>,
'time': <built-in function time>, 'typecast_boolean': <function
typecast_boolean at 0x831b064>, 'typecast_date': <function
typecast_date at 0x8312e9c>, 'typecast_time': <function typecast_time
at 0x8312fb4>, 'typecast_timestamp': <function typecast_timestamp at
0x831b02c>}
      lineno
      12
      message
      "Incorrect date value: '%'2007'%' for column 'end' at row 1"
      module
      'django.db.backends.util'
      registry
      {}
      stacklevel
      3
    * /opt/csw/lib/python/warnings.py in warn_explicit
        95. return
        96.
        97. # Prime the linecache for formatting, in case the
        98. # "file" is actually in a zipfile or something.
        99. linecache.getlines(filename, module_globals)
       100.
       101. if action == "error":
       102. raise message ...
       103. # Other actions
       104. if action == "once":
       105. registry[key] = 1
       106. oncekey = (text, category)
       107. if onceregistry.get(oncekey):
       108. return
      ▶ Local vars
      Variable  Value
      action
      'error'
      cat
      <class '_mysql_exceptions.Warning'>
      category
      <class '_mysql_exceptions.Warning'>
      filename
      '/opt/csw/lib/python/site-packages/django/db/backends/util.py'
      item
      ('error', <_sre.SRE_Pattern object at 0x85f7b00>, <class
'_mysql_exceptions.Warning'>, <_sre.SRE_Pattern object at 0x85f7b30>,
0)
      key
      ("Incorrect date value: '%'2007'%' for column 'end' at row 1",
<class '_mysql_exceptions.Warning'>, 12)
      lineno
      12
      ln
      0
      message
      Warning("Incorrect date value: '%'2007'%' for column 'end' at
row 1",)
      mod
      <_sre.SRE_Pattern object at 0x85f7b30>
      module
      'django.db.backends.util'
      module_globals
      {'CursorDebugWrapper': <class
'django.db.backends.util.CursorDebugWrapper'>, '__builtins__':
{'ArithmeticError': <type 'exceptions.ArithmeticError'>,
'AssertionError': <type 'exceptions.AssertionError'>,
'AttributeError': <type 'exceptions.AttributeError'>, 'BaseException':
<type 'exceptions.BaseException'>, 'DeprecationWarning': <type
'exceptions.DeprecationWarning'>, 'EOFError': <type
'exceptions.EOFError'>, 'Ellipsis': Ellipsis, 'EnvironmentError':
<type 'exceptions.EnvironmentError'>, 'Exception': <type
'exceptions.Exception'>, 'False': False, 'FloatingPointError': <type
'exceptions.FloatingPointError'>, 'FutureWarning': <type
'exceptions.FutureWarning'>, 'GeneratorExit': <type
'exceptions.GeneratorExit'>, 'IOError': <type 'exceptions.IOError'>,
'ImportError': <type 'exceptions.ImportError'>, 'ImportWarning': <type
'exceptions.ImportWarning'>, 'IndentationError': <type
'exceptions.IndentationError'>, 'IndexError': <type
'exceptions.IndexError'>, 'KeyError': <type 'exceptions.KeyError'>,
'KeyboardInterrupt': <type 'exceptions.KeyboardInterrupt'>,
'LookupError': <type 'exceptions.LookupError'>, 'MemoryError': <type
'exceptions.MemoryError'>, 'NameError': <type 'exceptions.NameError'>,
'None': None, 'NotImplemented': NotImplemented, 'NotImplementedError':
<type 'exceptions.NotImplementedError'>, 'OSError': <type
'exceptions.OSError'>, 'OverflowError': <type
'exceptions.OverflowError'>, 'PendingDeprecationWarning': <type
'exceptions.PendingDeprecationWarning'>, 'ReferenceError': <type
'exceptions.ReferenceError'>, 'RuntimeError': <type
'exceptions.RuntimeError'>, 'RuntimeWarning': <type
'exceptions.RuntimeWarning'>, 'StandardError': <type
'exceptions.StandardError'>, 'StopIteration': <type
'exceptions.StopIteration'>, 'SyntaxError': <type
'exceptions.SyntaxError'>, 'SyntaxWarning': <type
'exceptions.SyntaxWarning'>, 'SystemError': <type
'exceptions.SystemError'>, 'SystemExit': <type
'exceptions.SystemExit'>, 'TabError': <type 'exceptions.TabError'>,
'True': True, 'TypeError': <type 'exceptions.TypeError'>,
'UnboundLocalError': <type 'exceptions.UnboundLocalError'>,
'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>,
'UnicodeEncodeError': <type 'exceptions.UnicodeEncodeError'>,
'UnicodeError': <type 'exceptions.UnicodeError'>,
'UnicodeTranslateError': <type 'exceptions.UnicodeTranslateError'>,
'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'UserWarning':
<type 'exceptions.UserWarning'>, 'ValueError': <type
'exceptions.ValueError'>, 'Warning': <type 'exceptions.Warning'>,
'ZeroDivisionError': <type 'exceptions.ZeroDivisionError'>, '_':
<function first_time_gettext at 0x8191f44>, '__debug__': True,
'__doc__': "Built-in functions, exceptions, and other objects.\n
\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in
slices.", '__import__': <built-in function __import__>, '__name__':
'__builtin__', 'abs': <built-in function abs>, 'all': <built-in
function all>, 'any': <built-in function any>, 'apply': <built-in
function apply>, 'basestring': <type 'basestring'>, 'bool': <type
'bool'>, 'buffer': <type 'buffer'>, 'callable': <built-in function
callable>, 'chr': <built-in function chr>, 'classmethod': <type
'classmethod'>, 'cmp': <built-in function cmp>, 'coerce': <built-in
function coerce>, 'compile': <built-in function compile>, 'complex':
<type 'complex'>, 'copyright': Copyright (c) 2001-2007 Python Software
Foundation. All Rights Reserved. Copyright (c) 2000 BeOpen.com. All
Rights Reserved. Copyright (c) 1995-2001 Corporation for National
Research Initiatives. All Rights Reserved. Copyright (c) 1991-1995
Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved.,
'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a
cast of thousands for supporting Python development. See www.python.org
for more information., 'delattr': <built-in function delattr>, 'dict':
<type 'dict'>, 'dir': <built-in function dir>, 'divmod': <built-in
function divmod>, 'enumerate': <type 'enumerate'>, 'eval': <built-in
function eval>, 'execfile': <built-in function execfile>, 'exit': Use
exit() or Ctrl-D (i.e. EOF) to exit, 'file': <type 'file'>, 'filter':
<built-in function filter>, 'float': <type 'float'>, 'frozenset':
<type 'frozenset'>, 'getattr': <built-in function getattr>, 'globals':
<built-in function globals>, 'hasattr': <built-in function hasattr>,
'hash': <built-in function hash>, 'help': Type help() for interactive
help, or help(object) for help about object., 'hex': <built-in
function hex>, 'id': <built-in function id>, 'input': <built-in
function input>, 'int': <type 'int'>, 'intern': <built-in function
intern>, 'isinstance': <built-in function isinstance>, 'issubclass':
<built-in function issubclass>, 'iter': <built-in function iter>,
'len': <built-in function len>, 'license': Type license() to see the
full license text, 'list': <type 'list'>, 'locals': <built-in function
locals>, 'long': <type 'long'>, 'map': <built-in function map>, 'max':
<built-in function max>, 'min': <built-in function min>, 'object':
<type 'object'>, 'oct': <built-in function oct>, 'open': <built-in
function open>, 'ord': <built-in function ord>, 'pow': <built-in
function pow>, 'property': <type 'property'>, 'quit': Use quit() or
Ctrl-D (i.e. EOF) to exit, 'range': <built-in function range>,
'raw_input': <built-in function raw_input>, 'reduce': <built-in
function reduce>, 'reload': <built-in function reload>, 'repr': <built-
in function repr>, 'reversed': <type 'reversed'>, 'round': <built-in
function round>, 'set': <type 'set'>, 'setattr': <built-in function
setattr>, 'slice': <type 'slice'>, 'sorted': <built-in function
sorted>, 'staticmethod': <type 'staticmethod'>, 'str': <type 'str'>,
'sum': <built-in function sum>, 'super': <type 'super'>, 'tuple':
<type 'tuple'>, 'type': <type 'type'>, 'unichr': <built-in function
unichr>, 'unicode': <type 'unicode'>, 'vars': <built-in function
vars>, 'xrange': <type 'xrange'>, 'zip': <built-in function zip>},
'__doc__': None, '__file__': '/opt/csw/lib/python/site-packages/django/
db/backends/util.pyc', '__name__': 'django.db.backends.util',
'__warningregistry__': {}, '_dict_helper': <function _dict_helper at
0x831b0d4>, 'datetime': <module 'datetime' from '/opt/csw/lib/python/
lib-dynload/datetime.so'>, 'dictfetchall': <function dictfetchall at
0x831b17c>, 'dictfetchmany': <function dictfetchmany at 0x831b144>,
'dictfetchone': <function dictfetchone at 0x831b10c>,
'rev_typecast_boolean': <function rev_typecast_boolean at 0x831b09c>,
'time': <built-in function time>, 'typecast_boolean': <function
typecast_boolean at 0x831b064>, 'typecast_date': <function
typecast_date at 0x8312e9c>, 'typecast_time': <function typecast_time
at 0x8312fb4>, 'typecast_timestamp': <function typecast_timestamp at
0x831b02c>}
      msg
      <_sre.SRE_Pattern object at 0x85f7b00>
      registry
      {}
      text
      "Incorrect date value: '%'2007'%' for column 'end' at row 1"

Traceback (most recent call last):
File "/opt/csw/lib/python/site-packages/django/template/__init__.py"
in render_node
  723. result = node.render(context)
File "/opt/csw/lib/python/site-packages/django/template/
defaulttags.py" in render
  208. if (value and not ifnot) or (ifnot and not value):
File "/opt/csw/lib/python/site-packages/django/db/models/query.py" in
__len__
  105. return len(self._get_data())
File "/opt/csw/lib/python/site-packages/django/db/models/query.py" in
_get_data
  470. self._result_cache = list(self.iterator())
File "/opt/csw/lib/python/site-packages/django/db/models/query.py" in
iterator
  183. cursor.execute("SELECT " + (self._distinct and "DISTINCT " or
"") + ",".join(select) + sql, params)
File "/opt/csw/lib/python/site-packages/django/db/backends/util.py" in
execute
  12. return self.cursor.execute(sql, params)
File "/opt/csw/lib/python/site-packages/MySQLdb/cursors.py" in execute
  168. if not self._defer_warnings: self._warning_check()
File "/opt/csw/lib/python/site-packages/MySQLdb/cursors.py" in
_warning_check
  82. warn(w[-1], self.Warning, 3)
File "/opt/csw/lib/python/warnings.py" in warn
  62. globals)
File "/opt/csw/lib/python/warnings.py" in warn_explicit
  102. raise message

  Warning at /search/
  Incorrect date value: '%'2007'%' for column 'end' at row 1
Request information
GET
Variable        Value
q
"'2007'"
POST

No POST data
COOKIES

No cookie data
META
Variable        Value
AB_CARDCATALOG
'/usr/dt/share/answerbooks/C/ab_cardcatalog'
COLORTERM
'gnome-terminal'
CONTENT_LENGTH
''
CONTENT_TYPE
'text/plain'
DESKTOP_STARTUP_ID
''
DISPLAY
':0.0'
DJANGO_SETTINGS_MODULE
'mysite.settings'
DTAPPSEARCHPATH
'/export/home/jhartley/.dt/appmanager:/usr/dt/appconfig/appmanager/%L:/
usr/dt/appconfig/appmanager/C'
DTDATABASESEARCHPATH
'/export/home/jhartley/.dt/types,/usr/dt/appconfig/types/%L,/usr/dt/
appconfig/types/C'
DTDEVROOT
''
DTHELPSEARCHPATH
'/export/home/jhartley/.dt/help/jhartley-jonah-0/%H:/export/home/
jhartley/.dt/help/jhartley-jonah-0/%H.sdl:/export/home/jhartley/.dt/
help/jhartley-jonah-0/%H.hv:/export/home/jhartley/.dt/help/%H:/export/
home/jhartley/.dt/help/%H.sdl:/export/home/jhartley/.dt/help/%H.hv:/
usr/dt/appconfig/help/%L/%H:/usr/dt/appconfig/help/%L/%H.sdl:/usr/dt/
appconfig/help/%L/%H.hv:/usr/dt/appconfig/help/C/%H:/usr/dt/appconfig/
help/C/%H.sdl:/usr/dt/appconfig/help/C/%H.hv'
DTSCREENSAVERLIST
'StartDtscreenSwarm StartDtscreenQix StartDtscreenFlame
StartDtscreenHop StartDtscreenImage StartDtscreenLife
StartDtscreenRotor StartDtscreenPyro StartDtscreenWorm
StartDtscreenBlank'
DTSOURCEPROFILE
'true'
DTUSERSESSION
'jhartley-jonah-0'
DTXSERVERLOCATION
'local'
EDITOR
'/usr/dt/bin/dtpad'
GATEWAY_INTERFACE
'CGI/1.1'
GNOME_DESKTOP_SESSION_ID
'Default'
GNOME_KEYRING_SOCKET
'/var/tmp/keyring-Copz3W/socket'
GTK_RC_FILES
'/etc/gtk/gtkrc:/export/home/jhartley/.gtkrc-1.2-gnome2'
G_BROKEN_FILENAMES
'yes'
G_FILENAME_ENCODING
'@locale,UTF-8'
HELPPATH
'/usr/openwin/lib/locale:/usr/openwin/lib/help'
HOME
'/export/home/jhartley'
HTTP_ACCEPT
'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/
plain;q=0.8,image/png,*/*;q=0.5'
HTTP_ACCEPT_CHARSET
'ISO-8859-1,utf-8;q=0.7,*;q=0.7'
HTTP_ACCEPT_ENCODING
'gzip,deflate'
HTTP_ACCEPT_LANGUAGE
'en-us,en;q=0.5'
HTTP_CONNECTION
'keep-alive'
HTTP_HOST
'localhost:8000'
HTTP_KEEP_ALIVE
'300'
HTTP_USER_AGENT
'Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.7) Gecko/20060627'
LANG
'C'
LC_ALL
'C'
LC_CTYPE
'C'
LOGNAME
'jhartley'
MAIL
'/var/mail/jhartley'
MANPATH
'/usr/dt/man:/usr/man:/usr/openwin/share/man:/usr/share/man:/opt/csw/
man:/usr/local/man'
OLDPWD
'/export/home/jhartley/djcode/mysite'
OPENWINHOME
'/usr/openwin'
PATH
'/opt/SUNWspro/bin:/opt/csw/bin:/opt/csw/mysql5/bin:/usr/local/bin:/
usr/ccs/bin:/usr/bin:/usr/openwin/bin:/sbin:/usr/sbin'
PATH_INFO
'/search/'
PWD
'/export/home/jhartley/djcode/mysite/mts'
PYTHONPATH
'/home/jhartley/asu/languages/python/Programming_Python/examples'
QUERY_STRING
"q='2007'"
REMOTE_ADDR
'127.0.0.1'
REMOTE_HOST
''
REQUEST_METHOD
'GET'
RUN_MAIN
'true'
SCRIPT_NAME
''
SDT_NO_DTDBCACHE
'1'
SDT_NO_TOOLTALK
'1'
SERVER_NAME
'jonah.bigsky.dom'
SERVER_PORT
'8000'
SERVER_PROTOCOL
'HTTP/1.1'
SERVER_SOFTWARE
'WSGIServer/0.1 Python/2.5.1'
SESSIONTYPE
'altDt'
SESSION_MANAGER
'local/jonah:/tmp/.ICE-unix/844,inet6/jonah:32813,inet/jonah:32814'
SESSION_SVR
'jonah'
SHELL
'/bin/bash'
SHLVL
'2'
START_SPECKEYSD
'no'
TERM
'xterm'
TZ
'America/Los_Angeles'
USER
'jhartley'
WINDOWID
'12058668'
XFILESEARCHPATH
'/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%S'
XMBINDDIR
'/usr/dt/lib/bindings'
XMICONBMSEARCHPATH
'/export/home/jhartley/.dt/icons/%B%M.bm:/export/home/jhartley/.dt/
icons/%B%M.pm:/export/home/jhartley/.dt/icons/%B:/usr/dt/appconfig/
icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/
icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/
C/%B%M.pm:/usr/dt/appconfig/icons/C/%B'
XMICONSEARCHPATH
'/export/home/jhartley/.dt/icons/%B%M.pm:/export/home/jhartley/.dt/
icons/%B%M.bm:/export/home/jhartley/.dt/icons/%B:/usr/dt/appconfig/
icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/
icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/
C/%B%M.bm:/usr/dt/appconfig/icons/C/%B'
_
'/opt/csw/bin/python'
dtstart_sessionlogfile
'/dev/null'
wsgi.errors
<open file '<stderr>', mode 'w' at 0x806f0b0>
wsgi.file_wrapper
<class 'django.core.servers.basehttp.FileWrapper'>
wsgi.input
<socket._fileobject object at 0x86052cc>
wsgi.multiprocess
False
wsgi.multithread
True
wsgi.run_once
False
wsgi.url_scheme
'http'
wsgi.version
(1, 0)

This code DOES work correctly with mysql 5.0.27 and yields dataField
data properly

Has anyone run across this and if so is there a patch.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to