2017-09-18 15:42:29 +02:00
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
2020-01-21 10:29:54 +01:00
|
|
|
class Classification(models.Model):
|
|
|
|
code = models.CharField(max_length=10)
|
|
|
|
|
|
|
|
|
2017-09-18 15:42:29 +02:00
|
|
|
class Employee(models.Model):
|
|
|
|
name = models.CharField(max_length=40, blank=False, null=False)
|
|
|
|
salary = models.PositiveIntegerField()
|
|
|
|
department = models.CharField(max_length=40, blank=False, null=False)
|
|
|
|
hire_date = models.DateField(blank=False, null=False)
|
2018-07-26 01:45:32 +02:00
|
|
|
age = models.IntegerField(blank=False, null=False)
|
2020-01-21 10:29:54 +01:00
|
|
|
classification = models.ForeignKey('Classification', on_delete=models.CASCADE, null=True)
|