Merge remote-tracking branch 'upstream/master' into refactor_uuslug

This commit is contained in:
JensDiemer 2012-08-06 14:30:19 +02:00
commit bcc1c6ca48
6 changed files with 16 additions and 19 deletions

View file

@ -1,4 +1,4 @@
Copyright (c) 2011 Val L33 (val@neekware.com)
Copyright (c) 2012 Val Neekman (val@neekware.com)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,

12
README
View file

@ -1,14 +1,6 @@
django-uuslug
================
This fork notes
------------------------------------------------------------------------------------------------
Here ' symbol in result of unidecode.unidecode() is deleted instead of replacing with -.
For example for Russian word "Компьютер" unidecode.unidecode() returns "komp'uter",
then uuslug create "komp-uter" from this, but translitiration "komputer" seems more natural.
A Django slugify application that guarantees uniqueness and handles unicode.
UUSlug = (``U``nique + ``U``nicode Slug)
@ -47,7 +39,7 @@ self.assertEquals(r, "this-is-a-test")
s = 'C\'est déjà l\'été.'
r = slugify(s)
self.assertEquals(r, "c-est-deja-l-ete")
self.assertEquals(r, "c-est-deja-lete")
s = 'Nín hǎo. Wǒ shì zhōng guó rén'
r = slugify(s)
@ -104,7 +96,7 @@ add more test and examples
Credits:
=========
This is a cleaned and packaged up version of snippet (369) from http://www.djangosnippets.org/
This is inspired by a snippet from http://www.djangosnippets.org/
Improved to handle unique slugs and unicode chars and packaged for easy install.

View file

@ -7,7 +7,7 @@ eggs = django-uuslug
Django
[versions]
django = 1.3.1
django = 1.4.1
[python]
recipe = zc.recipe.egg

10
history.txt Normal file
View file

@ -0,0 +1,10 @@
- August 6, 2012
------------------------
1. history file created to track the changes
2. singleton "'" handling feature broke the testunit (fix pulled in from re_compile branch)
3. re cleanup (pulled in from re_compile branch)
4. up the version
5. updated the credit section from the README as the referred snippet no longer exists
6. include full name in setup.py
7. up Django to 1.4.1

View file

@ -5,10 +5,10 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='django-uuslug',
version='0.6',
version='0.7',
description = "A Django slugify application that guarantees uniqueness and handles unicode",
long_description = read('README'),
author='Val L33',
author='Val Neekman',
author_email='val@neekware.com',
url='http://github.com/un33k/django-uuslug',
packages=['uuslug'],

View file

@ -109,11 +109,6 @@ def uuslug(s, instance, entities=True, decimal=True, hexadecimal=True,
import uuslug as slugify
self.slug = slugify(self.name, instance=self)
Notes
-----
From http://www.djangosnippets.org/snippets/369/
"""
if hasattr(instance, 'objects'):
raise Exception("Error: you must pass an instance to uuslug, not a model.")