Re: ModelChoiceField help

2009-05-20 Thread Bobby Roberts
> Sure, label_for_instance gets the object itself, with all it's fields.  So > isntead of returning the string with the id number, change it to return: > obj.name. > > Alex PERFECT! Thanks a lot! --~--~-~--~~~---~--~~ You received this message because you are subs

Re: ModelChoiceField help

2009-05-20 Thread Alex Gaynor
On Wed, May 20, 2009 at 2:05 PM, Bobby Roberts wrote: > > > > Your class should inherit from "forms.ModelChoiceField", not just > > ModelChocieField. > > > > Alex > > > Ok i'm getting somewhere! Thanks for your patience. I'm still > finding my python / django legs. This populates the dropbox w

Re: ModelChoiceField help

2009-05-20 Thread Bobby Roberts
> Your class should inherit from "forms.ModelChoiceField", not just > ModelChocieField. > > Alex Ok i'm getting somewhere! Thanks for your patience. I'm still finding my python / django legs. This populates the dropbox with My Object #1 My Object #2 My Object #3 I see why it's dong that in

Re: ModelChoiceField help

2009-05-20 Thread Alex Gaynor
On Wed, May 20, 2009 at 1:38 PM, Bobby Roberts wrote: > > > You don't access the class at forms.MyModeChoiceField, since it doesn't > live > > in that namespace. You access it with just MyModelChocieField, since > it's > > defined in the same file. As a note, you're going to want to have the >

Re: ModelChoiceField help

2009-05-20 Thread Bobby Roberts
> You don't access the class at forms.MyModeChoiceField, since it doesn't live > in that namespace.  You access it with just MyModelChocieField, since it's > defined in the same file.  As a note, you're going to want to have the > MyModelChoiceField class before your form (in the file), otherwise

Re: ModelChoiceField help

2009-05-20 Thread Alex Gaynor
On Wed, May 20, 2009 at 12:32 PM, Bobby Roberts wrote: > > > You aren't actually using that Field though, you need to use it in place > of > > ModelChoiceField where you want that behavior. > > > > Alex > > > here's what i've got: > > class FrmWebPage (forms.Form): >active = forms.ChoiceField

Re: ModelChoiceField help

2009-05-20 Thread Bobby Roberts
> You aren't actually using that Field though, you need to use it in place of > ModelChoiceField where you want that behavior. > > Alex here's what i've got: class FrmWebPage (forms.Form): active = forms.ChoiceField(required=True, choices=active_choices, widget=forms.RadioSelect(attrs={'cla

Re: ModelChoiceField help

2009-05-20 Thread Alex Gaynor
On Wed, May 20, 2009 at 10:38 AM, Bobby Roberts wrote: > > > Take a look at label_from_instance: > http://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield > > > > Alex > > > > yeah I'm lookin at that but it makes no sense to me. > > Here's what i have and it's not working: > > fro

Re: ModelChoiceField help

2009-05-20 Thread Bobby Roberts
> Take a look at > label_from_instance:http://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield > > Alex > yeah I'm lookin at that but it makes no sense to me. Here's what i have and it's not working: from django import forms from web_pages.models import PageCategory from templa

Re: ModelChoiceField help

2009-05-20 Thread Alex Gaynor
On Wed, May 20, 2009 at 10:00 AM, Bobby Roberts wrote: > > Hi Group. Please look at this snippet from my forms. It uses two > ModelChoiceFields as shown below. Each database table currently has 2 > records. > > On the webpage, when the form is being called, the options are like > this: > > Tem

ModelChoiceField help

2009-05-20 Thread Bobby Roberts
Hi Group. Please look at this snippet from my forms. It uses two ModelChoiceFields as shown below. Each database table currently has 2 records. On the webpage, when the form is being called, the options are like this: Template object Template object and PageCategory object PageCategory obje