def render(self, request): result = [self.prefix] urls = list(self.urls) for path in self.paths: urls.append(static_url(self.resource, path, request)) if self.type == 'css': s = '<link %shref="%s" />' else: s = '<script %ssrc="%s"> </script>' extra = ' '.join('%s="%s"'%(k,v) for k, v in self.extra.items()) if extra: extra = '%s '%extra return '%s%s%s'%( self.prefix, '\n\n\t'.join(s%(extra, url) for url in urls), self.postfix)