In your view you can do:
user = request.user
Then you can get Employee with:
employee = Employee.objects.get(user=user)
Then just get the attributes from the models that you need:
eg:
employee.division
On Thu, 21 Nov 2019 at 19:57, Pema Galey wrote:
> Hi All,
> I am Employee model directly
Hi All,
I am Employee model directly link with User model and Employee holds User
ID and division from Division model.
Every employee holds single Division.
class Employee(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
division = models.ForeignKey(
Divi
2 matches
Mail list logo