Opened 18 years ago
Closed 17 years ago
#4433 closed (invalid)
typo in django/db/models/fields/__init__.py
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
in line 500 (DateTime.get_db_prep_save) there should be:
value = time.strptime(value, '%Y-%m-%d')
instead of:
value = value.strftime('%Y-%m-%d')
Attachments (1)
Change History (7)
by , 18 years ago
Attachment: | 4433.patch added |
---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Exception Type: AttributeError Exception Value: 'str' object has no attribute 'strftime'
comment:3 by , 18 years ago
BTW, I believe this was caused by using raw request.POST instead of Form.cleaned_data. This is not my code and I just fixed a similar "error" that was caused by using wrong data source
comment:4 by , 18 years ago
We are still no closer to establishing if this is a problem in Django or not. What do you have to do to replicate this problem. Merely posting the exception does not give steps to reproducing.
As Adrian mentioned, there is already a lot of code using that code path, so it must be something unusual that is being done to trigger this. A small example that demonstrates the problem would be ideal here.
comment:5 by , 18 years ago
Please notice that I am not the one who filed the bug. I just saw a production code hitting the same line that the patch changes and after going through the code I found out the reason was a call to a model constructor that used request.POST instead of form.cleaned_data
comment:6 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Marked as invalid unless someone can please give some more information?
Are you sure this is a typo? It's been working thus far...
Could you explain what the problem is?