[Django] #19515: Redirect path fields arbitrarily short

9 views
Skip to first unread message

Django

unread,
Dec 24, 2012, 12:40:33 PM12/24/12
to django-...@googlegroups.com
#19515: Redirect path fields arbitrarily short
--------------------------------------+-----------------------
Reporter: s.shanabrook@… | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.redirects | Version: 1.4
Severity: Normal | Keywords: redirects
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+-----------------------
In `django.contrib.redirects` the the `old_path` and `new_path` have
`max_length=200`. This presents problems when either of the paths has a
longer length than 200. `URLField` used to have a `max_length=200`, but
this was resolved [1477] and isn't even applicable, since the path fields
use `CharField`s, not `URLfield`s.

I would recommend a `max_length=2000`. URL's with a length over 2000 are
[http://stackoverflow.com/questions/417142/what-is-the-maximum-length-
of-a-url not as well supported]. However since
[https://docs.djangoproject.com/en/dev/ref/databases/#character-fields
database enforcement of CharFields in MySQL is limited to 255 characters],
the fields have to be also changed to `TextField`s.

--
Ticket URL: <https://code.djangoproject.com/ticket/19515>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 24, 2012, 12:41:13 PM12/24/12
to django-...@googlegroups.com
#19515: Redirect path fields arbitrarily short
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner: anonymous
Type: | Status: assigned
Cleanup/optimization | Version: 1.4
Component: contrib.redirects | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Saul Shanabrook <s.shanabrook@…>):

* status: new => assigned
* needs_better_patch: => 1
* needs_tests: => 0
* keywords: redirects =>
* owner: nobody => anonymous
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:1>

Django

unread,
Dec 24, 2012, 12:43:50 PM12/24/12
to django-...@googlegroups.com
#19515: Redirect path fields arbitrarily short
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner:
Type: | saulshanabrook
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: 1.4
Severity: Normal | Resolution:
Keywords: | Triage Stage:
Has patch: 0 | Unreviewed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 1 | Patch needs improvement: 1
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by saulshanabrook):

* owner: anonymous => saulshanabrook


--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:2>

Django

unread,
Dec 24, 2012, 12:52:43 PM12/24/12
to django-...@googlegroups.com
#19515: Redirect path fields arbitrarily short
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner:
Type: | saulshanabrook
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage:
Has patch: 0 | Unreviewed
Needs tests: 0 | Needs documentation: 0
Easy pickings: 1 | Patch needs improvement: 1
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by saulshanabrook):

* version: 1.4 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:3>

Django

unread,
Dec 24, 2012, 1:22:14 PM12/24/12
to django-...@googlegroups.com
#19515: Redirect path fields arbitrarily short
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner:
Type: | saulshanabrook
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
Has patch: 1 | Unreviewed

Needs tests: 0 | Needs documentation: 0
Easy pickings: 1 | Patch needs improvement: 1
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by saulshanabrook):

* has_patch: 0 => 1


Comment:

Created fix at https://github.com/saulshanabrook/django/tree/ticket_19515

--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:4>

Django

unread,
Dec 24, 2012, 1:49:28 PM12/24/12
to django-...@googlegroups.com
#19515: Redirect path fields arbitrarily short
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner:
Type: | saulshanabrook
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
Has patch: 1 | Someday/Maybe

Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 1
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* easy: 1 => 0
* stage: Unreviewed => Someday/Maybe


Comment:

Thanks for the suggestion. The problem here isn't to change the max_size —
it's to provide a suitable upgrade path for existing users. Otherwise,
application-level and database-level constraints won't match any longer,
which will result in uncaught errors.

In general we've postponed this kind of requests to after Django gets
built-in migrations — most likely 1.6 or 1.7.

--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:5>

Django

unread,
Feb 13, 2013, 7:17:59 PM2/13/13
to django-...@googlegroups.com
#19515: Redirect path fields arbitrarily short
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner:
Type: | saulshanabrook
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
Has patch: 1 | Someday/Maybe
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 1
| UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by s.shanabrook@…):

Even though we don't need the form provided by a `CharField`, MySQL limits
unique `Charfield`s to 255 characters:

https://docs.djangoproject.com/en/dev/ref/databases/#character-fields

"Any fields that are stored with VARCHAR column types have their
max_length restricted to 255 characters if you are using unique=True for
the field. This affects CharField, SlugField and
CommaSeparatedIntegerField."

--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:6>

Django

unread,
Aug 6, 2015, 2:19:29 PM8/6/15
to django-...@googlegroups.com
#19515: Increase the max_length of Redirect.old_path/new_path

-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner:
Type: | saulshanabrook
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Someday/Maybe => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:7>

Django

unread,
Apr 25, 2016, 8:36:54 PM4/25/16
to django-...@googlegroups.com
#19515: Increase the max_length of Redirect.old_path/new_path
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner:
Type: | saulshanabrook
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by gavinwahl):

* cc: gavinwahl+gh@… (added)


Comment:

Django now has built-in migrations. Is this feasible now?

--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:8>

Django

unread,
Apr 25, 2016, 8:40:02 PM4/25/16
to django-...@googlegroups.com
#19515: Increase the max_length of Redirect.old_path/new_path
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner:
Type: | saulshanabrook
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timgraham):

I'd think so (hence why I moved the ticket to accepted).

--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:9>

Django

unread,
Sep 30, 2017, 11:37:07 AM9/30/17
to django-...@googlegroups.com
#19515: Increase the max_length of Redirect.old_path/new_path
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner: Saul
Type: | Shanabrook

Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

This will be far easier once #28661 is fixed.

--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:10>

Django

unread,
Dec 30, 2021, 8:03:16 AM12/30/21
to django-...@googlegroups.com
#19515: Increase the max_length of Redirect.old_path/new_path
--------------------------------------+------------------------------------
Reporter: s.shanabrook@… | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.redirects | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: Saul Shanabrook => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:11>

Django

unread,
Jun 2, 2023, 7:32:56 AM6/2/23
to django-...@googlegroups.com
#19515: Increase the max_length of Redirect.old_path/new_path
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned

Component: contrib.redirects | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael Howitz):

* owner: (none) => Michael Howitz


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:12>

Django

unread,
Jun 2, 2023, 8:10:38 AM6/2/23
to django-...@googlegroups.com
#19515: Increase the max_length of Redirect.old_path/new_path
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Michael Howitz):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:13>

Django

unread,
Jun 5, 2023, 6:30:14 AM6/5/23
to django-...@googlegroups.com
#19515: Increase the max_length of Redirect.old_path/new_path
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:14>

Django

unread,
Mar 15, 2024, 7:43:10 AM3/15/24
to django-...@googlegroups.com
#19515: Increase the max_length of Redirect.old_path/new_path
-------------------------------------+-------------------------------------
Reporter: s.shanabrook@… | Owner: Michael
Type: | Howitz
Cleanup/optimization | Status: assigned
Component: contrib.redirects | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak):

Blocked by #28661.
--
Ticket URL: <https://code.djangoproject.com/ticket/19515#comment:15>
Reply all
Reply to author
Forward
0 new messages