Re: inspect a model's field's option's values

2008-10-31 Thread Mark Wolgemuth
That's exactly what I'm looking for. I'll probably try adding that feature to the model base class or as a mixin. @classmethod def get_field_option_by_name(self, fieldname, optionname): field = self._meta.get_field_by_name(fieldname)[0] return getattr(fieldname, optionname) possibly with

Re: inspect a model's field's option's values

2008-10-30 Thread bruno desthuilliers
On 30 oct, 14:26, Mark Wolgemuth <[EMAIL PROTECTED]> wrote: > It seems like I'm missing something, but here's what I'm trying to do: > > In creating a Form object, I'm setting size limit validation > (max_length). I'd like to recover the value for that from the > corresponding Model's Field's ma

inspect a model's field's option's values

2008-10-30 Thread Mark Wolgemuth
It seems like I'm missing something, but here's what I'm trying to do: In creating a Form object, I'm setting size limit validation (max_length). I'd like to recover the value for that from the corresponding Model's Field's max_length. So basically I want a symbol lookup that will inspect in the