From a778c9de4773d7a9d53b86b3aa4bc54bfbc40b8d Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Tue, 4 Jul 2006 10:48:07 +0000 Subject: [PATCH] Fixed #1578 -- fixed a corner-case where we still wanting core=True attributes on a model that was not being edited inline. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3275 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management.py | 2 ++ .../regressiontests/many_to_one_regress/__init__.py | 0 tests/regressiontests/many_to_one_regress/models.py | 13 +++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 tests/regressiontests/many_to_one_regress/__init__.py create mode 100644 tests/regressiontests/many_to_one_regress/models.py diff --git a/django/core/management.py b/django/core/management.py index ea210af88f..5dd18ddd46 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -962,6 +962,8 @@ def get_validation_errors(outfile, app=None): # Check core=True, if needed. for related in opts.get_followed_related_objects(): + if not related.edit_inline: + continue try: for f in related.opts.fields: if f.core: diff --git a/tests/regressiontests/many_to_one_regress/__init__.py b/tests/regressiontests/many_to_one_regress/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regressiontests/many_to_one_regress/models.py b/tests/regressiontests/many_to_one_regress/models.py new file mode 100644 index 0000000000..485e928777 --- /dev/null +++ b/tests/regressiontests/many_to_one_regress/models.py @@ -0,0 +1,13 @@ +from django.db import models + +class First(models.Model): + second = models.IntegerField() + +class Second(models.Model): + first = models.ForeignKey(First, related_name = 'the_first') + +# If ticket #1578 ever slips back in, these models will not be able to be +# created (the field names being lower-cased versions of their opposite +# classes is important here). + +API_TESTS = ""