Djangorest framework tutorial

50 views
Skip to first unread message

Laura Pérez

unread,
Nov 4, 2019, 7:48:18 AM11/4/19
to django...@googlegroups.com
Hi!
I have the task to develop a rest api in python, Can anybody advice me on a nice tutorial to use djangorest framework ?

Best!


Paras Jain

unread,
Nov 4, 2019, 7:59:42 AM11/4/19
to django...@googlegroups.com
Hi,
just follow this video u will easily know how to make api very easily
Thnks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF_dEnq90i0zxOgwGANXaFk_eEWJn4N6d544U1r-qwPS1M92jg%40mail.gmail.com.

Laura Pérez

unread,
Nov 4, 2019, 9:45:02 AM11/4/19
to django...@googlegroups.com

Motaz Hejaze

unread,
Nov 5, 2019, 12:21:46 AM11/5/19
to django...@googlegroups.com
If you need any help please let me know

My skype

m3tz-hjze

kevin trinidad

unread,
Nov 5, 2019, 12:25:06 AM11/5/19
to django...@googlegroups.com
Django Signals: The QuerySet value for an exact lookup must be limited to one result using slicing

i have this code in my models.py (post_save)

    class StudentsEnrolledSubject(models.Model):
        Students_Enrollment_Records = models.ForeignKey(StudentsEnrollmentRecord, related_name='+',
                                                        on_delete=models.CASCADE, null=True)
        Subject_Section_Teacher = models.ForeignKey(SubjectSectionTeacher, related_name='+', on_delete=models.CASCADE,
                                                    null=True,blank=True)

    @receiver(post_save, sender=StudentsEnrollmentRecord)
    def create(sender, instance, created, *args, **kwargs):
        teachers = SubjectSectionTeacher.objects.filter(Sections=instance.Section,Education_Levels=instance.Education_Levels,Courses=instance.Courses)
        for each in teachers:
            if created and teachers.exists():
                StudentsEnrolledSubject.objects.update_or_create(
                        pk=each.id,
                        Students_Enrollment_Records=instance,
                        Subject_Section_Teacher=teachers.all()

                    )

    class StudentsEnrollmentRecord(models.Model):
        Student_Users = models.ForeignKey(StudentProfile, related_name='students', on_delete=models.CASCADE, null=True)

    class SubjectSectionTeacher(models.Model):
        Education_Levels = models.ForeignKey(EducationLevel, related_name='+', on_delete=models.CASCADE, blank=True)
        Courses = models.ForeignKey(Course, related_name='+', on_delete=models.CASCADE, null=True, blank=True)
        Sections = models.ForeignKey(Section, related_name='+', on_delete=models.CASCADE, null=True)
        Subjects = models.ForeignKey(Subject, related_name='+', on_delete=models.CASCADE, null=True)
        Employee_Users = models.ForeignKey(EmployeeUser, related_name='+', on_delete=models.CASCADE, null=True)

when I used the **Subject_Section_Teacher=teachers.first()** i received no error but that is not what i want result, then i decide to change it to this **Subject_Section_Teacher=teachers.all()**


Ing.Daniel Bojorge

unread,
Nov 5, 2019, 10:35:48 AM11/5/19
to django...@googlegroups.com

It's in spanish.


Mi Blog
Nicaragua

"Si ustedes permanecen unidos a mí, y si permanecen fieles a mis enseñanzas, pidan lo que quieran y se les dará.
(Juan 15:7 DHH)
Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
(Jeremías 17:7 RV2000)




yazd...@gmail.com

unread,
Nov 5, 2019, 10:42:55 AM11/5/19
to django...@googlegroups.com
I don’t understand Spanish sorry 

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages