[Django]-Multi-table inheritance in the admin view

0👍

You can probably use this instead:

models.py:

class Funnies(models.Model):
    title = models.CharField(max_length=200)

class FunniesProfile(models.Model):    
    funnies = models.OneToOneField(Funnies)
    body = models.TextField()

admin.py:

class FunniesProfileInline(admin.TabularInline):
    model = FunniesProfile

class FunniesAdmin(admin.ModelAdmin):
    inlines = [
        FunniesProfileInline,
    ]    
site.register(Funnies, FunniesAdmin)
👤Udi

Leave a comment