﻿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
6152	django.db.models.Field.to_python not called by QuerySet	Daniel Pope	nobody	"The to_python function is intended to convert a database representation to a Python object. In Django SVN this function is not called when Model instances are loaded. In built-in fields this omission no effect because the Python DB-API also has a mapping which, coincidentally, converts to the correct types.

However, for user-defined Fields, to_python must be called or the field is assigned the raw database type.

I wonder if the correct solution is to call obj.validate() (which calls to_python() for all fields) just before yielding the obj in [http://code.djangoproject.com/browser/django/trunk/django/db/models/query.py#L209 QuerySet.__iter__]. This, at least, is how I have patched my installation in order to make user-defined fields work as intended."		closed	Database layer (models, ORM)	dev		invalid			Unreviewed	0	0	0	0	0	0
