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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:59:31+00:00 2026-05-23T08:59:31+00:00

I have two classes in a model . One is Sdr_Layer class . Other

  • 0

I have two classes in a model .

One is Sdr_Layer class .

Other is a Test class .

Sdr_Layer has all these as attributes .
Layer_id
Layer_name
Layer_attribute_names

Test class is this

Sdr_Layer.Layer_id as the foreign key and also the primary key .
Layer_attribute_values

From one template , an user is allowed to search for all the types of Layers ( Test1 , Test2 , Test3 ) all are different tables .

Once he/she selects Test1 or Test2 or Test3 , its passed to this app that contains the model . A query is set to find out which one he/she choose ( Test1 , Test2 , Test3) . If the user has choosen Test1 , then the attributes are derived to be put into a form which is then mapped .

Where I am stuck is this , what should be the query set that gives me all the attribute_values if the user chooses Test1 .

Test1.objects.all() . This can be done , but it only serves the purpose if the user only chooses Test1 . What if the user chooses Test2 . Thus the problem . I hope I explained the problem

  • 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-23T08:59:31+00:00Added an answer on May 23, 2026 at 8:59 am

    I don’t exactly understand what you are trying to do, but looks to me like, you need 1 base model so you can filter on a certain attribute of it.

    Test.object.filter(type=1)
    Test.object.filter(type=2)
    

    should help. Having multiple DB tables wouldn’t help if you want to see all those in a given query.

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

Sidebar

Related Questions

Let's say I have two models, Classes and People. A Class might have one
I have two classes, Portfolio, and PortfolioImage. class PortfolioImage(models.Model): portfolio = models.ForeignKey('Portfolio', related_name='images') ...
I have two classes, and want to include a static instance of one class
I have two classes, one is Post and the other is Category, with a
I have two Django model classes that are structured similar to the following: class
I have defined two models where each one references the other, like so: class
Given two model classes, Foo and Bar , I want Foo to have 3
I have a hibernate model with two classes, let's say A and B. B
I have two classes, Foo and Bar, that have constructors like this: class Foo
I have two classes that each need an instance of each other to function.

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.