On Thu, 18 Feb 2010 16:53:06 +0100, Gonzalo Delgado <gonzalo...@gmail.com>
wrote:
El 18/02/10 10:18, Boris Schaeling escribió:
This replaces the setter but not the getter.
To replace the getter, you'd have to override the modelform's __init__
method and set the corresponding field value from the instance getter.
I see. Then it means what I actually tried to do is impossible. I can't
use properties as described at
http://www.djangoproject.com/documentation/models/properties/ but should
overwrite save() and __init__() because for a property there is no way to
display a widget in a model form?
I would prefer to use a property because I want to pre- and post-process a
value from the database (exactly what properties are good for). Having the
original value from the database at the same time available in another
attribute (which is used by the property) would have also been nice (and
if only for debugging purposes) instead of messing with it in save() and
__init__().
Boris
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.