diff --git a/oxdata/lookup/cache.py b/oxdata/lookup/cache.py index 2fd86b1..1b5e52f 100644 --- a/oxdata/lookup/cache.py +++ b/oxdata/lookup/cache.py @@ -20,6 +20,16 @@ def addPoster(m, url, site, site_id): def getIds(): for id in ox.web.impawards.getIds(): + if id in ( + '2005/night', + '2007/hands_of_the_dragon', + '2008/nosferatu_project', + '2009/murph', + '1962/well_bury_you', + '1974/matter_of_winning', + '2006/last_time_i_trust_you_with_anything', + ): + continue if models.MovieId.objects.all().filter(impawards_id=id).count() == 0: print 'impawards', ox.web.impawards.getUrl(id) data = ox.web.impawards.getData(id) diff --git a/oxdata/poster/admin.py b/oxdata/poster/admin.py index 718c626..c25893a 100644 --- a/oxdata/poster/admin.py +++ b/oxdata/poster/admin.py @@ -4,7 +4,3 @@ import models from django.contrib import admin -class PosterAdmin(admin.ModelAdmin): - search_fields = ['url', 'movie_id__title', 'movie_id__imdb_id'] -admin.site.register(models.Poster, PosterAdmin) - diff --git a/oxdata/poster/models.py b/oxdata/poster/models.py index 75550b9..5439c14 100644 --- a/oxdata/poster/models.py +++ b/oxdata/poster/models.py @@ -40,9 +40,6 @@ def getPosters(movie_id, url_prefix='', limit=lambda x, y: 0.3 < x/y < 1): for p in posters.keys(): if not posters[p]: del posters[p] - poster = Poster.objects.filter(movie_id=movie_id).exclude(poster='') - if poster.count() > 0: - posters['local'] = [p.poster.url] return posters def poster_path(url, filename): @@ -101,13 +98,6 @@ class PosterCache(models.Model): self.save() return self.image -class Poster(models.Model): - created = models.DateTimeField(auto_now_add=True) - modified = models.DateTimeField(auto_now=True) - - movie_id = models.ForeignKey(MovieId, related_name='poster') - poster = models.ImageField(max_length=255, upload_to=lambda i, f: poster_path('upload/%s' % i.id, f)) - def getPosterUrls(m): def addPoster(url, site, site_id): if PosterCache.objects.all().filter(url=url, movie_id=m).count() == 0: