mirror of
https://github.com/django-polymorphic/django-polymorphic.git
synced 2026-01-12 19:15:53 +03:00
Test that FK lookup resolves child when using an AbstractModel
Co-authored-by: Matt Covalt <mcovalt@mailbox.org> Co-authored-by: Brian Kohan <bckohan@gmail.com>
This commit is contained in:
parent
18be22d322
commit
7d0a1a198e
|
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 4.2.26 on 2025-12-04 12:57
|
||||
# Generated by Django 4.2.26 on 2025-12-05 02:34
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
|
@ -256,7 +256,6 @@ class Migration(migrations.Migration):
|
|||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
'base_manager_name': 'objects',
|
||||
},
|
||||
bases=(polymorphic.showfields.ShowFieldTypeAndContent, models.Model),
|
||||
),
|
||||
|
|
@ -586,7 +585,6 @@ class Migration(migrations.Migration):
|
|||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
'base_manager_name': 'objects',
|
||||
},
|
||||
bases=('tests.relationbase',),
|
||||
),
|
||||
|
|
@ -598,7 +596,6 @@ class Migration(migrations.Migration):
|
|||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
'base_manager_name': 'objects',
|
||||
},
|
||||
bases=('tests.relationbase',),
|
||||
),
|
||||
|
|
@ -1060,7 +1057,6 @@ class Migration(migrations.Migration):
|
|||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
'base_manager_name': 'objects',
|
||||
},
|
||||
bases=('tests.relationb',),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -109,7 +109,13 @@ class Enhance_Inherit(Enhance_Base, Enhance_Plain):
|
|||
field_i = models.CharField(max_length=30)
|
||||
|
||||
|
||||
class RelationBase(ShowFieldTypeAndContent, PolymorphicModel):
|
||||
class RelationAbstractModel(models.Model):
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
|
||||
# class RelationBase(ShowFieldTypeAndContent, PolymorphicModel, RelationAbstractModel): # this works!
|
||||
class RelationBase(RelationAbstractModel, ShowFieldTypeAndContent, PolymorphicModel):
|
||||
field_base = models.CharField(max_length=30)
|
||||
fk = models.ForeignKey(
|
||||
"self", on_delete=models.CASCADE, null=True, related_name="relationbase_set"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user