PDF to update students data
This commit is contained in:
parent
e08356e6eb
commit
8b673665ce
6 changed files with 167 additions and 9 deletions
|
|
@ -161,6 +161,18 @@ class Student(models.Model):
|
|||
def __str__(self):
|
||||
return '%s %s' % (self.last_name, self.first_name)
|
||||
|
||||
@property
|
||||
def civility(self):
|
||||
return 'Monsieur' if self.gender == 'M' else 'Madame'
|
||||
|
||||
@property
|
||||
def full_name(self):
|
||||
return '{0} {1}'.format(self.first_name, self.last_name)
|
||||
|
||||
@property
|
||||
def pcode_city(self):
|
||||
return '{0} {1}'.format(self.pcode, self.city)
|
||||
|
||||
def save(self, **kwargs):
|
||||
if self.archived and not self.archived_text:
|
||||
# Fill archived_text with training data, JSON-formatted
|
||||
|
|
@ -222,6 +234,10 @@ class Corporation(models.Model):
|
|||
sect = ' (%s)' % self.sector if self.sector else ''
|
||||
return "%s%s, %s %s" % (self.name, sect, self.pcode, self.city)
|
||||
|
||||
@property
|
||||
def pcode_city(self):
|
||||
return '{0} {1}'.format(self.pcode, self.city)
|
||||
|
||||
|
||||
class CorpContact(models.Model):
|
||||
corporation = models.ForeignKey(Corporation, verbose_name='Institution', on_delete=models.CASCADE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue