Moving them into another module won't make much difference as their
definition requires Permission and Group and therefore they'd still need to
import Permission and Group. We'd need an "AbstractAbstractBaseUser" which
would be silly.

Of course, there is no requirement to use AbstractBaseUser for your custom
model at all, though this does result in some otherwise unnecessary code
duplication. I would say your choice is either two empty tables in your
database, or code duplication between Django's source and your custom user.
Personally I'd prefer the former.

On 2 April 2015 at 07:09, Shai Berger <s...@platonix.com> wrote:

> On Thursday 02 April 2015 05:50:04 Curtis Maloney wrote:
> > Does your model inherit from PermissionsMixin?
> >
> > If you're using Admin, or any of Django's permissions machinery, you will
> > need django.contrib.auth in there to use the Group and Permission models.
> >
>
> The problem is not with permissions; the problem is that you can't import
> AbstractBaseUser without importing the concrete Permission, Group and User
> models,  because they're all in the same module.
>
> > On 2 April 2015 at 13:47, Dan Watson wrote:
> >>
> >> /Users/dcwatson/Documents/Environments/reader/lib/python3.4/site-
> packages/django/contrib/auth/models.py:41:
> >> RemovedInDjango19Warning: Model class
> django.contrib.auth.models.Permission
> >> doesn't declare an explicit app_label and either isn't in an
> application in
> >> INSTALLED_APPS or else was imported before its application was loaded.
> This
> >> will no longer be supported in Django 1.9.
> >>   class Permission(models.Model):
> >>
> >> Same thing for User and Group.
>
> I am not sure what the proper fix should be; on one hand, you are using
> code
> from django.contib.auth, so it makes some sense to require it to be
> installed.
> On the other hand, that forces two redundant tables on you (Group and
> Permission are not swappable).
>
> Please do open a ticket -- my instinct is that django.contrib.auth will
> need
> to be installed, but the impact of installing it should be minimised.
>
> Shai.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMwjO1E5-Fh9u%3Dh7yucyAcSz4TKBbWjvwVyjHv1FyPRN5NnhPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to