Changeset 447
- Timestamp:
- 08/09/05 19:21:41 (3 years ago)
- Files:
-
- django/trunk/django/core/meta/__init__.py (modified) (1 diff)
- django/trunk/tests/testapp/models/many_to_many.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/meta/__init__.py
r440 r447 776 776 cursor.execute("DELETE FROM %s WHERE %s_id=%%s" % (rel_field.get_m2m_db_table(rel_opts), 777 777 self._meta.object_name.lower()), [getattr(self, opts.pk.name)]) 778 for f in opts.many_to_many: 779 cursor.execute("DELETE FROM %s WHERE %s_id=%%s" % (f.get_m2m_db_table(opts), self._meta.object_name.lower()), 780 [getattr(self, opts.pk.name)]) 778 781 cursor.execute("DELETE FROM %s WHERE %s=%%s" % (opts.db_table, opts.pk.name), [getattr(self, opts.pk.name)]) 779 782 db.db.commit() django/trunk/tests/testapp/models/many_to_many.py
r445 r447 70 70 [Django lets you build Web apps easily, NASA uses Python] 71 71 72 # If we delete an article, its publication won't be able to access it. 72 # If we delete a Publication, its Articles won't be able to access it. 73 >>> p1.delete() 74 >>> publications.get_list() 75 [Science News] 76 >>> a1 = articles.get_object(pk=1) 77 >>> a1.get_publication_list() 78 [] 79 80 # If we delete an Article, its Publications won't be able to access it. 73 81 >>> a2.delete() 74 82 >>> articles.get_list() … … 76 84 >>> p1.get_article_list(order_by=['headline']) 77 85 [Django lets you build Web apps easily] 78 79 86 """
