Exemplo n.º 1
0
 def save(self):
     m = Series.objects.create(
             title=self.title, title_fr=self.title_fr,
             title_int=self.title_int, begin_year=self.begin_year,
             end_year=self.end_year, id_imdb=self.id_imdb,
             poster=self.poster, rating=self.rating,
             votes=self.votes, plot=self.plot,
             language=self.language, alias=self.alias,
             number_of_episodes=0, number_of_seasons=0)
     m.save()
     for idx, actor in enumerate(self.persons['cast']):
         p = Person.add(actor)
         SeriesContributors.objects.create(
                 person=p, series=m, function='A', rank=idx)
     for idx, director in enumerate(self.persons['director']):
         p = Person.add(director)
         SeriesContributors.objects.create(
                 person=p, series=m, function='D', rank=idx)
     for idx, writer in enumerate(self.persons['writer']):
         p = Person.add(writer)
         p.save()
         SeriesContributors.objects.create(
                 person=p, series=m, function='W', rank=idx)
     for genre in self.genres:
         g = Genre.add(genre)
         m.genres.add(g)
     return m
Exemplo n.º 2
0
 def save(self):
     if __DEBUG__:
         print "title : " + self.title
         print "title_fr : " + self.title_fr
         print "title_int : " + self.title_int
         print "year : " + str(self.year)
         if self.runtime:
             print "runtime : " + self.runtime
         print "poster : " + self.poster
         if self.rating:
             print "rating : " + str(self.rating)
         if self.votes:
             print "votes : " + str(self.votes)
         print "plot : " + self.plot
         print "language : " + self.language
     m = Movie.objects.create(
             title=self.title, title_fr=self.title_fr,
             title_int=self.title_int, year=self.year,
             runtime=self.runtime, id_imdb=self.id_imdb,
             poster=self.poster, rating=self.rating,
             votes=self.votes, plot=self.plot,
             language=self.language)
     m.save()
     for idx, actor in enumerate(self.persons['cast']):
         p = Person.add(actor)
         MovieContributors.objects.create(
                 person=p, movie=m, function='A', rank=idx)
     for idx, director in enumerate(self.persons['director']):
         p = Person.add(director)
         MovieContributors.objects.create(
                 person=p, movie=m, function='D', rank=idx)
     for idx, writer in enumerate(self.persons['writer']):
         p = Person.add(writer)
         p.save()
         MovieContributors.objects.create(
                 person=p, movie=m, function='W', rank=idx)
     for genre in self.genres:
         g = Genre.add(genre)
         m.genres.add(g)
     return m
Exemplo n.º 3
0
 def save(self):
     m = Episode.objects.create(
             title=self.title, title_fr=self.title_fr,
             date=self.air_date, id_imdb=self.id_imdb,
             poster=self.poster, rating=self.rating,
             votes=self.votes, plot=self.plot,
             season=self.season, episode_number=self.ep_nb,
             runtime=self.runtime)
     m.save()
     for idx, actor in enumerate(self.persons['cast']):
         p = Person.add(actor)
         EpisodeContributors.objects.create(
                 person=p, episode=m, function='A', rank=idx)
     for idx, director in enumerate(self.persons['director']):
         p = Person.add(director)
         EpisodeContributors.objects.create(
                 person=p, episode=m, function='D', rank=idx)
     for idx, writer in enumerate(self.persons['writer']):
         p = Person.add(writer)
         p.save()
         EpisodeContributors.objects.create(
                 person=p, episode=m, function='W', rank=idx)
     return m