Andy Mikhailenko avatar Andy Mikhailenko committed 51c65a3

Allow importing AutoSlugField directly from the autoslug module.

Comments (0)

Files changed (4)

autoslug/__init__.py

 #  Software Foundation. See the file README for copying conditions.
 #
 
-__author__  = 'Andy Mikhailenko'
-__license__ = 'GNU Lesser General Public License (GPL), Version 3'
-__url__     = 'http://bitbucket.org/neithere/django-autoslug/'
-__version__ = '1.3.2'
+from fields import AutoSlugField
+
+__all__     = ['AutoSlugField']

autoslug/fields.py

 from autoslug.settings import slugify
 
 
+__all__ = ['AutoSlugField']
+
 SLUG_INDEX_SEPARATOR = '-'    # the "-" in "foo-2"
 
 
     Example usage::
 
         from django.db import models
-        from autoslug.fields import AutoSlugField
+        from autoslug import AutoSlugField
 
         class Article(models.Model):
             '''An article with title, date and slug. The slug is not totally
         while True:
             rivals = model.objects\
                           .filter(**dict(lookups + ((self.name, slug),) ))\
-                          .exclude(pk=instance.pk)                              
+                          .exclude(pk=instance.pk)
             if not rivals:
                 # the slug is unique, no model uses it
                 return slug
-                
+
             # the slug is not unique; change once more
             index += 1
             # ensure the resulting string is not too long
             # re-generate the slug
             data = dict(slug=orig_slug, sep=self.index_sep, index=index)
             slug = '%(slug)s%(sep)s%(index)d' % data
-            

autoslug/tests.py

 
 # this app
 from autoslug.settings import slugify as default_slugify
-from autoslug.fields import AutoSlugField
+from autoslug import AutoSlugField
 
 
 class SimpleModel(Model):
 #  Software Foundation. See the file README for copying conditions.
 #
 
-"django-autoslug setup"
-
 import os
 from setuptools import setup
-from autoslug import __version__
+
 
 setup(
     name     = 'django-autoslug',
-    version  = __version__,
+    version  = '1.3.3',
     packages = ['autoslug'],
 
     requires = ['python (>= 2.4)', 'django (>= 1.0)'],
     url          = 'http://bitbucket.org/neithere/django-autoslug/',
     download_url = 'http://bitbucket.org/neithere/django-autoslug/get/tip.zip',
     license      = 'GNU Lesser General Public License (LGPL), Version 3',
-    keywords     = 'django field slug auto transliteration i18n',
+    keywords     = 'django field slug auto unique transliteration i18n',
     classifiers  = [
         'Development Status :: 5 - Production/Stable',
         'Environment :: Web Environment',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.