mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-16 22:20:24 +00:00
Tweak NestedObjects (and tests) comments.
This commit is contained in:
parent
f4f400734c
commit
06302a7ed6
2 changed files with 11 additions and 4 deletions
|
|
@ -40,9 +40,13 @@ def model_app_label(obj):
|
|||
return model_options(obj).app_label
|
||||
|
||||
|
||||
# Taken from the Django core.
|
||||
# https://github.com/django/django/blob/1.5.1/django/contrib/admin/util.py#L144
|
||||
class NestedObjects(Collector):
|
||||
"""
|
||||
This is adopted from the Django core. django-admin2 mandates that code
|
||||
doesn't depend on imports from django.contrib.admin.
|
||||
|
||||
https://github.com/django/django/blob/1.5.1/django/contrib/admin/util.py#L144
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(NestedObjects, self).__init__(*args, **kwargs)
|
||||
self.edges = {} # {from_instance: [to_instances]}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,14 @@ from djadmin2.utils import NestedObjects
|
|||
from ..models import Count, Event, EventGuide, Guest, Location
|
||||
|
||||
|
||||
# Largely taken from the Django core.
|
||||
# https://github.com/django/django/blob/1.5.1/tests/regressiontests/admin_util/tests.py
|
||||
class NestedObjectsTests(TestCase):
|
||||
"""
|
||||
Tests for ``NestedObject`` utility collection.
|
||||
|
||||
This is adopted from the Django core. django-admin2 mandates that code
|
||||
doesn't depend on imports from django.contrib.admin.
|
||||
|
||||
https://github.com/django/django/blob/1.5.1/tests/regressiontests/admin_util/tests.py
|
||||
"""
|
||||
def setUp(self):
|
||||
self.n = NestedObjects(using=DEFAULT_DB_ALIAS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue