Opened 18 years ago

Closed 17 years ago

#4433 closed (invalid)

typo in django/db/models/fields/__init__.py

Reported by: Krzysztof Sitarski <sit0@…> 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)

4433.patch (571 bytes ) - added by Krzysztof Sitarski <sit0@…> 18 years ago.

Download all attachments as: .zip

Change History (7)

by Krzysztof Sitarski <sit0@…>, 18 years ago

Attachment: 4433.patch added

comment:1 by Adrian Holovaty, 18 years ago

Are you sure this is a typo? It's been working thus far...

Could you explain what the problem is?

comment:2 by patrys@…, 18 years ago

Exception Type:  	AttributeError
Exception Value: 	'str' object has no attribute 'strftime'

comment:3 by patrys@…, 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 Malcolm Tredinnick, 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 patrys@…, 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 Simon G. <dev@…>, 17 years ago

Resolution: invalid
Status: newclosed

Marked as invalid unless someone can please give some more information?

Note: See TracTickets for help on using tickets.
Back to Top