Re: setting choices on choice field dynamically according to objects current state

2009-05-27 Thread Simon Davies
Thanks v What you said echoes what I found on a posting on djangosnippet.org about populating the choices in the init field. It works fine now. On May 26, 9:30 am, V wrote: > On May 25, 1:27 pm, Simon Davies wrote: > > > > > I have a choices field called status in my model form which can be s

Re: setting choices on choice field dynamically according to objects current state

2009-05-26 Thread V
On May 25, 1:27 pm, Simon Davies wrote: > I have a choices field called status in my model form which can be set > to a number of values, however the options available will be based on > its current state something like this, so it needs to refer to itself: > > class ContractForm(ModelForm): > >

setting choices on choice field dynamically according to objects current state

2009-05-25 Thread Simon Davies
I have a choices field called status in my model form which can be set to a number of values, however the options available will be based on its current state something like this, so it needs to refer to itself: class ContractForm(ModelForm): def getStatusChoices() if status == 'r':