Skip to content

Instantly share code, notes, and snippets.

@aballah-chamakh
Created July 14, 2019 07:37
Show Gist options
  • Select an option

  • Save aballah-chamakh/215b215c3c410fb69355cdfeae366f10 to your computer and use it in GitHub Desktop.

Select an option

Save aballah-chamakh/215b215c3c410fb69355cdfeae366f10 to your computer and use it in GitHub Desktop.
from django.db import models
class PlayList(models.Model):
title = models.CharField(max_length=255)
slug = models.SlugField()
description = models.TextField()
def __str__(self):
return self.title
class Lecture(models.Model):
playlist = models.ForeignKey(PlayList,on_delete=models.CASCADE)
title = models.CharField(max_length=255)
slug = models.SlugField()
description = models.TextField()
video_url = models.CharField(max_length=500)
def __str__(self):
return self.title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment