Ticket #4102: 4102.3.fix-multi-table

File 4102.3.fix-multi-table, 892 bytes (added by Clay McClure, 16 years ago)

Patches Django-1.0.2 with patch 4102.3 applied to fix multi-table inheritance

Line 
1Index: third-party/Django-1.0.2-final+4102.3+2705/django/db/models/base.py
2===================================================================
3--- third-party/Django-1.0.2-final+4102.3+2705/django/db/models/base.py (revision 3362)
4+++ third-party/Django-1.0.2-final+4102.3+2705/django/db/models/base.py (working copy)
5@@ -358,7 +358,10 @@
6 non_pks = [f for f in meta.local_fields if not f.primary_key]
7 modified_attrs = self._modified_attrs
8 non_pks = [f for f in non_pks if (f.name in modified_attrs or f.attname in modified_attrs)]
9- self._reset_modified_attrs()
10+
11+ # Reset modified attribute accumulator after parent fields have been updated
12+ if cls == self.__class__:
13+ self._reset_modified_attrs()
14
15 # First, try an UPDATE. If that doesn't update anything, do an INSERT.
16 pk_val = self._get_pk_val(meta)
Back to Top