id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 7560,Delegate (most) type conversion to backends,Leo Soto M.,Malcolm Tredinnick,"As discussed on the [http://groups.google.com/group/django-developers/browse_thread/thread/fb1afa93451008a2 Mailing] [http://groups.google.com/group/django-developers/browse_thread/thread/2f2a290ce3295860/43b56152c78cc892 list] and on IRC, some backends would be greatly simplified if they stop receiving string values for non-basic types, such as dates and decimal. This patch delegates most of the `get_db_prep_*` logic of these fields to backend methods (named `value_to_db_something` where `something` is date, time, decimal, etc) It also implements `get_db_prep_*` for basic field types to avoid leaking string values. For Jython/zxJDBC compatibility purposes, an special check was made on `Field.get_db_prep_lookup` and `'year'` lookup. I was not able to understand it, so I choose to introduce as few modifications as possible there. It could be a good idea to delegate that logic to the backend too, but I think a second opinion is needed. Finally, `PhoneNumberField` doesn't inherits from `IntegerField` anymore. There was no point on such inheritance, as phones are mapped to varchar fields on every backend. Not to mention that every method declared by `IntegerField` was overriden by `PhoneNumberField`. This was tested against mysql, postgresql, oracle and sqlite3, and didn't broke anything (that wasn't already broken on trunk, at least).",,closed,"Database layer (models, ORM)",dev,,fixed,jython db-be-api,,Unreviewed,1,0,0,0,0,0