forked from 0x2620/pandora
edited flag for names and titles
This commit is contained in:
parent
ebc123a186
commit
634190cca6
4 changed files with 4 additions and 0 deletions
|
@ -19,6 +19,7 @@ def get_name_sort(name):
|
||||||
class Person(models.Model):
|
class Person(models.Model):
|
||||||
name = models.CharField(max_length=200, unique=True)
|
name = models.CharField(max_length=200, unique=True)
|
||||||
name_sort = models.CharField(max_length=200)
|
name_sort = models.CharField(max_length=200)
|
||||||
|
edited = models.BooleanField(default=False)
|
||||||
numberofnames = models.IntegerField(default=0)
|
numberofnames = models.IntegerField(default=0)
|
||||||
|
|
||||||
#FIXME: how to deal with aliases
|
#FIXME: how to deal with aliases
|
||||||
|
|
|
@ -29,6 +29,7 @@ def editName(request):
|
||||||
response = json_response()
|
response = json_response()
|
||||||
if 'nameSort' in data:
|
if 'nameSort' in data:
|
||||||
person.name_sort = utils.sort_string(data['nameSort'])
|
person.name_sort = utils.sort_string(data['nameSort'])
|
||||||
|
person.edited = True
|
||||||
person.save()
|
person.save()
|
||||||
response['data'] = person.json()
|
response['data'] = person.json()
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
|
|
|
@ -18,6 +18,7 @@ def get_title_sort(title):
|
||||||
class Title(models.Model):
|
class Title(models.Model):
|
||||||
title = models.CharField(max_length=1000, unique=True)
|
title = models.CharField(max_length=1000, unique=True)
|
||||||
title_sort = models.CharField(max_length=1000)
|
title_sort = models.CharField(max_length=1000)
|
||||||
|
edited = models.BooleanField(default=False)
|
||||||
|
|
||||||
imdbId = models.CharField(max_length=7, blank=True)
|
imdbId = models.CharField(max_length=7, blank=True)
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ def editTitle(request):
|
||||||
if 'titleSort' in data:
|
if 'titleSort' in data:
|
||||||
title.title_sort = data['titleSort']
|
title.title_sort = data['titleSort']
|
||||||
title.title_sort = unicodedata.normalize('NFKD', title.title_sort)
|
title.title_sort = unicodedata.normalize('NFKD', title.title_sort)
|
||||||
|
title.edited = True
|
||||||
title.save()
|
title.save()
|
||||||
response['data'] = title.json()
|
response['data'] = title.json()
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
|
|
Loading…
Reference in a new issue