#31210: Document backwards-compatible replacement for is_ajax()
-------------------------------------+-------------------------------------
     Reporter:  Collin Anderson      |                    Owner:  SUTHARRAM
         Type:                       |                   Status:  assigned
  Cleanup/optimization               |
    Component:  HTTP handling        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  1
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Collin Anderson):

 I'm just thinking if someone's trying to upgrade their app to use a new
 version of django, the most minimal change with the least chance of bugs
 would be to replace it with `request.META.get('HTTP_X_REQUESTED_WITH') ==
 'XMLHttpRequest'`. Sure, they could refactor their app so it uses
 `.accepts()`, but that's a bigger change (which could involve making
 changes on the front end, which might be a whole different team
 responsibly for it) and they're just trying to upgrade django right now.

 > Do you think that we should be so detailed and document the is_ajax()
 implementation in release notes? I'm not sure.

 Yes, otherwise, they're probably going to need to look it up. Especially
 considering it's only one line of code, why not make it easy for them?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31210#comment:4>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/072.6f68e4e29bfd039e2ebdb81301a60b04%40djangoproject.com.

Reply via email to