Fixed #7903 -- Allow admin's prepopulated_from to work with TextFields. Patch

from mk and Alex Gaynor.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8505 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2008-08-23 22:10:45 +00:00
parent aa78a05e69
commit b3688e8194
1 changed files with 2 additions and 2 deletions

View File

@ -4,8 +4,8 @@
{% for dependency in field.dependencies %} {% for dependency in field.dependencies %}
document.getElementById("{{ dependency.auto_id }}").onkeyup = function() { document.getElementById("{{ dependency.auto_id }}").onkeyup = function() {
var e = document.getElementById("{{ field.field.auto_id }}"); var e = document.getElementById("{{ field.field.auto_id }}");
if (!e._changed) { e.value = URLify({% for innerdep in field.dependencies %}document.getElementById("{{ innerdep.auto_id }}").value{% if not forloop.last %} + ' ' + {% endif %}{% endfor %}, {{ field.field.field.max_length }}); } if (!e._changed) { e.value = URLify({% for innerdep in field.dependencies %}document.getElementById("{{ innerdep.auto_id }}").value{% if not forloop.last %} + ' ' + {% endif %}{% endfor %}, {{ field.field.field.max_length|default_if_none:"50" }}); }
} }
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
</script> </script>