how to pass multiple query sets in Django

33 views
Skip to first unread message

Anil s

unread,
Feb 16, 2021, 8:58:56 AM2/16/21
to Django users

Hello Everyone:

Can somebody please tell me how to pass multiple query sets in Django.

Thank you for your help.

Omkar Parab

unread,
Feb 16, 2021, 9:28:47 AM2/16/21
to django...@googlegroups.com
pass your multiple query sets using the get_context_data" method. 

--
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/a9b86c7a-e084-4f86-8c78-db8c4c56f82en%40googlegroups.com.

Anil s

unread,
Feb 17, 2021, 2:30:16 AM2/17/21
to django...@googlegroups.com
Hi thanks for the response.

can you please let me know how to pass the below array in the serializer

project_array = {'project_type': project_type}
serializer = ProjectListSerializer(project_array, many=True)
return Response(serializer.data)

when i pass this i am getting the below error
Got AttributeError when attempting to get a value for field `project_number` on serializer `ProjectListSerializer`
please help me how to resolve this.
Regards,
Anil Sebastin

You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/2wd6MUE9iqo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJY8mfwVnvzWjzgLrmJ2akcuVv-szk0oeWkJK74LfmbPPmvuOw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages