#29010: Allow customizing the autocomplete search results based on the querying
model
-------------------------------------+-------------------------------------
     Reporter:  Muslu Y.             |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  contrib.admin        |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  ForeignKey,          |             Triage Stage:
  get_search_results, search_fields  |  Someday/Maybe
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):

 * stage:  Accepted => Someday/Maybe


Comment:

 Hi there,

 currently you don't explicitly know who is calling this method, since it's
 all called from the same view. Both Widgets call the same view as the view
 is on AAdmin.
 So this is conceptually not supported. That doesn't mean it doesn't work.
 You can always check https://en.wikipedia.org/wiki/HTTP_referer

 To add a bit more context here, we did have an intermediate solution that
 would have made this easier. A view per widget. We ultimately dropped that
 approach to decrease complexity. A decision I still support.

 My suggestion would be use an external library like `django-select2` or
 `django-autocomplete` if you want to implement more sophisticated logic.
 Please also keep in mind, the admin is not recommend to be used for
 sofistikated user interfaces.

 Anyhow, at the moment I would strongly advice against adding a "hint" to
 the request. Since it's not safe against request forging and can lead to
 unintended security issues.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29010#comment:6>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.382b4a7074c58830131c7d00e5943d66%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to