aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2013-01-15 15:48:19 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2013-01-15 15:48:19 -0600
commit88de830fcfb3fb02af4b2d71b82efaa8c83df665 (patch)
tree71b057dc3273c38c0253823a0dcf617c1dbb4525 /setup.py
parent72bb46c7c81983817f5060d67c65663f911c4504 (diff)
downloadmediagoblin-88de830fcfb3fb02af4b2d71b82efaa8c83df665.tar.lz
mediagoblin-88de830fcfb3fb02af4b2d71b82efaa8c83df665.tar.xz
mediagoblin-88de830fcfb3fb02af4b2d71b82efaa8c83df665.zip
A revised algorithm for generating slugs.
This one does not *force* slugs, but usually it will probably result in a niceish one. The end *result* of the algorithm will (presumably, I have not tested it) result in these resolutions for these situations: - If we have a slug, make sure it's clean and sanitized, and if it's unique, we'll use that. - If we have a title, slugify it, and if it's unique, we'll use that. - If we can't get any sort of thing that looks like it'll be a useful slug out of a title or an existing slug, bail, and don't set the slug at all. Don't try to create something just because. Make sure we have a reasonable basis for a slug first. - If we have a reasonable basis for a slug (either based on existing slug or slugified title) but it's not unique, first try appending the entry's id, if that exists - If that doesn't result in something unique, tack on some randomly generated bits until it's unique. That'll be a little bit of junk, but at least it has the *basis* of a nice slug!
Diffstat (limited to 'setup.py')
0 files changed, 0 insertions, 0 deletions