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:
@@ -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']
|
||||
"""}
|
||||
|
||||
Reference in New Issue
Block a user