override get_queryset DetailView

override get_queryset DetailView Question: I’m new in Django and i try to use Class Based Views for my project, but i have problem in this. I wanna login a user into a page with its primary key but i don’t know how to override query_set. here is my code, any help will grateful. in the …

Total answers: 1

How to join 3 tables in query with Django

How to join 3 tables in query with Django Question: class Employee(models.Model): emp_no = models.IntegerField(primary_key=True) first_name = … last_name = … # emp_no first_name last_name —— ———- ———- 10005 Christian Erde class DeptEmp(models.Model): emp_no = models.ForeignKey(Employee, on_delete=models.CASCADE) dept_no = models.ForeignKey(Department, on_delete=models.CASCADE) # dept_no_id emp_no_id ———- ———- d003 10005 class Department(models.Model): dept_no = models.CharField(primary_key=True, max_length=4) …

Total answers: 1