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 8632721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:23:26+00:00 2026-06-12T09:23:26+00:00

I am limiting the ContentType choices for a Generic Relation using limit_choices_to but it

  • 0

I am limiting the ContentType choices for a Generic Relation using limit_choices_to but it shows models that no longer exist. For example with this code:

 employer_content_type = models.ForeignKey(ContentType,
    limit_choices_to={"model__in": ('venue', 'festival')}, related_name="employer")

I get a list of choices that has duplicates, i.e. festival, festival, venue, venue

However when I limit the choices by app rather then just models like this:

    employer_content_type = models.ForeignKey(ContentType,
          limit_choices_to={'app_label': 'contacts'}, related_name="employer")

I get a list of all of the models with no duplicates, i.e. address, email, festival, venue

At one point in my development I created a new app (“contacts”) that was a duplicate of an older app. All of the models had the same names etc. At first I thought that this was causing the duplicates but the problem didn’t go away after I removed the old app from settings.py and deleted the old models form the database.

I think it is a cache issue but I never set up caching!

SO how do I either clear the cache, or limit the choices by model and app at the same time.

Thanks for your help!

Note: Unfortunately I couldnt add pictures so its a little hard to describe!

  • 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-12T09:23:27+00:00Added an answer on June 12, 2026 at 9:23 am

    Look for contentypes_contentype db table and delete obsolete models there. syncdb should also prompt you to delete obsolete models from content type table.

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

Sidebar

Related Questions

It seems that running Archiva using Jetty is limiting me to of file upload.
I am limiting my input to only accept this characters: apostrophe ' open parenthesis
I am trying to improve performance by limiting my objects in memory by using
I am writing a function that needs to catch a rate-limiting error while pinging
I am using IIS and JRun to serve coldfusion application. Something is limiting maximum
I'm having a bit of trouble limiting the duration of this oscillator to around
Instead of using NVarchChar (max) for my field I am limiting the lengths arbitrarily.
I use CSS transitions pretty frequently now but find it limiting to only have
I have a query that returns a large amount of results, so i'm limiting
I have the following model field: name = models.ForeignKey(User, unique=False, editable=False, limit_choices_to= {'is_staff': False})

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.