Django

Code

Changeset 4447

Show
Ignore:
Timestamp:
01/28/07 19:27:57 (2 years ago)
Author:
adrian
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/django/contrib/admin/templatetags/admin_modify.py

    r4391 r4447  
    144144output_all = register.simple_tag(output_all) 
    145145 
    146 def auto_populated_field_script(auto_pop_fields, change = False): 
    147     t = [] 
    148     for field in auto_pop_fields: 
    149         if change: 
    150             t.append('document.getElementById("id_%s")._changed = true;' % field.name) 
    151         else: 
    152             t.append('document.getElementById("id_%s").onchange = function() { this._changed = true; };' % field.name) 
    153  
    154         add_values = ' + " " + '.join(['document.getElementById("id_%s").value' % g for g in field.prepopulate_from]) 
    155         for f in field.prepopulate_from: 
    156             t.append('document.getElementById("id_%s").onkeyup = function() {' \ 
    157                      ' var e = document.getElementById("id_%s");' \ 
    158                      ' if(!e._changed) { e.value = URLify(%s, %s);} }; ' % ( 
    159                      f, field.name, add_values, field.maxlength)) 
    160     return ''.join(t) 
    161 auto_populated_field_script = register.simple_tag(auto_populated_field_script) 
    162  
    163146def field_widget(parser, token): 
    164147    bits = token.contents.split()