﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31511	Allow stopwords in slugs generated by ModelAdmin.prepopulated_fields	Andy Chosak		"Automatic slug generation in ModelAdmin via [https://docs.djangoproject.com/en/3.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.prepopulated_fields prepopulated_fields] uses a [https://github.com/django/django/blob/b2bd08bb7a912a1504f5fb5018f5317e6b5423cd/django/contrib/admin/static/admin/js/urlify.js urlify.js] file which, among other behaviors, [https://github.com/django/django/blob/b2bd08bb7a912a1504f5fb5018f5317e6b5423cd/django/contrib/admin/static/admin/js/urlify.js#L168-L176 removes certain stop words from the slug]. For example, a string like ""To be or not to be, that is the question"" will generate a slug ""be-or-not-be-question"", not ""to-be-or-not-to-be-that-is-the-question"" as one might expect.

For reference, the current list is: a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with.

The current list of stopwords being removed seems to have been the same since at least 2005 (the earliest code I can find including this logic). Some of these words feel a little unexpected, for example “before” and “since”. It seems likely that stop word removal was introduced for SEO purposes, but this no longer seems to be a modern best practice. I propose removing this behavior so that these words are no longer stripped from slugs generated via prepopulated_fields.

I posted this proposal to https://groups.google.com/forum/#!topic/django-developers/9ayU7fTuuAM and received one supportive reply from Adam Johnson. @Scotchester and I have collaborated on a patch.

(#30538 mentions this behavior as part of a more general comparison between urlify.js and Python slugify. It was closed as wontfix due to reasons of backwards compatibility. This ticket specifically addresses stopword removal in the JS code only, not any other differences in behavior between these two methods.)"	Cleanup/optimization	closed	contrib.admin	dev	Normal	duplicate	urlify, slugify, slug	Scott Cranfill	Unreviewed	1	0	0	0	0	1
