class CMSDocument(models.Model):
    title = models.CharField(max_length=50)


class CMSMediaDocument(CMSDocument):
    thumb = CMSImageField(upload_to='./media/', blank=True)
Python Django: How to upload a file with a filename based on instance pk