Regarding to Correction my error

16 views
Skip to first unread message

RONAK JAIN

unread,
Aug 14, 2019, 7:32:38 AM8/14/19
to django...@googlegroups.com
Hello Everyone,



I am trying to improve the use of code in Django templates so when 'am trying to iterate my picture dynamically from the html page.

Getting popular objects not iterable.


This is Type ERROR: popular objects not iterable.



Attached screenshot please check and revert back to me.



Thank you 


  
Screenshot 2019-08-14 at 4.53.16 PM.png
Screenshot 2019-08-14 at 4.55.05 PM.png
Screenshot 2019-08-14 at 4.54.13 PM.png

Manzur Alahi

unread,
Aug 14, 2019, 8:40:42 AM8/14/19
to Django users
1. you are naming the dictionary ***context2 then you are also assigning a key named ***context2 that is probably creating a confusion maybe you should try changing the name of the dictionary
   2. unless you require exact key-values in your view i suggest you consider passing a list instead of a dictionary as dictionaries are not realy meant for iteration. i attached a example in case you need one.

Screenshot from 2019-08-14 17-40-20.png

RONAK JAIN

unread,
Aug 14, 2019, 8:53:19 AM8/14/19
to django...@googlegroups.com
Hey, Thank you for your reply.


As you said, when I am doing like that then, I am not getting my proper row like a horizontal series content and images also.

Attached screenshots take a look and revert back to me.

Thanks & Regards



--
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/3ae31efb-6145-4576-a509-e9dad03aa5f1%40googlegroups.com.
Screenshot 2019-08-14 at 6.19.08 PM.png
Screenshot 2019-08-14 at 6.21.32 PM.png
Screenshot 2019-08-14 at 6.22.02 PM.png

Manzur Alahi

unread,
Aug 14, 2019, 9:56:47 AM8/14/19
to Django users
For image: use *** src = "{{course.img.url}}"

for the horizontal list issue, that seems to be an issue with html or css styling, sorry to say i'm not good with these things.

RONAK JAIN

unread,
Aug 14, 2019, 10:33:15 AM8/14/19
to django...@googlegroups.com
Thanks for help...

On Wed, Aug 14, 2019 at 7:27 PM Manzur Alahi <levi...@gmail.com> wrote:
For image: use *** src = "{{course.img.url}}"

for the horizontal list issue, that seems to be an issue with html or css styling, sorry to say i'm not good with these things.

--
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.
Reply all
Reply to author
Forward
0 new messages