Hi there,
I think what you've figured out is something along the same lines that
I'd like to do - but I'm very new to both Python and Django, so please
pardon my ignorance in that I really didn't understand the solution
you two spoke about.
Here's what I'd like to do...
I've two models, one for
Ah, that makes sense, thanks. With that change, I can use _meta.fields from
my other model and everything works great.
Thanks for the help
On Wed, Mar 11, 2009 at 12:53 PM, Alex Gaynor wrote:
>
>
> On Wed, Mar 11, 2009 at 11:50 AM, Alex Jillard wrote:
>
>> If I override get_form in ShelfAdmin
On Wed, Mar 11, 2009 at 11:50 AM, Alex Jillard wrote:
> If I override get_form in ShelfAdmin, I still get the same errors.
> self.fields is still None...any idea how to get access to the fields?
>
> On Wed, Mar 11, 2009 at 12:26 PM, Alex Gaynor wrote:
>
>>
>>
>> On Wed, Mar 11, 2009 at 11:18 AM,
If I override get_form in ShelfAdmin, I still get the same errors.
self.fields is still None...any idea how to get access to the fields?
On Wed, Mar 11, 2009 at 12:26 PM, Alex Gaynor wrote:
>
>
> On Wed, Mar 11, 2009 at 11:18 AM, Alex Jillard wrote:
>
>> Sorry Alex, I should have been more clea
On Wed, Mar 11, 2009 at 11:18 AM, Alex Jillard wrote:
> Sorry Alex, I should have been more clear, I need to access the fields of
> another model. I went ahead and did what you said to try and get it
> working, and I was able to get the fields from the form's model, but I get
> an error when try
Sorry Alex, I should have been more clear, I need to access the fields of
another model. I went ahead and did what you said to try and get it
working, and I was able to get the fields from the form's model, but I get
an error when trying to assign them to the choices property of my field.
The fol
On Wed, Mar 11, 2009 at 10:33 AM, Alex Jillard wrote:
> I'm trying to populate an admin form with the field names of of a model
> class, but I don't want to have to instantiate that model just to read it's
> fields from _meta.
>
> I basically want to do something like this:
>
> self.fields['sort_
I'm trying to populate an admin form with the field names of of a model
class, but I don't want to have to instantiate that model just to read it's
fields from _meta.
I basically want to do something like this:
self.fields['sort_by'].choices = [(field.verbose_name, field.name) for field
in field_
8 matches
Mail list logo