I have a two lists. Upon passing those two to a custom template tag, it should ZIP them and return the object.
Is it possible? If so how to do that?
The respective operation is :
def zip_tag(arg1, arg2):
return zip(arg1, arg2)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As Joe says in the comments, I would consider zipping the lists in the view rather than the template. However, it should be possible to do it in the template with an assignment tag (untested code):
You would use it in your template as follows: