- if not self.attrs.has_key('id'):
- final_attrs['id'] = 'id_%s' % name
-
- html = u'''<input type="text" %(attrs)s/>
- <script type="text/javascript">//<!--
- %(js)s//--></script>
- ''' % {
- 'attrs' : flatatt(final_attrs),
- 'js' : self.render_js(final_attrs['id']),
- }
-
- return mark_safe(html)
-
-
-class JQueryAutoCompleteField(forms.CharField):
- def __init__(self, source, options=None, *args, **kwargs):
- if 'widget' not in kwargs:
- kwargs['widget'] = JQueryAutoCompleteWidget(source, options)
-
- super(JQueryAutoCompleteField, self).__init__(*args, **kwargs)