2017-09-18 13:42:29 +00:00
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
|
|
|
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-25 23:45:32 +00:00
|
|
|
age = models.IntegerField(blank=False, null=False)
|
2017-09-18 13:42:29 +00:00
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return '{}, {}, {}, {}'.format(self.name, self.department, self.salary, self.hire_date)
|