Use a name that exists in both python2 and 3,

This commit is contained in:
Alex Gaynor 2012-08-15 01:12:45 -07:00 committed by Alex Gaynor
parent e0ec7507ac
commit c7734491f8
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ class MyAutoField(six.with_metaclass(models.SubfieldBase, models.CharField)):
def pre_save(self, instance, add):
value = getattr(instance, self.attname, None)
if not value:
value = MyWrapper(''.join(random.sample(string.lowercase, 10)))
value = MyWrapper(''.join(random.sample(string.ascii_lowercase, 10)))
setattr(instance, self.attname, value)
return value