1
0
mirror of https://github.com/django/django.git synced 2025-06-14 16:09:12 +00:00

magic-removal: updated (most) dependencies to reflect new location of django.models.core Package and ContentType.

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans 2006-01-09 18:20:06 +00:00
parent 24f8e94563
commit 6cdb3c57d8
6 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
from django.db import models from django.db import models
from django.models import core from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
@ -15,7 +15,7 @@ class LogEntryManager(models.Manager):
class LogEntry(models.Model): class LogEntry(models.Model):
action_time = models.DateTimeField(_('action time'), auto_now=True) action_time = models.DateTimeField(_('action time'), auto_now=True)
user = models.ForeignKey(User) user = models.ForeignKey(User)
content_type = models.ForeignKey(core.ContentType, blank=True, null=True) content_type = models.ForeignKey(ContentType, blank=True, null=True)
object_id = models.TextField(_('object id'), blank=True, null=True) object_id = models.TextField(_('object id'), blank=True, null=True)
object_repr = models.CharField(_('object repr'), maxlength=200) object_repr = models.CharField(_('object repr'), maxlength=200)
action_flag = models.PositiveSmallIntegerField(_('action flag')) action_flag = models.PositiveSmallIntegerField(_('action flag'))

View File

@ -1,6 +1,6 @@
from django.core import validators from django.core import validators
from django.db import backend, connection, models from django.db import backend, connection, models
from django.models import core from django.contrib.contenttypes.models import Package
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
import datetime import datetime
@ -8,7 +8,7 @@ SESSION_KEY = '_auth_user_id'
class Permission(models.Model): class Permission(models.Model):
name = models.CharField(_('name'), maxlength=50) name = models.CharField(_('name'), maxlength=50)
package = models.ForeignKey(core.Package, db_column='package') package = models.ForeignKey(Package, db_column='package')
codename = models.CharField(_('codename'), maxlength=100) codename = models.CharField(_('codename'), maxlength=100)
class Meta: class Meta:
verbose_name = _('Permission') verbose_name = _('Permission')

View File

@ -1,5 +1,5 @@
from django.db import models from django.db import models
from django.models.core import ContentType from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _

View File

@ -4,7 +4,7 @@ from django.core.exceptions import Http404, ObjectDoesNotExist
from django.core.extensions import DjangoContext, render_to_response from django.core.extensions import DjangoContext, render_to_response
from django.contrib.auth.models import SESSION_KEY from django.contrib.auth.models import SESSION_KEY
from django.contrib.comments.models import Comment, FreeComment, PHOTOS_REQUIRED, PHOTOS_OPTIONAL, RATINGS_REQUIRED, RATINGS_OPTIONAL, IS_PUBLIC from django.contrib.comments.models import Comment, FreeComment, PHOTOS_REQUIRED, PHOTOS_OPTIONAL, RATINGS_REQUIRED, RATINGS_OPTIONAL, IS_PUBLIC
from django.models.core import ContentType from django.contrib.contenttypes.models import ContentType
from django.parts.auth.formfields import AuthenticationForm from django.parts.auth.formfields import AuthenticationForm
from django.utils.httpwrappers import HttpResponseRedirect from django.utils.httpwrappers import HttpResponseRedirect
from django.utils.text import normalize_newlines from django.utils.text import normalize_newlines

View File

@ -98,7 +98,7 @@ class Options:
def get_content_type_id(self): def get_content_type_id(self):
"Returns the content-type ID for this object type." "Returns the content-type ID for this object type."
if not hasattr(self, '_content_type_id'): if not hasattr(self, '_content_type_id'):
from django.models.core import ContentType from django.contrib.contenttypes.models import ContentType
self._content_type_id = ContentType.objects.get_object( self._content_type_id = ContentType.objects.get_object(
python_module_name__exact=self.module_name, python_module_name__exact=self.module_name,
package__label__exact=self.app_label).id package__label__exact=self.app_label).id

View File

@ -1,6 +1,6 @@
from django.core.exceptions import Http404, ObjectDoesNotExist from django.core.exceptions import Http404, ObjectDoesNotExist
from django.core.template import Context, loader from django.core.template import Context, loader
from django.models.core import ContentType from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
from django.utils import httpwrappers from django.utils import httpwrappers