﻿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
13354	Possible bug, or possible docs error.	Oroku Saki	nobody	"I wanted to use this to return empty strings for password fields, and {{{ $50.00 }}} format for money that's stored as a decimal. You can imagine my surprise when I found out that I was trying to save {{{ $50.00 }}} to a decimal field, and {{{ '' }}} as somebody's password. The confusion arose from this:

In the following docs, it says that {{{ get_prep_value() }}} is the reverse of {{{ to_python() }}} (which would infer that {{{ get_prep_value() }}} is used to prepare incoming data, and {{{ to_python() }}} is used on outgoing data.

http://docs.djangoproject.com/en/dev/howto/custom-model-fields/#converting-python-objects-to-query-values

However, upon inspection of the code I found the following.

{{{
    def get_prep_value(self, value):
        return self.to_python(value)
}}}

They are in fact not the reverse of each other, but in some cases one in the same, since one uses the other for implementation.

I'm starting this as a '''ORM ticket''' rather than a docs ticket, only because with the above mentioned there doesn't appear to be a possible way to have a field output a modified value without also modifying it on the way in.


orokusaki"		closed	Database layer (models, ORM)	dev		invalid		Oroku Saki Karen Tracey	Unreviewed	0	0	0	0	0	0
