mirror of
https://github.com/Hopiu/django-uuslug.git
synced 2026-03-16 20:10:24 +00:00
Merge remote-tracking branch 'upstream/master' into refactor_uuslug
This commit is contained in:
commit
bcc1c6ca48
6 changed files with 16 additions and 19 deletions
2
LICENSE
2
LICENSE
|
|
@ -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
12
README
|
|
@ -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.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
10
history.txt
Normal 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
|
||||
4
setup.py
4
setup.py
|
|
@ -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'],
|
||||
|
|
|
|||
|
|
@ -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.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue