I send several forms to a template, and I want to put all required media in the <head> tag. Some forms might require the same media (for instance, the same JS file), so I would like to unify all medias before putting them in the <head>. Question is, how do I do that? I know you can unify two medias by doing m1 + m2, but this will look ugly in the generic case where I have an unknown number of forms. Is there some shortcut?
I send several forms to a template, and I want to put all required
Share
The best way I could find was doing it using list comprehensions and
reduce:Wonder if there’s an easier way…