Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

fetching data from multiple tables using related name in django

from App.models import Student, Subject
def myFunc():
    students = Student.objects.all()
    for student in students:
        subj = student.subject.sub

def myFunc2():
    subjects = Subject.objects.all()
    for subject in subjects:
        student_name = subject.student.nm
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #fetching #data #multiple #tables #related #django
ADD COMMENT
Topic
Name
5+9 =