Changeset 2382
- Timestamp:
- 02/24/06 04:28:46 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/django/db/models/fields/related.py
r2381 r2382 301 301 _add_m2m_items(self, superclass, rel_model, join_table, source_col_name, 302 302 target_col_name, instance._get_pk_val(), *objs, **kwargs) 303 304 # If this is an m2m relation to self, add the mirror entry in the m2m table 305 if instance.__class__ == rel_model: 306 _add_m2m_items(self, superclass, rel_model, join_table, target_col_name, 307 source_col_name, instance._get_pk_val(), *objs, **kwargs) 308 303 309 add.alters_data = True 304 310 … … 306 312 _remove_m2m_items(rel_model, join_table, source_col_name, 307 313 target_col_name, instance._get_pk_val(), *objs) 314 315 # If this is an m2m relation to self, remove the mirror entry in the m2m table 316 if instance.__class__ == rel_model: 317 _remove_m2m_items(rel_model, join_table, target_col_name, 318 source_col_name, instance._get_pk_val(), *objs) 319 308 320 remove.alters_data = True 309 321 310 322 def clear(self): 311 323 _clear_m2m_items(join_table, source_col_name, instance._get_pk_val()) 324 325 # If this is an m2m relation to self, clear the mirror entry in the m2m table 326 if instance.__class__ == rel_model: 327 _clear_m2m_items(join_table, target_col_name, instance._get_pk_val()) 328 312 329 clear.alters_data = True 313 330
