Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
Removing a hard-coded url in the autocomplete field. Oops.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanborror committed Jul 5, 2010
1 parent a327dee commit 2b7ccc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion basic/tools/forms/fields.py
Expand Up @@ -43,6 +43,7 @@ def __init__(self, model, url, attrs=None, required=True):
self.attrs = attrs or {}
self.required = required
self.Model = model
self.url = url

def render(self, name, value, attrs=None):
text_html = self.create_input(TextInput, name, self.text_field)
Expand All @@ -54,7 +55,7 @@ def render(self, name, value, attrs=None):
for obj in object_list:
results += '<span class="ac_result"><a href="#%s">x</a>%s</span>\n' % (obj.pk, obj.get_full_name())

script = '<script type="text/javascript">new AutoCompleteWidget("id_%s", "/library/autocomplete/authors/");</script>' % (self.text_field % name)
script = '<script type="text/javascript">new AutoCompleteWidget("id_%s", "%s");</script>' % (self.text_field % name, self.url)
return mark_safe(u'\n'.join([text_html, results, hidden_html, script]))

def create_input(self, Input, name, field, value=''):
Expand Down

0 comments on commit 2b7ccc5

Please sign in to comment.