Re: Retrieving choices from model->field->choices

2006-01-16 Thread Mike
Thanks guys, Person._meta.get_field('height').get_choices() worked just fine. Needed it for my custom manipulator. Regards, Mike

Re: Retrieving choices from model->field->choices

2006-01-16 Thread Russell Keith-Magee
On 1/16/06, Mike <[EMAIL PROTECTED]> wrote: > > How do I do that? To retrieve a field's choices from the model? > > class Person(meta.Model): > height = meta.CharField(maxlength=100, > choices=(('tall','Tall'),('short','Short'))) > > >>> Person.height.choices # In the magic removal branch

Re: Retrieving choices from model->field->choices

2006-01-15 Thread tonemcd
How about creating a method in the model (untested!) def mychoices(self): return self.choices then its >>> a = Person.get_list() >>> a[0].choices() (I think) Cheers, Tone

Retrieving choices from model->field->choices

2006-01-15 Thread Mike
How do I do that? To retrieve a field's choices from the model? class Person(meta.Model): height = meta.CharField(maxlength=100, choices=(('tall','Tall'),('short','Short'))) >>> Person.height.choices # Thanks, Mike