> 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
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
> 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
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
>
> 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
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
> 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
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
> 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
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
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
11 matches
Mail list logo