Package: django-salmonella
Importantdjango-salmonella was renamed to django-dynamic-raw-id. This salmonella package
is no longer maintained. Please seehttps://pypi.org/project/django-dynamic-raw-id/.django-salmonellaA Django admin raw_id_fields widget replacement that handles display of an
object’s string value on change and can be overridden via a template.
See this example:InstallationInstall the package withpip:$ pip install django-salmonellaPutsalmonellato your list ofINSTALLED_APPS:INSTALLED_APPS = (
    # ... other apps
    'salmonella',
)And add theurlpattern:urlpatterns = [
    # ...
    url(r'^admin/salmonella/', include('salmonella.urls')),
]salmonellacomes with some static files so don’t forget to runmanage.py collectstatic.UsageTo start using django-salmonella in your application all you need to do is
implementSalmonellaMixinin yourModelAdminclass and add the desired
fields to a list ofsalmonella_fields:from salmonella.admin import SalmonellaMixin

class UserProfileAdmin(SalmonellaMixin, admin.ModelAdmin):
    salmonella_fields = ('user',)You can use Salmonella widgets in a Admin filter as well:from salmonella.admin import SalmonellaMixin
from salmonella.filters import SalmonellaFilter

class UserProfileAdmin(SalmonellaMixin, admin.ModelAdmin):
   list_filter = (
       ('salmonella_fk', SalmonellaFilter),
   )Customizing the value of the dynamic widgetThe coolest feature of django-salmonella is the ability to customize the output
of the value displayed alongside theSalmonellaIdWidget.  There is a basic
implementation if all you want is your object’s__unicode__value. To change
the value displayed all you need to do is implement the correct template.Django-salmonella looks for this template structuresalmonella/<app>/<model>.htmlandsalmonella/<app>/multi_<model>.html(for multi-value lookups).For instance, if I have a blog post with aUsersalmonella field that I want
display asFirstname Lastname, I would create the templatesalmonella/auth/user.htmlwith:<span>{{ object.0.first_name }} {{ object.0.last_name }}</span>A custom admin URL prefixIf you have your adminandthe Salmonella scripts located on a different
prefix than/admin/salmonella/you need adjust theSALMONELLA_MOUNT_URLJS variable.Example:# In case the script is setup at /foobar/salmonella/
url(r'^foobar/salmonella/', include('salmonella.urls')),

# Provide a
<script>
    window.SALMONELLA_MOUNT_URL = "{% url "admin:index" %}";
</script>An ideal place is the adminbase_site.htmltemplate. Full example:{% extends "admin/base.html" %}

{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}

{% block extrahead %}
  {{ block.super }}
  <script>
    window.SALMONELLA_MOUNT_URL = "{% url "admin:index" %}";
  </script>
{% endblock %}

{% block branding %}
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
{% endblock %}

{% block nav-global %}{% endblock %}Testing and Local DevelopmentRun the testsuite in your local environment using:$ cd django-salmonella/
$ pipenv install --dev
$ pipenv run python ./runtests.pyOr use tox to test against various Django and Python versions:$ tox -rYou can also invoke the test suite or other ‘manage.py’ commands by calling
thedjango-admintool with the test app settings:$ cd django-salmonella/
$ pipenv install --dev
$ pipenv run django-admin
$ pipenv run django-admin testThis also allows you to run the internal testing app in a testserver, to
preview a sample of what django-salmonella is doing:$ pipenv run django-admin migrate
$ pipenv run django-admin createsuperuser
$ pipenv run django-admin runserverNoteThe default settings file is set in the.envfile which
pipenv automatically exposes:DJANGO_SETTINGS_MODULE=salmonella.tests.testapp.settings