Add archive action and 'desarchive' on import

This commit is contained in:
Claude Paroz 2013-08-23 16:41:51 +02:00
parent b4a14db118
commit a0bcc21475
2 changed files with 10 additions and 0 deletions

View file

@ -88,8 +88,10 @@ class Student(models.Model):
except Klass.DoesNotExist:
raise Exception("La classe '%s' n'existe pas encore" % values['klass'])
values['klass'] = k
# See if postal code included in city, and split them
if 'city' in values and is_int(values['city'][:4]):
values['pcode'], _, values['city'] = values['city'].partition(' ')
values['archived'] = False
return values