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

admin.py needs a couple of fixes #1

Open
gtoffoli opened this issue Jul 24, 2015 · 0 comments
Open

admin.py needs a couple of fixes #1

gtoffoli opened this issue Jul 24, 2015 · 0 comments

Comments

@gtoffoli
Copy link

I'm using this useful app with Django 1.6 and will try it with 1.8
Module admin.py needs 2 small fixes:

  1. Change the definition of UserWithMPTTChangeForm by replacing Group.tree with Group.objects

    class UserWithMPTTChangeForm(UserChangeForm):
    groups = TreeNodeMultipleChoiceField(queryset=Group.objects.all())

  2. Import models.py, even if no global object is being referred directly; otherways the admin autodiscover function could read the definition of class UserWithMPTTChangeForm before the Group model has been extended with contribute_to_class; in this case I got the following error message:

    AttributeError: type object 'Group' has no attribute '_mptt_meta'

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