Django backend for WorkX project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

22 line
780 B

  1. from django.contrib.auth.models import User
  2. from django.db import models
  3. from phonenumber_field.modelfields import PhoneNumberField
  4. from project.models import Project
  5. from client.models import Address
  6. class Employee(models.Model):
  7. user = models.OneToOneField(User, on_delete=models.CASCADE)
  8. employee_id = models.CharField(max_length=15)
  9. phone = PhoneNumberField()
  10. salary = models.DecimalField(max_digits=15, decimal_places=2)
  11. start_date = models.DateField()
  12. end_date = models.DateField(null=True, blank=True)
  13. projects = models.ManyToManyField(Project)
  14. perk_per_month = models.DecimalField(max_digits=15, decimal_places=2)
  15. address = models.ForeignKey(Address, on_delete=models.CASCADE)
  16. def __str__(self):
  17. return self.employee_id