from django.db import models


class Director(models.Model):
    name = models.CharField(max_length=80)

    def __unicode__(self):
        return self.name


class Writer(models.Model):
    name = models.CharField(max_length=80)

    def __unicode__(self):
        return self.name


class Cast(models.Model):
    name = models.CharField(max_length=80)

    def __unicode__(self):
        return self.name


class Genre(models.Model):
    name = models.CharField(max_length=40)

    def __unicode__(self):
        return self.name


class Movie(models.Model):
    movie_id = models.CharField(max_length=7, primary_key=True)
    title = models.CharField(max_length=60)
    year = models.PositiveSmallIntegerField()
    runtime = models.PositiveSmallIntegerField()
    rating = models.CharField(max_length=12)

    director = models.ManyToManyField(Director)
    writer = models.ManyToManyField(Writer)
    cast = models.ManyToManyField(Cast)
    genre = models.ManyToManyField(Genre)

    released = models.DateField()
    plot = models.TextField()
    fullplot = models.TextField()
    poster = models.URLField()

    def __unicode__(self):
        return self.title




@@ -34,378 +34,125 @@
 ass 
-Director(models.Model):%0A    name = models.CharField(max_length=80)%0A%0A    def __unicode__(self):%0A        return self.name%0A%0A%0Aclass Writer(models.Model):%0A    name = models.CharField(max_length=80)%0A%0A    def __unicode__(self):%0A        return self.name%0A%0A%0Aclass Cast(models.Model):%0A    name = models.CharField(max_length=80)%0A%0A    def __unicode__(self):%0A        return self.name%0A
+Person(models.Model):%0A    name = models.CharField(max_length=80)%0A%0A    def __unicode__(self):%0A        return self.name
 %0A%0Acl
@@ -592,16 +592,39 @@
 eld(
-D
+Person, related_name=%22d
 irector
+%22
 )%0A  
@@ -661,14 +661,37 @@
 eld(
-W
+Person, related_name=%22w
 riter
+%22
 )%0A  
@@ -726,12 +726,35 @@
 eld(
-C
+Person, related_name=%22c
 ast
+%22
 )%0A  
@@ -977,11 +977,8 @@
 f.title%0A
-%0A%0A%0A

Update Movie model.