#7028: Better raw_id_fields feedback in newform-admins branch
---------------------------------------------------+------------------------
          Reporter:  Marcob <marcob...@gmail.com>  |         Owner:  nobody     
              
            Status:  new                           |     Milestone:  1.2        
              
         Component:  django.contrib.admin          |       Version:  SVN        
              
        Resolution:                                |      Keywords:  
raw-id-fields nfa-someday
             Stage:  Accepted                      |     Has_patch:  1          
              
        Needs_docs:  0                             |   Needs_tests:  1          
              
Needs_better_patch:  1                             |  
---------------------------------------------------+------------------------
Comment (by mrts):

 Marco, good point, but here come some of my notes:

  1. the added block should be within the `} else if (elem.nodeName ==
 'INPUT') {` branch,
  1. as `win.location.href` already is a string, there is no need to cast
 it,
  1. we should not `split()` as theoretically it's not impossible that the
 path already contains an add, e.g. a contrived but not illegal
 '/add/admin/add/add/` (admin is mounted under `/add/`, there's an app
 labeled `add`), so I propose the following instead: `var chosenIdHref =
 win.location.href.replace(/\/add\/[^\/]*$/, '/' + newId + '/');` (that
 gets rid of the redundant `?_popup=1` as well),
  1. it makes sense to store the escaped copy of newRepr in the beginning
 and not escape it again.

 Thanks! I've updated the patch accordingly, re-merged master and will
 upload the resulting patch shortly.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7028#comment:37>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to