Opened 18 years ago
Closed 18 years ago
#3044 closed enhancement (invalid)
Add datetime check to django.db.backends.util date/time functions
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | minor | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently if you pass datetime types to the typecast_time and typecast_timestamp functions, they throw TypeErrors. A simple change enhances the functionality of these functions (attached a patch) in that if you pass a date/time/datetime, it simply returns it. Passing a different type to a function of the wrong type still returns raises exceptions as it does now.
Patch is against changeset:4086.
Attachments (1)
Change History (3)
by , 18 years ago
Attachment: | util.py.diff added |
---|
comment:1 by , 18 years ago
Why is this needed? Those conversion functions are only intended for use by database backends and if a backend can do the conversion to Python datetime types natively, it doesn't need to call the conversion functions. Is there are backend that does not behave this way?
comment:2 by , 18 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
This isn't needed anymore, no. At the time, MySQLdb for Win32 was doing some wonky things, but I think it has evened out. I haven't used the patch since shortly after I posted it.
django\db\backends\util.py patch