I'm sorry for writing at such an early, clueless time in my learning
process (both with python and django) but this problem appears to be
in code I didn't write and I'm not sure what the best way to work
around this problem is. I'm sorry for not having lurked more to
understand the norms of this group, but I need to jump right into
learning this.
If there is a better way for me to look for help for something like
this, please let me know.
When saving an event model in the built-in Django Admin, I get this
error:
AttributeError at /admin/calendar/event/add/
'module' object has no attribute 'day_abbr'
Request Method: POST
Request URL:
http://127.0.0.1:8000/admin/calendar/event/add/
Exception Type: AttributeError
Exception Value: 'module' object has no attribute 'day_abbr'
Exception Location: C:\Python25\lib\_strptime.py in __calc_weekday,
line 94
My model code is as follows:
from django.db import models
class Event(models.Model):
eventName = models.CharField(maxlength=63)
#eventDate = models.DateField()
start_time = models.DateTimeField()
end_time = models.DateTimeField()
eventLocation = models.CharField(maxlength = 63)
eventDetails = models.TextField()
def __str__(self):
return self.eventName
class Admin:
list_display = ('eventName', 'eventLocation',)
list_filter = ('eventLocation',)
ordering = ('-eventDate',)
search_fields =('eventName','eventLocation',)
I don't know if the traceback is helpful here, but I figured it was
easier to include now rather than later. (If this is not the cultural
norm here, please let me know.)
Traceback (most recent call last):
File "C:\Python25\lib\site-packages\django\core\handlers\base.py" in
get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "C:\Python25\lib\site-packages\django\contrib\admin\views
\decorators.py" in _checklogin
55. return view_func(request, *args, **kwargs)
File "C:\Python25\lib\site-packages\django\views\decorators\cache.py"
in _wrapped_view_func
39. response = view_func(request, *args, **kwargs)
File "C:\Python25\lib\site-packages\django\contrib\admin\views
\main.py" in add_stage
251. manipulator.do_html2python(new_data)
File "C:\Python25\lib\site-packages\django\oldforms\__init__.py" in
do_html2python
103. field.convert_post_data(new_data)
File "C:\Python25\lib\site-packages\django\oldforms\__init__.py" in
convert_post_data
335. converted_data = [self.__class__.html2python(data) for data in
d]
File "C:\Python25\lib\site-packages\django\oldforms\__init__.py" in
html2python
822. time_tuple = time.strptime(data, '%Y-%m-%d')
File "C:\Python25\lib\_strptime.py" in
272. _TimeRE_cache = TimeRE()
File "C:\Python25\lib\_strptime.py" in __init__
191. self.locale_time = LocaleTime()
File "C:\Python25\lib\_strptime.py" in __init__
74. self.__calc_weekday()
File "C:\Python25\lib\_strptime.py" in __calc_weekday
94. a_weekday = [calendar.day_abbr[i].lower() for i in range(7)]
AttributeError at /admin/calendar/event/add/
'module' object has no attribute 'day_abbr'
Thank you for your assistance?