#6903: Go back to old change_list view after hitting save
---------------------------------------------+------------------------------
          Reporter:  jarrow                  |         Owner:  ramiro           
        
            Status:  new                     |     Milestone:  post-1.0         
        
         Component:  django.contrib.admin    |       Version:  newforms-admin   
        
        Resolution:                          |      Keywords:  nfa-someday 
yandex-sprint
             Stage:  Design decision needed  |     Has_patch:  1                
        
        Needs_docs:  0                       |   Needs_tests:  0                
        
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by ramiro):

  * needs_better_patch:  1 => 0
  * needs_tests:  1 => 0

Comment:

 Replying to [comment:12 jacob]:
 >  it still needs some fundamental improvement.

 > The main problem is that "guessing" the return URL from HTTP_REFERER
 leads to strange behavior.

 > This needs to be fixed. I think probably the best approach is to *only*
 read the return URL from `GET`, and to modify the changelist to pass the
 return URL through as a `GET` variable. That is, rewrite the links from
 the changelist to include the return URL in the link.

 I've implemented this change in the new `6903-r9904.diff` patch.

 >
 > (This means you'll want to choose a different URL keyword to avoid
 conflicting with a field named `return_to`. Probably `_return_to`, I'd
 say.)

 done
 >
 > Second, this patch needs some tests. Especially ones to make sure that
 the redirects stay sane in cases like above.

 done

 Jacob, your comment above cleared three of the four doubts I had posted to
 `django-dev` after attaching the first revised version of the patch. The
 only one remaining is this one (I'm reposting because it's a fundamental
 one and the answer will tell if the approach taken is valid or if we
 should consider others options discussed like storing things in the
 session instead):

 * It passes that URL around from view to view by using an query string
 value until the time to use it comes, it does so even when a POST request
 is sent (when editing or creating a model instance). Are we ok with this?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6903#comment:13>
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to