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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:52:14+00:00 2026-05-26T06:52:14+00:00

I need to build one instance of django admin that can be used by

  • 0

I need to build one instance of django admin that can be used by multiple companies.
the schema is :

Company1
     Branch 1
          User 1
          User 2
     Branch 2
          User 3
          .......

Company 2
     Branch 1
          User 4
          User 5
     Branch 2
          User 6
          .......

The idea behind this is that user 1 and 2 is able to see (but cannot edit ) user’s 3 stuff. Where as users 1 and 2 can see and edit each other’s content. All this within the Company1 scope (only).

My question is are there any devs out there who’s faced a similar problem and want to share their thoughts on how this can be achieved in dj admin? Any additional packages which can be utilized to extend dj admin functionality in right direction ?

Im aware that this challenges the idea of what was dj admin designed for (no need to caution about this ) … but since there isn’t enough hands to design and build something from a scratch for this project i need to tap into dj admin functionality as much as i can.

All thoughts will greatly be appreciated !

  • 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-26T06:52:15+00:00Added an answer on May 26, 2026 at 6:52 am

    I was in a similar situation, with the added requirement that a user may be in multiple companies, and can “switch”. For that purpose I put the “current company” into a session. If in your case you’d just be looking up in the user what they’re allowed to see, it should be very easy, by overriding ModelAdmin.queryset, for example:

    class CompanyGogglesAdmin(admin.ModelAdmin):
        def queryset(self, request):
            qs = super(CompanyGoggleAdmin, self).queryset(request)
            user_company = request.user.company
            return qs.filter(**{ 'company' : user_company })
    

    You could use CompanyGogglesAdmin as a base class for all those models that can be filtered by “company” which gets looked up by the user’s company. You could also make that company field configurable, or – like I did – look up the “current” company from a session rather than the user. See also How can I implement a global, implicit filter in Django admin?

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

Sidebar

Related Questions

I need a cache that responds to memory pressure like the one build-into ASP.NET.
I need a HtmlHelper instance in my controller. How can I instantiate one? thanks
I need to build simple site one big page like 37signals product's pages, and
I need to build several Rails applications for one client. I would like to
In one of my projects I need to build an ASP.NET page and some
I need to build a simple, single user database application for Windows. Main requirements
I need to build something that starts serving a H.264 encoded video to a
I need to setup a build development environment that includes the following Sonatype Nexus
I know that some companies allow you to install their products on build machines
I need to build a nested comments system in a Rails 3 application that

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.