Andy Mikhailenko avatar Andy Mikhailenko committed e568b0d

Updated documentation.

Comments (0)

Files changed (2)

autoslug/fields.py

     (`unique_with`) or globally (`unique`) and adding a number to the slug to make
     it unique.
 
+    :param always_update: boolean: if True, the slug is updated each time the
+        model instance is saved. Use with care because `cool URIs don't
+        change`_ (and the slug is usually a part of object's URI). Note that
+        even if the field is editable, any manual changes will be lost when
+        this option is activated.
     :param populate_from: string or callable: if string is given, it is considered
         as the name of attribute from which to fill the slug. If callable is given,
         it should accept `instance` parameter and return a value to fill the slug
         a day for the same author. Foreign keys are also supported, i.e. not only
         `unique_with='author'` will do, but also `unique_with='author__name'`.
 
+    .. _cool URIs don't change: http://w3.org/Provider/Style/URI.html
+
     .. note:: always place any slug attribute *after* attributes referenced
         by it (i.e. those from which you wish to `populate_from` or check
         `unique_with`). The reasoning is that autosaved dates and other such
         # get currently entered slug
         value = self.value_from_object(instance)
 
-        # autopopulate (unless the field is editable and has some value)
-        if (self.populate_from and not value) or self.always_update: # and not self.editable:
+        # autopopulate
+        if self.always_update or (self.populate_from and not value):
             value = utils.get_prepopulated_value(self, instance)
 
             if __debug__ and not value:
 
 setup(
     name     = 'django-autoslug',
-    version  = '1.4.0',
+    version  = '1.4.1',
     packages = ['autoslug'],
 
     requires = ['python (>= 2.4)', 'django (>= 1.0)'],
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.