Is this how django does single page inheritance?

In this SO question, I see the following:

class MediaContent(models.Model):
    uploader = models.ForeignKey(User)
    title = models.CharField(max_length=100)
    created = models.DateTimeField(auto_now_add=True)

    def draw_item(self):
        pass

    class Meta:
        abstract = True

class Picture(MediaContent):
    picture = models.ImageField(upload_to='pictures')

class Video(MediaContent):
    identifier = models.CharField(max_length=30) #youtube id

I used to do some STI in Rails, but have never been to django. This is how it is done in django? Will he create only one table with all fields in all models? Will it add a type column?

+3
source share
2 answers

Two tables are created: one for the image and one for the video. It is not possible to create a query that returns both types.

Abstract base classes

+3
source

Unfortunately, Django does not support unidirectional table inheritance: Inheriting individual tables in Django

+4
source

All Articles