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

  • SEARCH
  • Home
  • 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 7664959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:26:17+00:00 2026-05-31T14:26:17+00:00

Given below is my Model definition and I have added this module part of

  • 0

Given below is my Model definition and I have added this module part of the Admin. I’m trying to create new row and while selecting value ‘3’ or any other value for Duration field(listed as select fields), I get the following error.- “Value 3 is not a valid choice”.

Please provide your inputs.

Model Definition
NO_OF_HRS = (
(‘1′,’One’),
(‘2′,’Two’),
(‘3′,’Three’),
(‘4′,’Four’),
(‘5′,’Five’),
(‘6′,’Six’),
(‘7′,’Seven’),
(‘8′,’Eight’),
(‘9′,’Nine’),
(’10’,’Ten’),
(’11’,’Eleven’),
(’12’,’Twelve’),
)

YR_MONTH = (
("Y", "Year"),
("M", "Month"),
)

POS_STATUS = (
("A", "Active"),
("C", "Closed"),
)

datecreated   = models.DateTimeField()
volposition   = models.CharField(max_length=300)
roledesc      = models.CharField(max_length=5000)
noofhours     = models.IntegerField(blank = True,null = True)
Qualreqt      = models.CharField(max_length=8000)
Duration      = models.IntegerField(choices=NO_OF_HRS,blank = True,null = True)
Durationyrmon = models.CharField(choices=YR_MONTH,max_length=10)
posstatus     = models.CharField(choices=POS_STATUS,max_length=1)
teamrelation  = models.CharField(max_length=50)
  • 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-05-31T14:26:19+00:00Added an answer on May 31, 2026 at 2:26 pm

    When you use choices, the first value of the tuple is the value that will be stored in the database and the second value is the value that will be shown in the admin.

    In NO_OF_HRS the values are strings (for example ‘1’, ‘2’) but it is a models.IntegerField so the values should be integers. That’s why you’re now getting an error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Entity Framework. I have a model as given below. Since
I have the HTML given below: <ul id=thumbsPhotos> <li src=/images/1alvaston-hall-relaxing-lg.jpg onclick=updatePhoto (this.title)><img src=/images/1alvaston-hall-relaxing-sl.jpg width=56
I've got the below model. I am trying to delete a given productType associated
I have a xml given below: <root title=الصفحة الرئيسة> <item title=الصفحة الرئيسة itemuri=tcm:8-29-4 ShowInNav=True
I am trying to convert an array of the RECT structure (given below) into
I have a class with a set of properties As given below. class ContactInfo
I have a data structure which is as given below: class File { public
I have a table defnition as given below: License ClientId Type Total Used ClientId
This example is from the Django documentation . Given the (Django) database model: class
I have uploaded a part of my screen below It is part of a

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.