Skip to content
Advertisement

Tag: django-models

Django Model form not rendering

Im trying to create a model form on django but it doesnt want to render even though I mapped it properly and created the path. models.py forms.py views.py it refuse to render but it displays the html tag that is in the file but not the fields from the form. this is the html template AppsForm.html Answer you view is

Django User Type Definition

In Django : From a Python OO perspective if I want different types of users shouldn’t I have a “Teacher” Object Type AND “Student” Object” type extended from AbstractUser? Looks like all the solutions mention to just extend with all the fields required for both users and only use the fields required for a Teacher or Student at Form time.

How to use If else in queryset in django

I need to use if else condition for Value1 in my queryset..I have found average for my records in the queryset..I need to apply condition like..If my Value1 is between 90 and 110 then I have to get message as “great” and if its below 90 it must print as “low” and if above 140 it must print as “high”

Advertisement