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 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
  • 4 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 am very new to programming, so please forgive me if this question seems
I'm really new to programming, so I'm having trouble explaining this -- please forgive.
I'm new to Flash development so please forgive the simplicity of this question... I'm
Please forgive this rather basic question, but I'm very new to Java and still
I am new to PHP so please forgive if this question or problem seem
I'm new to testing, so please forgive me for this question In the cakephp
I am a learning via a book so please forgive this newbie question. I
I’m very new to programming with RSS feeds to please forgive me if this
Please try to forgive this slightly off-programming-topic question. At least I'm getting this problem
After-edit: Wow, this question go long. Please forgive =\ I am creating a new

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.