Here is my code:
from League.models import Leagues
from League.models import Team
from django.contrib import admin
class TeamsInLeague(admin.StackedInline):
model = Team
extra = 1
class LeagueAdmin(admin.ModelAdmin):
fields = ['LeagueName']
inlines = TeamsInLeague
admin.site.register(Leagues,LeagueAdmin)
it gives me the error:
'LeagueAdmin.inlines' must be a list or tuple.
It works fine when I remove inlines = TeamsInLeague
I am following the tutorial, not to the word, but trying to solve my own problem.
The error is pretty clear —
inlinesshould be a list or tuple, not a class. Useor