edited flag for names and titles

This commit is contained in:
j 2011-10-11 17:01:11 +02:00
parent ebc123a186
commit 634190cca6
4 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@ def get_name_sort(name):
class Person(models.Model):
name = models.CharField(max_length=200, unique=True)
name_sort = models.CharField(max_length=200)
edited = models.BooleanField(default=False)
numberofnames = models.IntegerField(default=0)
#FIXME: how to deal with aliases

View File

@ -29,6 +29,7 @@ def editName(request):
response = json_response()
if 'nameSort' in data:
person.name_sort = utils.sort_string(data['nameSort'])
person.edited = True
person.save()
response['data'] = person.json()
return render_to_json_response(response)

View File

@ -18,6 +18,7 @@ def get_title_sort(title):
class Title(models.Model):
title = models.CharField(max_length=1000, unique=True)
title_sort = models.CharField(max_length=1000)
edited = models.BooleanField(default=False)
imdbId = models.CharField(max_length=7, blank=True)

View File

@ -31,6 +31,7 @@ def editTitle(request):
if 'titleSort' in data:
title.title_sort = data['titleSort']
title.title_sort = unicodedata.normalize('NFKD', title.title_sort)
title.edited = True
title.save()
response['data'] = title.json()
return render_to_json_response(response)