class Company models Model user models ForeignKey User organizational_

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class Company(models.Model):
user = models.ForeignKey(User)
organizational_form = models.CharField(max_length=2, choices=ORGANIZATIONAL_FORM_CHOICES)
company_name = models.CharField(max_length=200)
date_of_create = models.DateTimeField(editable=False)
def save(self):
if not self.id:
self.date_of_create = datetime.datetime.today()
super(Company, self).save()
class Company_Finance(models.Model):
company = models.ForeignKey(Company)
date_of_create = models.DateTimeField(editable=False)
period = models.IntegerField()
period_year = models.IntegerField()
receipt = models.IntegerField()
asset = models.IntegerField()
capital_reserve = models.IntegerField()
def save(self):
if not self.id:
self.date_of_create = datetime.datetime.today()
super(Company_Finance, self).save()