Using Carousel in popup to display images and video details

HI, In our table we have images and video details .So we can view seperately and also we have option called view all.So when user click on 'view all' button it should display popup and populate all images and video details with arrwow mark.So i am using carousel for viewing this

obj={}
viewList=[]
for data in value:
     obj={'viewPath':'General/Popup/allPopup','viewParams':{'id':data['ID'],'isImage':data['isImage'],'isVideo':isVideo,'description':data['Description']}}
     viewList.append(obj)
return viewList

..Is this better approch?

If it works for you then it looks OK.

Tip: You don't need obj = {} because you are declaring it in the line obj = {'viewPath':...`.

yeah it works.okay .