summaryrefslogtreecommitdiff
path: root/django/db/models/options.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2008-09-02 15:26:00 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2008-09-02 15:26:00 +0000
commit79d2ee3b6d405674a2a49f0884312a8cdc82d809 (patch)
treefbb5bdc0b773664b2518c15b33f5341d7fec633c /django/db/models/options.py
parent98e1cc92f47cbda977a923b9ba8d980bc01cd749 (diff)
Fixed #8309: subclasses now inherit `GenericForeignKey` correctly. There's also now an internal API so that other "virtual fields" like GFK can be inherited as well. Thanks, msaelices.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8855 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/options.py')
-rw-r--r--django/db/models/options.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py
index 6e14db2f94..6e0d6b5082 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -26,6 +26,7 @@ DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering',
class Options(object):
def __init__(self, meta, app_label=None):
self.local_fields, self.local_many_to_many = [], []
+ self.virtual_fields = []
self.module_name, self.verbose_name = None, None
self.verbose_name_plural = None
self.db_table = ''
@@ -155,6 +156,9 @@ class Options(object):
if hasattr(self, '_name_map'):
del self._name_map
+ def add_virtual_field(self, field):
+ self.virtual_fields.append(field)
+
def setup_pk(self, field):
if not self.pk and field.primary_key:
self.pk = field