1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #10799: fixed the use of list_editable with model inheritance and custom one-to-one parent links. Thanks, Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10590 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2009-04-18 21:03:29 +00:00
parent 1e4ad6f118
commit ccc8e104ee
4 changed files with 30 additions and 4 deletions

View File

@@ -108,6 +108,10 @@ class Price(models.Model):
class MexicanRestaurant(Restaurant):
serves_tacos = models.BooleanField()
class ClassyMexicanRestaurant(MexicanRestaurant):
restaurant = models.OneToOneField(MexicanRestaurant, parent_link=True, primary_key=True)
tacos_are_yummy = models.BooleanField()
# models for testing unique_together validation when a fk is involved and
# using inlineformset_factory.
class Repository(models.Model):
@@ -934,4 +938,9 @@ True
>>> formset.get_queryset()
[<Player: Bobby>]
# a formset for a Model that has a custom primary key that still needs to be
# added to the formset automatically
>>> FormSet = modelformset_factory(ClassyMexicanRestaurant, fields=["tacos_are_yummy"])
>>> sorted(FormSet().forms[0].fields.keys())
['restaurant', 'tacos_are_yummy']
"""}