Code Monkey home page Code Monkey logo

Comments (3)

kamilgregorczyk avatar kamilgregorczyk commented on July 17, 2024

my solution

def get_tabs(self, request, obj=None):
        if obj and request.user != obj.created_by:
            return [
                (u'Podstawowe dane', self.tab_main),
                (u'Pytania', self.tab_questions),
                (u'Tokeny', self.tab_tokens)
            ]
        return [
            (u'Podstawowe dane', self.tab_main),
            (u'Pytania', self.tab_questions),
            (u'Tokeny', self.tab_tokens),
            (u'Uprawnienia', self.tab_permissions)
        ]

from django-tabbed-admin.

omji avatar omji commented on July 17, 2024

Hi Kamil,

Thanks a million for your feedback on this issue. I have just added some test against your specific code and it passes successfully (see above & travis).

I understand you mention some caching but then your solution should not pass as well? Maybe its something to do with the self.tabs. The strange thing is that there should be no caching in django admin and there is no cache implemented in this app.

Out of curiosity, what is the django version you are using?

Thanks again!

from django-tabbed-admin.

kamilgregorczyk avatar kamilgregorczyk commented on July 17, 2024

I'm sorry it wasn't caching it was static -> instance variable transformation in admin, once someone opened admin change view with modified tabs self.tabs was changed for everyone else.

Here's my project and now it works ok https://github.com/kamilgregorczyk/sententia/blob/master/poll/admin.py#L108

Someday I'm gonna make it more pretty, someday.

django 1.9.9

from django-tabbed-admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.