Loading tests/admin_util/models.py +9 −1 Original line number Diff line number Diff line Loading @@ -3,11 +3,19 @@ from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Site(models.Model): domain = models.CharField(max_length=100) def __str__(self): return self.domain class Article(models.Model): """ A simple Article model for testing """ site = models.ForeignKey('sites.Site', related_name="admin_articles") site = models.ForeignKey(Site, related_name="admin_articles") title = models.CharField(max_length=100) title2 = models.CharField(max_length=100, verbose_name="another name") created = models.DateTimeField() Loading tests/admin_util/tests.py +1 −2 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ from django.contrib.admin import helpers from django.contrib.admin.utils import (display_for_field, flatten, flatten_fieldsets, label_for_field, lookup_field, NestedObjects) from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE from django.contrib.sites.models import Site from django.db import models, DEFAULT_DB_ALIAS from django import forms from django.test import TestCase Loading @@ -16,7 +15,7 @@ from django.utils.formats import localize from django.utils.safestring import mark_safe from django.utils import six from .models import Article, Count, Event, Location, EventGuide, Vehicle, Car from .models import Site, Article, Count, Event, Location, EventGuide, Vehicle, Car class NestedObjectsTests(TestCase): Loading Loading
tests/admin_util/models.py +9 −1 Original line number Diff line number Diff line Loading @@ -3,11 +3,19 @@ from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Site(models.Model): domain = models.CharField(max_length=100) def __str__(self): return self.domain class Article(models.Model): """ A simple Article model for testing """ site = models.ForeignKey('sites.Site', related_name="admin_articles") site = models.ForeignKey(Site, related_name="admin_articles") title = models.CharField(max_length=100) title2 = models.CharField(max_length=100, verbose_name="another name") created = models.DateTimeField() Loading
tests/admin_util/tests.py +1 −2 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ from django.contrib.admin import helpers from django.contrib.admin.utils import (display_for_field, flatten, flatten_fieldsets, label_for_field, lookup_field, NestedObjects) from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE from django.contrib.sites.models import Site from django.db import models, DEFAULT_DB_ALIAS from django import forms from django.test import TestCase Loading @@ -16,7 +15,7 @@ from django.utils.formats import localize from django.utils.safestring import mark_safe from django.utils import six from .models import Article, Count, Event, Location, EventGuide, Vehicle, Car from .models import Site, Article, Count, Event, Location, EventGuide, Vehicle, Car class NestedObjectsTests(TestCase): Loading