Changes between Initial Version and Version 1 of Ticket #16368, comment 16
- Timestamp:
- Jul 29, 2011, 5:31:56 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #16368, comment 16
initial v1 7 7 I don't think the changes from that commit in particular are wrong regarding this issue. Looking at the traceback in comment:12 IMHO what's the culprit of this unexpected behavior is the fact that `django.contrib.contenttypes.generic` contains both the definitions of the model-related generic stuff (!GenericForeignKey, etc.) AND the admin app-related specialized inlines (!GenericInlineModelAdmin, !GenericStackedInline, !GenericTabularInline.) 8 8 9 So, for example, if you import `django.contrib.contenttypes.generic` from your `models.py` because you need !GenericForeignKey then the Generic*Inline* sutff imports `django.contrib.admin` and it in its own turn imports `contrib.sites` causing the observed failure. Again, the Sites framework isn't listed in INSTALLED_APPS and what is wor th: The admin app isn't either (!).9 So, for example, if you import `django.contrib.contenttypes.generic` from your `models.py` because you need !GenericForeignKey then the Generic*Inline* sutff imports `django.contrib.admin` and it in its own turn imports `contrib.sites` causing the observed failure. Again, the Sites framework isn't listed in INSTALLED_APPS and what is worse: The admin app isn't either (!). 10 10 11 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 p ath)11 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)