Re: How to display on Django page based on user's condition?

2019-11-21 Thread James Dunn
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

How to display on Django page based on user's condition?

2019-11-21 Thread Pema Galey
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