Thanks, Léon -- this was exactly what I was looking for!

Sincerely,
Saketh


On Tue, Jul 21, 2009 at 6:37 AM, Léon Dignòn <leon.dig...@gmail.com> wrote:

>
> You might take a look at this:
> http://docs.djangoproject.com/en/dev/ref/models/fields/#ref-models-fields
>
> models.py
> ----------------------------------------------------------------
> class Foo(models.Model):
>    GENDER_CHOICES = (
>        ('M', 'Male'),
>        ('F', 'Female'),
>    )
>    gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
>
>
> On Jul 20, 11:24 pm, Saketh <saketh.bhamidip...@gmail.com> wrote:
> > Hi everyone,
> >
> > I am making a user settings page for my application based on django-
> > registration and django-profiles, but I'm running into a small problem
> > in how I'd like the page to be laid out.
> >
> > My data model has a field that can take on only three values, 'A',
> > 'B', and 'C'. I have modeled this as a CharField with max_length=1.
> > I'd like the generated form in the edit_profile view to be a list box
> > with only those three options, rather than an actual character field,
> > but I'm not able to figure out how to do this -- the closest thing
> > I've found so far is here:
> http://birdhouse.org/blog/2009/06/27/django-profiles/.
> >
> > Is there a way that I can use the list box to work with the three-
> > valued field? Also, is there a more natural way to represent the
> > finitely-valued field in the model itself?
> >
> > Thanks!
> >
> > -Saketh
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to