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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:29:52+00:00 2026-05-16T11:29:52+00:00

Please forgive me if this question is ridiculous. I’m relatively new to programming and

  • 0

Please forgive me if this question is ridiculous. I’m relatively new to programming and Django.

Following the typical Publisher, Author, Book example….

Publisher to Author (One to Many)
Author to Book (One to Many)

I’m trying to get Django to give me a list of books published by all the authors under a single publisher.

Two ways I’ve thought about doing this:

  1. I could get a list of all the authors under a single publisher, and then iterate over these authors to find all of their books. This seems like a really wonky way to do this.. and I’ll have to hit the DB a lot.

  2. I can get Django to add a new “Publisher” column in my Books table, but I’m not sure if I want to replicate that data, and I don’t know how to get Django to automatically fill in that info.

I’d appreciate any help. Thanks.

  • 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-16T11:29:52+00:00Added an answer on May 16, 2026 at 11:29 am

    If each book has an author ForeignKey and each author has a publisher ForeignKey, you can do:

    Book.objects.filter(author__publisher = <Publisher object>)
    

    To get what you’re looking for.

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

Sidebar

Related Questions

I'm new to Flash development so please forgive the simplicity of this question... I'm
I'm new to testing, so please forgive me for this question In the cakephp
I'm new to jquery and asp.net so please forgive if this is an obvious
Please forgive if this question has been asked numerous times. I recently installed Eclipse
Please forgive me if this question is dense. Background: We have several internal applications
This is my first post, so please forgive me if this question has been
Please forgive the awkwardness of this question, I honestly don't know how to phrase
First off, please forgive the stupidness of this question but Im not from a
Please forgive any short-comings in this question; flash is not my area of expertise,
Forgive my probably incorrect application of terminology in this question (btw, please correct me

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.