Example:
{{{
class Media(models.Model):
author = models.ForeignKey('Author', verbose_name="Author",
on_delete=models.SET_NULL, to_field="name", default="Unknown", null=True)
}}}
In this case, if the Author.name contains a space, the generated URL to
edit this author will be:
https://domain.com/admin/web_app/author/Spaced%20Name/change/?_to_field=name&_popup=1
The result is (in french with a translation, sorry):
[[Image(https://i.ibb.co/whYXg2Q/Administration.png)]]
The strange thing is that I can't reproduce this behaviour in my local
version.
--
Ticket URL: <https://code.djangoproject.com/ticket/32225>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Uncategorized => Bug
--
Ticket URL: <https://code.djangoproject.com/ticket/32225#comment:1>
* status: new => closed
* resolution: => duplicate
Comment:
I also cannot reproduce this issue with spaces, but it's possible with
other keys, e.g. `_40`. I believe we can close this as a duplicate of
#30386, which is due to the fact that foreign key widgets don't quote
keys.
--
Ticket URL: <https://code.djangoproject.com/ticket/32225#comment:2>