diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-30 04:52:56 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-30 04:52:56 +0000 |
| commit | fd0cc45828e11e5e8936817e7a76c6bd5a8d0460 (patch) | |
| tree | cec65add265e3af605fbaff8747f64c7b6f58613 /django/db/models/options.py | |
| parent | c60e22c073a46e4701a16ed473966a3d108841ba (diff) | |
[8721] introduced some internal field names. We hide them from the list of
valid field names in debugging output so that it doesn't confuse things.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/options.py')
| -rw-r--r-- | django/db/models/options.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py index 3648cf0710..cee45d2abd 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -280,7 +280,9 @@ class Options(object): def get_all_field_names(self): """ Returns a list of all field names that are possible for this model - (including reverse relation names). + (including reverse relation names). This is used for pretty printing + debugging output (a list of choices), so any internal-only field names + are not included. """ try: cache = self._name_map @@ -288,7 +290,9 @@ class Options(object): cache = self.init_name_map() names = cache.keys() names.sort() - return names + # Internal-only names end with "+" (symmetrical m2m related names being + # the main example). Trim them. + return [val for val in names if not val.endswith('+')] def init_name_map(self): """ |
