Re: Transform model field to custom form field when creating from instance

2011-07-28 Thread bruno desthuilliers
On 28 juil, 23:04, "arkai...@gmail.com" wrote: > On Thu, Jul 28, 2011 at 9:58 PM, bruno desthuilliers < > >> the __init__ method looks like the right place to handle this. First >> make sure you exclude the related field from the ModelForm (cf the doc >> for ModelForms on how to do this) and add y

Re: Transform model field to custom form field when creating from instance

2011-07-28 Thread arkai...@gmail.com
On Thu, Jul 28, 2011 at 9:58 PM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > I use a CharField and a > > clean_test(): to convert the comma separated list of test names to a > > list of Test objects and this works perfectly. > > Err... How do this work for not yet existing Test

Re: Transform model field to custom form field when creating from instance

2011-07-28 Thread bruno desthuilliers
In 28 juil, 19:00, Arkaitz Jimenez wrote: > Hi, > > I created a PostForm, ModelForm for Post model that has a ManyToMany > relationship with a model called Test, I use a CharField and a > clean_test(): to convert the comma separated list of test names to a > list of Test objects and this works per