- js = (
- settings.ADMIN_MEDIA_PREFIX + "js/core.js",
- settings.ADMIN_MEDIA_PREFIX + "js/SelectBox.js",
- settings.ADMIN_MEDIA_PREFIX + "js/SelectFilter2.js",
- settings.ADMIN_MEDIA_PREFIX + "js/TagCreation.js",
- )
-
- def render(self, name, value, attrs=None, choices=()):
- if attrs is None: attrs = {}
- attrs['class'] = 'selectfilter'
- if self.is_stacked: attrs['class'] += 'stacked'
- output = [super(FilteredSelectMultiple, self).render(name, value, attrs, choices)]
- output.append(u'<script type="text/javascript">addEvent(window, "load", function(e) {')
- # TODO: "id_" is hard-coded here. This should instead use the correct
- # API to determine the ID dynamically.
- output.append(u'SelectFilter.init("id_%s", "%s", %s, "%s"); tagCreation.init("id_%s"); });</script>\n' % \
- (name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), settings.ADMIN_MEDIA_PREFIX, name))
- return mark_safe(u''.join(output))
\ No newline at end of file