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.

18 rivejä
604 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. class Employee(models.Model):
  6. user = models.OneToOneField(User, on_delete=models.CASCADE)
  7. employee_id = models.CharField(max_length=15)
  8. phone = PhoneNumberField()
  9. salary = models.DecimalField(max_digits=15, decimal_places=2)
  10. start_date = models.DateField()
  11. end_date = models.DateField(null=True, blank=True)
  12. projects = models.ManyToManyField(Project)
  13. def __str__(self):
  14. return self.employee_id