1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

newforms-admin: Removed auto_populated_field_script template tag, which is no longer used

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4447 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2007-01-29 01:27:57 +00:00
parent 126c6cef52
commit e6cd7fcacc

View File

@ -143,23 +143,6 @@ def output_all(form_fields):
return ''.join([str(f) for f in form_fields])
output_all = register.simple_tag(output_all)
def auto_populated_field_script(auto_pop_fields, change = False):
t = []
for field in auto_pop_fields:
if change:
t.append('document.getElementById("id_%s")._changed = true;' % field.name)
else:
t.append('document.getElementById("id_%s").onchange = function() { this._changed = true; };' % field.name)
add_values = ' + " " + '.join(['document.getElementById("id_%s").value' % g for g in field.prepopulate_from])
for f in field.prepopulate_from:
t.append('document.getElementById("id_%s").onkeyup = function() {' \
' var e = document.getElementById("id_%s");' \
' if(!e._changed) { e.value = URLify(%s, %s);} }; ' % (
f, field.name, add_values, field.maxlength))
return ''.join(t)
auto_populated_field_script = register.simple_tag(auto_populated_field_script)
def field_widget(parser, token):
bits = token.contents.split()
if len(bits) != 2: