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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:28:14+00:00 2026-05-23T13:28:14+00:00

I have a four classes: class A(models.Model): field1 = models.BooleanField(default = True) class Meta:

  • 0

I have a four classes:

class A(models.Model):
    field1 = models.BooleanField(default = True)

    class Meta:
        abstract = True


class B(models.Model):
    field2 = models.BooleanField(default = True)
    sites = models.ManyToManyField(Site)

    class Meta:
        abstract = True

class C(A,B):
    field3 = models.BooleanField(default = True)

    class Meta:
        abstract = True

and

class D(C):
    field4 = models.BooleanField(default = True)

Only class D is in models.py in my app. Others is imported from diffrent files. Fields of classess A anb B are being used in many models. I created class D because i want to have generic admin panel from Django.

However, if i use this code:

obj = D()
model_class = obj.__class__
items = model_class.objects.filter(sites__id__exac=1)

i get the error:

Join on field 'id' not permitted. Did you misspell 'exac' for the lookup type?

Why?

  • 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-23T13:28:14+00:00Added an answer on May 23, 2026 at 1:28 pm

    You’re missing a few letters:

    https://docs.djangoproject.com/en/1.3/ref/models/querysets/#exact

    More importantly, you shouldn’t need to do an __exact on an ID field, just do:

    items = model_class.objects.filter(sites__id=1)
    

    or

    items = model_class.objects.filter(sites__id__in=[1])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have four classes, let's call S1, S2, S3 and S4. These class are
I have got four classes A , B , C and D . Class
I have four classes: class A {}; class B : virtual public A {};
I have the following PHP Classes class.property.php class.location.php class.amenity.php class.category.php all four classes handles
I have four classes. Request, DerivedRequest, Handler, DerivedHandler. The Handler class has a property
I have four classes which share some arrangement of four properties. I have currently
Say I have four sub-classes of 'Car'. One for each color. I want to
I have an abstract class: public abstract class LMManager<ENTITY, ILM_ENTITY> where ENTITY : ILM_ENTITY,
I have one interface that contains four functions. I have about 20 classes that
Say if I have four functions as below: def foo(): subprocess.Popen('start /B someprogramA.exe', shell=True)

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.