Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#1296 closed defect (fixed)

[patch] Allow SlugFields longer than 50

Reported by: anonymous Owned by: Adrian Holovaty
Component: Metasystem Version: magic-removal
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I ran in to the hard 50 character SlugField limit while importing my wordpress blog entries to Django. While slugs longer than 50 are probably not desirable, there may be some cases (such as this) where they are required. I've patched trunk as of [2185] to default to a maxlength of 50 but allow that value to be overridden.

It works perfectly for me on Postgres, but it should behave just fine on the other backends too.

I haven't checked out magic-removal yet but can apply these changes there too if that will help.

Attachments (1)

slugfield.patch (4.4 KB) - added by matt 11 years ago.
Patch to allow SlugFields with maxlength greater than 50

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by matt

Attachment: slugfield.patch added

Patch to allow SlugFields with maxlength greater than 50

comment:1 Changed 11 years ago by matt

I just noticed that I filled out this ticket as "anonymous". Oops!

comment:2 Changed 11 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [2325]) Fixed #1296 -- Made SlugField maxlength configurable. Thanks, Matt

comment:3 Changed 11 years ago by Andy Dustman <farcepest@…>

Resolution: fixed
Status: closedreopened
Version: SVNmagic-removal

The changes to fields.py were never merged into magic-removal; it still has a mandatory maxlength=50. Trivial one-line fix:

        kwargs['maxlength'] = kwargs.get('maxlength', 50)

comment:4 Changed 11 years ago by Adrian Holovaty

Resolution: fixed
Status: reopenedclosed

(In [2737]) magic-removal: Fixed #1296 (allow SlugFields longer than 50)

Note: See TracTickets for help on using tickets.
Back to Top