Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8713321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:18:54+00:00 2026-06-13T05:18:54+00:00

I have a dropdown field that only needs to store two values on the

  • 0

I have a dropdown field that only needs to store two values on the backend, as users will always be choosing between the home team and the away team. The away team, of course, will change week to week.

Ideally, all I would do is change the display text on the {{ form.field }}. So, for example:

<option value="Opponent">Opponent</option>

would display as

<option value="Opponent">OSU</option>

I’ve tried a few approaches. At first, I hand-coded the various form fields, but then I didnm’t get errors when invalid data was entered. I’m toying now with a template tag that would use replace(), but so far I’m not having any luck.

Any ideas? I feel like there’s something basic I’m missing. Thanks much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:18:55+00:00Added an answer on June 13, 2026 at 5:18 am

    choices can be any iterable, so define one that looks up the team name:

    class ChoiceList(object):
        def __iter__(self):
            yield ("home", "Home")
            yield ("opponent", get_weekly_opponent_name())
    
    team = fields.ChoiceField(choices=ChoiceList())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dropdown. I need to bind with two field of datatable value
I am trying to have a choicefield that only displays the users with the
I have a form that has a field that needs to be rendered as
I have some html that creates a dropdown list. The list has text values
I have a dropdown selector, with values from 1-4. Depending on the selection, subsequent
I have two dropdown ddlCountry and ddlState and one button Submit. While ddlstate is
I have a big form, that will be serialized by a jQuery function. The
I have a simple PHP script with a form that has two select fields,
I have a date field that I populate a dropdownlist with. The date field
I am creating a form that needs to have 30 or more fields either

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.