#19774: contentypes generic module has core functionality plus admins-specific 
one
------------------------------------------------+------------------------
               Reporter:  ramiro                |          Owner:  nobody
                   Type:  Bug                   |         Status:  new
              Component:  contrib.contenttypes  |        Version:  master
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 (Copied from https://code.djangoproject.com/ticket/16368#comment:16)

 The django/contrib/contenttypes/generic.py modules contains both the
 definitions of the model-related generic stuff (!GenericForeignKey, etc.)
 AND the admin app-related specialized inlines (!GenericInlineModelAdmin,
 !GenericStackedInline, !GenericTabularInline.)

 So, for example, if you import `django.contrib.contenttypes.generic` from
 your models.py because you need !GenericForeignKey then the
 !GenericXInlineY sutff imports django.contrib.admin and it in its own turn
 imports contrib.sites causing the reported failure (see below). Again, the
 Sites framework isn't listed in INSTALLED_APPS and what is worse: The
 admin app isn't either (!).

 Maybe it's time we move !GenericInlineModelAdmin, !GenericStackedInline,
 !GenericTabularInline from django.contrib.contenttypes.generic to, say,
 django.contrib.contenttypes.generic_admin? (of course this would need a
 deprecation process)

 {{{
     from django.contrib.contenttypes import generic
   File "django/contrib/contenttypes/generic.py", line 14, in <module>
     from django.contrib.admin.options import InlineModelAdmin,
 flatten_fieldsets
   File "django/contrib/admin/__init__.py", line 6, in <module>
     from django.contrib.admin.sites import AdminSite, site
   File "django/contrib/admin/sites.py", line 4, in <module>
     from django.contrib.admin.forms import AdminAuthenticationForm
   File "django/contrib/admin/forms.py", line 4, in <module>
     from django.contrib.auth.forms import AuthenticationForm
   File "django/contrib/auth/forms.py", line 10, in <module>
     from django.contrib.sites.models import get_current_site
   File "/django/contrib/sites/models.py", line 5, in <module>
     raise Exception
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19774>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to