Project

General

Profile

« Previous | Next » 

Revision 99b661d3

Added by Jérôme Schneider almost 12 years ago

anonimize.py: improve anonymization

View differences:

anonimize.py
last = []
first = []
random.seed()
l = -1
for p in People.objects.all():
if p.last_name:
last.append(p.last_name)
if p.first_name:
first.append(p.first_name)
l += 1
len_first = len(first) - 1
len_last = len(last) - 1
for p in People.objects.all():
i = random.randint(0, l)
i = random.randint(0, len_last)
p.last_name = last[i]
if (p.last_name) > 5:
if len(p.last_name) > 5:
p.last_name = p.last_name[:-2] + 'zz'
i = random.randint(0, l)
i = random.randint(0, len_first)
p.first_name = first[i]
p.save()

Also available in: Unified diff