MadeR did you ever get to the bottom of this error? I am using python2.6.5,
django1.3.1, and tastypie0.9.7 with a mysql5.1 back end. Its a real doozy,
I have never seen it when developing locally, but once a week or so I'll
get an email from my production django server that has something like this
in it:
Traceback (most recent call last):
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/tastypie/resources.py",
line 175, in wrapper
response = callback(request, *args, **kwargs)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/tastypie/resources.py",
line 334, in dispatch_list
return self.dispatch('list', request, **kwargs)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/tastypie/resources.py",
line 364, in dispatch
response = method(request, **kwargs)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/tastypie/resources.py",
line 934, in get_list
objects = self.obj_get_list(request=request,
**self.remove_api_resource_names(kwargs))
File
"/var/www/TorrentGuru/releases/current/TorrentGuru/apache/../runrecognition/api.py",
line 178, in obj_get_list
return self.get_object_list(request)
File
"/var/www/TorrentGuru/releases/current/TorrentGuru/apache/../runrecognition/api.py",
line 339, in get_object_list
return get_weekly_winner_row_list(min_date=min_date, max_date=max_date)
File
"/var/www/TorrentGuru/releases/current/TorrentGuru/apache/../runrecognition/leaderboard_builder.py",
line 145, in get_weekly_winner_row_list
weeks = _build_query(weeks, min_date, max_date)
File
"/var/www/TorrentGuru/releases/current/TorrentGuru/apache/../runrecognition/leaderboard_builder.py",
line 135, in _build_query
initial_objects = initial_objects.filter(victory_date__gte=min_date)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/manager.py",
line 141, in filter
return self.get_query_set().filter(*args, **kwargs)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/query.py",
line 550, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/query.py",
line 568, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/sql/query.py",
line 1172, in add_q
can_reuse=used_aliases, force_having=force_having)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/sql/query.py",
line 1107, in add_filter
connector)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/sql/where.py",
line 67, in add
value = obj.prepare(lookup_type, value)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/sql/where.py",
line 316, in prepare
return self.field.get_prep_lookup(lookup_type, value)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
line 644, in get_prep_lookup
return super(DateField, self).get_prep_lookup(lookup_type, value)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
line 292, in get_prep_lookup
return self.get_prep_value(value)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
line 721, in get_prep_value
return self.to_python(value)
File
"/var/www/TorrentGuru/local-python/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
line 698, in to_python
return datetime.datetime(*time.strptime(value, '%Y-%m-%d %H:%M:%S')[:6],
AttributeError: _strptime_time
Any pointers you might have for me would be greatly appreciated.
On Thursday, March 10, 2011 12:03:31 PM UTC-5, MadeR wrote:
>
> The error was trapped by django-sentry and does *not* occur in python
> interpreter, thus I can't understand it!
> Please can anybody enlighten me?
>
> Here the details:
>
> Exception Type: AttributeError
> Exception Value: _strptime_time
>
> The error is raised by line #698 in
>
> /usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/db/models/fields/__init__.py
> in to_python using django 1.2.5:
>
> 698. return datetime.datetime(*time.strptime(value, '%Y-%m-%d
> %H:%M:%S')[:6],
> 699. **kwargs)
>
> With local variables:
>
> kwargs = {'microsecond': 0}
> self = u'<django.db.models.fields.DateTimeField object at 0x7fb780594210>'
> usecs = 0
> value = u'2011-02-24 00:00:00'
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/u0xnSVyhzdsJ.
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.