flag invalid ids

This commit is contained in:
j 2011-11-22 12:50:36 +01:00
parent 396b86f061
commit b5a040764e

View file

@ -52,6 +52,8 @@ class Imdb(models.Model):
episodeTitle = models.CharField(max_length=1000, blank=True, default='') episodeTitle = models.CharField(max_length=1000, blank=True, default='')
episodeYear = models.CharField(max_length=4, blank=True, default='') episodeYear = models.CharField(max_length=4, blank=True, default='')
episodeDirector = models.CharField(max_length=1000, blank=True, default='') episodeDirector = models.CharField(max_length=1000, blank=True, default='')
invalid = models.BooleanField(default=False)
def __unicode__(self): def __unicode__(self):
return u"%s (%s)" % (self.title, self.imdb) return u"%s (%s)" % (self.title, self.imdb)
@ -75,6 +77,9 @@ class Imdb(models.Model):
if self.episode < 0: if self.episode < 0:
self.episode = None self.episode = None
self.save() self.save()
elif not self.invalid:
self.invalid = True
self.save()
def json(self): def json(self):
j = {} j = {}