mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #22207 -- Added support for GenericRelation reverse lookups
GenericRelation now supports an optional related_query_name argument. Setting related_query_name adds a relation from the related object back to the content type for filtering, ordering and other query operations. Thanks to Loic Bistuer for spotting a couple of important issues in his review.
This commit is contained in:
parent
c627da0ccc
commit
b77f26313c
9 changed files with 71 additions and 27 deletions
|
@ -245,5 +245,5 @@ class GenericRelationTests(TestCase):
|
|||
form = GenericRelationForm({'links': None})
|
||||
self.assertTrue(form.is_valid())
|
||||
form.save()
|
||||
links = HasLinkThing._meta.get_field_by_name('links')[0].field
|
||||
links = HasLinkThing._meta.get_field_by_name('links')[0]
|
||||
self.assertEqual(links.save_form_data_calls, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue