From 85712a63b50830e0bb148d751d21f7348f219835 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 24 Jul 2013 10:27:30 +0200 Subject: [PATCH] keep lookup.modles and movie.models in sync --- oxdata/lookup/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oxdata/lookup/models.py b/oxdata/lookup/models.py index e388c6e..4ce8a2a 100644 --- a/oxdata/lookup/models.py +++ b/oxdata/lookup/models.py @@ -16,6 +16,8 @@ import ox.web.imdb import ox.web.wikipedia import ox.web.allmovie +import movie.models + from modules import get_info oxdb_api = ox.API('http://0xdb.org/api/') @@ -105,6 +107,9 @@ class MovieId(models.Model): #if not self.oxdb_id: # self.gen_oxdb_id() self.save() + if self.imdb_id: + m, created = movie.models.Imdb.objects.get_or_create(imdb=self.movie_id.imdb_id) + m.update() def gen_oxdb_id(self): self.oxdb_id = ox.get_oxid(