Answer the question
In order to leave comments, you need to log in
How to make StackedInline look for a ForeignKey other than itself?
There are two tables: table, table1
models.py:
class Table(models.Model):
table1 = models.ForeignKey(Table1)
class Table1(models.Model):
text = models.TextField(verbose_name='текст')
class Table1Inline(admin.StackedInline):
model = Table1
class TableAdmin(admin.ModelAdmin):
pass
inlines = [
Table1Inline,
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question