Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_readonly_fields does not have proper obj #79

Open
ppython opened this issue Jun 6, 2017 · 0 comments
Open

get_readonly_fields does not have proper obj #79

ppython opened this issue Jun 6, 2017 · 0 comments

Comments

@ppython
Copy link
Contributor

ppython commented Jun 6, 2017

The get_readonly_fields of a nested inline does not have the proper obj passed:

Consider the following configuration:

class SecondLevelInline(NestedStackedInline):
    model = SecondLevelModel

    def get_readonly_fields(self, request, obj=None):
        # obj is a "FirstLevelModel" instead of a "SecondLevelModel"


class FirstLevelInline(NestedStackedInline):
    model = FirstLevelModel
    inlines = [SecondLevelInline, ]

So i cannot make a conditional readonly_fields for my SecondLevelModel and I should have access to an instance of a SecondLevelModel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant