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.
|
- from django.contrib.auth.models import User
- from django.db import models
- from phonenumber_field.modelfields import PhoneNumberField
- from project.models import Project
-
-
- class Employee(models.Model):
- user = models.OneToOneField(User, on_delete=models.CASCADE)
- employee_id = models.CharField(max_length=15)
- phone = PhoneNumberField()
- salary = models.DecimalField(max_digits=10, decimal_places=2)
- start_date = models.DateField()
- end_date = models.DateField(null=True, blank=True)
- projects = models.ManyToManyField(Project)
-
- def __str__(self):
- return self.user.name
|