Re: ModelAdmin,get_form or Field._get_val_from_obj

2010-07-13 Thread Massimiliano della Rovere
It seems that modifying context['adminform'].form.instance or obj in render_change_form has no impact on the rendered html. Where does the admin interface take the values to display from? On Tue, Jul 13, 2010 at 10:28, Massimiliano della Rovere wrote: > I need to "decode" the value of the fields

Re: ModelAdmin,get_form or Field._get_val_from_obj

2010-07-13 Thread Massimiliano della Rovere
Hi Daniel, choices is how it is currently implemented, but it has 2 flaws: 1) this happens for all records, just when they are loaded; 2) the "translator" function, checks if the int can be used as a key to retrieve the meaning, else (KeyError) it returns 'currently unused'. 3) the choice solution

Re: ModelAdmin,get_form or Field._get_val_from_obj

2010-07-13 Thread Daniel Roseman
On Jul 13, 9:28 am, Massimiliano della Rovere wrote: > I need to "decode" the value of the fields of ModelAdmin.form so that, > for some fields, the int value is translated in a string showing its > meaning. > I do not want to implement this in the Model class (using > Model.to_python or Model.for

ModelAdmin,get_form or Field._get_val_from_obj

2010-07-13 Thread Massimiliano della Rovere
I need to "decode" the value of the fields of ModelAdmin.form so that, for some fields, the int value is translated in a string showing its meaning. I do not want to implement this in the Model class (using Model.to_python or Model.formfield for example), because the information displayed in the co