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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:07:26+00:00 2026-06-01T16:07:26+00:00

If this is too complicated or not the right way to do things, feel

  • 0

If this is too complicated or not the right way to do things, feel free to link me to something else or just tell me I should do it another way…

Basically, I’m working on a project where there are Clients, and each one has an arbitrary number of Websites attached to it. So the Websites model has a ForeignKey to the Client model. The Website admin page is pretty in-depth, and each Client might have 10 or more sites, so I’d rather not have them all display as inlines, because that’s really messy and crazy looking.

What I’d like is that when you go to the admin panel and click Clients, you’re brought to the change page where it has the basic stuff you’d edit for the client and then an inline of actual links to each of the client’s website admin pages. Like this:

Change client

General

Name:

Address:

Phone:

Websites

Link to edit Website 1

Link to edit Website 2

Link to edit Website 3

Link to edit Website 4

Link to edit Website 5

  • 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-01T16:07:27+00:00Added an answer on June 1, 2026 at 4:07 pm

    You can use a TabularInline that includes only a link to the model change page:

    class ClientAdmin(admin.ModelAdmin):
        # everything as normal
        inlines = WebsiteInline,
    
    class WebsiteInline(admin.TabularInline):
        model = Website
        fields = 'link',
        readonly_fields = 'link',
        def link(self, instance):
            url = reverse("admin:myapp_website_change", args = (instance.id,))
            return mark_safe("<a href='%s'>%s</a>" % (url, unicode(instance)))
    
    admin.site.register(Client, ClientAdmin)
    admin.site.register(Website)
    

    See my recent question How do I add a link from the Django admin page of one object to the admin page of a related object? which was about how to do exactly this, but with several pairs of models rather than just one.

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

Sidebar

Related Questions

EDIT: This got way too complicated, I will migrate this question to another question
Maybe I'm just thinking about this too hard, but I'm having a problem figuring
Sorry if this is too remedial or repetitive in any way but I need
Probably very simple question (I just want to ensure I'm right). Title is not
This is a follow-up question to a different question I asked not too long
It's a long question but not too complicated so please bear with me. I'm
I'm new to SQL, so this isn't too complicated. I have two tables, with
Hey folks, this question can't be too complicated. Please provide a solution to at
Heads starting to hurt. I think I dropped into this too fast... Perhaps someone
Apologies if this is too ignorant a question or has been asked before. A

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.