diff --git a/CREDITS.txt b/CREDITS.txt index 8dd427f..1a2f4ba 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -1,12 +1,13 @@ -Corey Oordt github.com/coordt -Erik Simmler github.com/tgecho -Martin Ogden githun.com/martinogden -Ramiro Morales github.com/ramiro -Evan Culver github.com/eculver -Andrzej Herok github.com/aherok -Jonathan Hensley github.com/jhensley -Justin Quick github.com/justquick -Josh Ourisman github.com/joshourisman -Jose Soares github.com/josesoa +Corey Oordt github.com/coordt +Erik Simmler github.com/tgecho +Martin Ogden githun.com/martinogden +Ramiro Morales github.com/ramiro +Evan Culver github.com/eculver +Andrzej Herok github.com/aherok +Jonathan Hensley github.com/jhensley +Justin Quick github.com/justquick +Josh Ourisman github.com/joshourisman +Jose Soares github.com/jsoa David Charbonnier github.com/oxys -Brad Jasper github.com/bradjasper \ No newline at end of file +Brad Jasper github.com/bradjasper +Martin Matusiak github.com/numerodix diff --git a/categories/__init__.py b/categories/__init__.py index 5fb30f6..37fd995 100644 --- a/categories/__init__.py +++ b/categories/__init__.py @@ -1,7 +1,7 @@ __version_info__ = { 'major': 1, 'minor': 0, - 'micro': 4, + 'micro': 5, 'releaselevel': 'final', 'serial': 1 } diff --git a/docs/_sources/reference/settings.txt b/docs/_sources/reference/settings.txt index d72456f..78df52d 100644 --- a/docs/_sources/reference/settings.txt +++ b/docs/_sources/reference/settings.txt @@ -85,6 +85,16 @@ FK_REGISTRY .. _THUMBNAIL_UPLOAD_PATH: +.. _REGISTER_ADMIN: + +REGISTER_ADMIN +============== + +**Default:** ``True`` + +**Description:** If you write your own category class by subclassing ``CategoryBase`` then you probably have no use for registering the default ``Category`` class in the admin. + + THUMBNAIL_UPLOAD_PATH ===================== @@ -108,4 +118,4 @@ JAVASCRIPT_URL **Default:** ``STATIC_URL or MEDIA_URL + 'js/'`` -**Description:** Allows for customization of javascript placement. \ No newline at end of file +**Description:** Allows for customization of javascript placement. diff --git a/docs/_static/basic.css b/docs/_static/basic.css index 925f7a5..f0379f3 100644 --- a/docs/_static/basic.css +++ b/docs/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -79,6 +79,14 @@ div.sphinxsidebar input { font-size: 1em; } +div.sphinxsidebar input[type="text"] { + width: 170px; +} + +div.sphinxsidebar input[type="submit"] { + width: 30px; +} + img { border: 0; } @@ -236,7 +244,6 @@ img.align-center, .figure.align-center, object.align-center { } .align-center { - clear: both; text-align: center; } @@ -413,7 +420,7 @@ dl.glossary dt { } .footnote:target { - background-color: #ffa + background-color: #ffa; } .line-block { @@ -440,10 +447,16 @@ dl.glossary dt { font-style: oblique; } +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + /* -- code displays --------------------------------------------------------- */ pre { overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ } td.linenos pre { @@ -524,4 +537,4 @@ span.eqno { #top-link { display: none; } -} +} \ No newline at end of file diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js index eeea95e..d4619fd 100644 --- a/docs/_static/doctools.js +++ b/docs/_static/doctools.js @@ -2,9 +2,9 @@ * doctools.js * ~~~~~~~~~~~ * - * Sphinx JavaScript utilties for all documentation. + * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -185,9 +185,9 @@ var Documentation = { body.highlightText(this.toLowerCase(), 'highlighted'); }); }, 10); - $('
' + _('Hide Search Matches') + '
') + .appendTo($('#searchbox')); } }, @@ -213,7 +213,7 @@ var Documentation = { * helper function to hide the search marks again */ hideSearchWords : function() { - $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); + $('#searchbox .highlight-link').fadeOut(300); $('span.highlighted').removeClass('highlighted'); }, diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js index 5cbfe00..663be4c 100644 --- a/docs/_static/searchtools.js +++ b/docs/_static/searchtools.js @@ -1,10 +1,10 @@ /* - * searchtools.js - * ~~~~~~~~~~~~~~ + * searchtools.js_t + * ~~~~~~~~~~~~~~~~ * * Sphinx JavaScript utilties for the full-text search. * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -36,10 +36,11 @@ jQuery.makeSearchSummary = function(text, keywords, hlwords) { return rv; } + /** * Porter Stemmer */ -var PorterStemmer = function() { +var Stemmer = function() { var step2list = { ational: 'ate', @@ -300,20 +301,20 @@ var Search = { }, query : function(query) { - var stopwords = ['and', 'then', 'into', 'it', 'as', 'are', 'in', - 'if', 'for', 'no', 'there', 'their', 'was', 'is', - 'be', 'to', 'that', 'but', 'they', 'not', 'such', - 'with', 'by', 'a', 'on', 'these', 'of', 'will', - 'this', 'near', 'the', 'or', 'at']; + var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"]; - // stem the searchterms and add them to the correct list - var stemmer = new PorterStemmer(); + // Stem the searchterms and add them to the correct list + var stemmer = new Stemmer(); var searchterms = []; var excluded = []; var hlterms = []; var tmp = query.split(/\s+/); - var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null; + var objectterms = []; for (var i = 0; i < tmp.length; i++) { + if (tmp[i] != "") { + objectterms.push(tmp[i].toLowerCase()); + } + if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) || tmp[i] == "") { // skip this "word" @@ -344,9 +345,6 @@ var Search = { var filenames = this._index.filenames; var titles = this._index.titles; var terms = this._index.terms; - var objects = this._index.objects; - var objtypes = this._index.objtypes; - var objnames = this._index.objnames; var fileMap = {}; var files = null; // different result priorities @@ -357,40 +355,19 @@ var Search = { $('#search-progress').empty(); // lookup as object - if (object != null) { - for (var prefix in objects) { - for (var name in objects[prefix]) { - var fullname = (prefix ? prefix + '.' : '') + name; - if (fullname.toLowerCase().indexOf(object) > -1) { - match = objects[prefix][name]; - descr = objnames[match[1]] + _(', in ') + titles[match[0]]; - // XXX the generated anchors are not generally correct - // XXX there may be custom prefixes - result = [filenames[match[0]], fullname, '#'+fullname, descr]; - switch (match[2]) { - case 1: objectResults.push(result); break; - case 0: importantResults.push(result); break; - case 2: unimportantResults.push(result); break; - } - } - } - } + for (var i = 0; i < objectterms.length; i++) { + var others = [].concat(objectterms.slice(0,i), + objectterms.slice(i+1, objectterms.length)) + var results = this.performObjectSearch(objectterms[i], others); + // Assume first word is most likely to be the object, + // other words more likely to be in description. + // Therefore put matches for earlier words first. + // (Results are eventually used in reverse order). + objectResults = results[0].concat(objectResults); + importantResults = results[1].concat(importantResults); + unimportantResults = results[2].concat(unimportantResults); } - // sort results descending - objectResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - importantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - unimportantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - // perform the search on the required terms for (var i = 0; i < searchterms.length; i++) { var word = searchterms[i]; @@ -489,7 +466,7 @@ var Search = { listItem.slideDown(5, function() { displayNextItem(); }); - }); + }, "text"); } else { // no source available, just display title Search.output.append(listItem); @@ -510,9 +487,74 @@ var Search = { } } displayNextItem(); + }, + + performObjectSearch : function(object, otherterms) { + var filenames = this._index.filenames; + var objects = this._index.objects; + var objnames = this._index.objnames; + var titles = this._index.titles; + + var importantResults = []; + var objectResults = []; + var unimportantResults = []; + + for (var prefix in objects) { + for (var name in objects[prefix]) { + var fullname = (prefix ? prefix + '.' : '') + name; + if (fullname.toLowerCase().indexOf(object) > -1) { + var match = objects[prefix][name]; + var objname = objnames[match[1]][2]; + var title = titles[match[0]]; + // If more than one term searched for, we require other words to be + // found in the name/title/description + if (otherterms.length > 0) { + var haystack = (prefix + ' ' + name + ' ' + + objname + ' ' + title).toLowerCase(); + var allfound = true; + for (var i = 0; i < otherterms.length; i++) { + if (haystack.indexOf(otherterms[i]) == -1) { + allfound = false; + break; + } + } + if (!allfound) { + continue; + } + } + var descr = objname + _(', in ') + title; + anchor = match[3]; + if (anchor == '') + anchor = fullname; + else if (anchor == '-') + anchor = objnames[match[1]][1] + '-' + fullname; + result = [filenames[match[0]], fullname, '#'+anchor, descr]; + switch (match[2]) { + case 1: objectResults.push(result); break; + case 0: importantResults.push(result); break; + case 2: unimportantResults.push(result); break; + } + } + } + } + + // sort results descending + objectResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + importantResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + unimportantResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + return [importantResults, objectResults, unimportantResults] } } $(document).ready(function() { Search.init(); -}); +}); \ No newline at end of file diff --git a/docs/_static/sidebar.js b/docs/_static/sidebar.js index 7318517..a45e192 100644 --- a/docs/_static/sidebar.js +++ b/docs/_static/sidebar.js @@ -16,7 +16,7 @@ * Once the browser is closed the cookie is deleted and the position * reset to the default (expanded). * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -29,6 +29,9 @@ $(function() { var sidebar = $('.sphinxsidebar'); var sidebarwrapper = $('.sphinxsidebarwrapper'); + // for some reason, the document has no sidebar; do not run into errors + if (!sidebar.length) return; + // original margin-left of the bodywrapper and width of the sidebar // with the sidebar expanded var bw_margin_expanded = bodywrapper.css('margin-left'); diff --git a/docs/_static/underscore.js b/docs/_static/underscore.js index 9146e08..5d89914 100644 --- a/docs/_static/underscore.js +++ b/docs/_static/underscore.js @@ -1,3 +1,10 @@ +// Underscore.js 0.5.5 +// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore is freely distributable under the terms of the MIT license. +// Portions of Underscore are inspired by or borrowed from Prototype.js, +// Oliver Steele's Functional, and John Resig's Micro-Templating. +// For all details and documentation: +// http://documentcloud.github.com/underscore/ (function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;eDjango Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
| - | + |
|
+
|
| - | + |
|
+
|
| + |
|
| - | + |
|
+
|
| + |
|
| - | + |
|
+
|
| + |
|
| - | + |
|
+
|
| + |
|
| - | + |
|
+
|
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Required BooleanField default: True
+Required BooleanField default: True
Is this item active. If it is inactive, all children are set to inactive as well.
CategoryManager
-An object manager that adds an active method for only selecting items whose active attribute is True.
+An object manager that adds an active method for only selecting items whose active attribute is True.
FileField
-An optional thumbnail, that is uploaded to THUMBNAIL_UPLOAD_PATH via THUMBNAIL_STORAGE.
+An optional thumbnail, that is uploaded to REGISTER_ADMIN via THUMBNAIL_STORAGE.
Note
Why isn’t this an ImageField?
@@ -237,7 +240,7 @@ diff --git a/docs/reference/settings.html b/docs/reference/settings.html index 4bf87ae..10ccb8f 100644 --- a/docs/reference/settings.html +++ b/docs/reference/settings.html @@ -2,17 +2,20 @@ + -Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
The CATEGORIES_SETTINGS dictionary is where you can override the default settings. You don’t have to include all the settings; only the ones which you want to override.
The default settings are:
@@ -123,48 +127,53 @@Default: False
-Description: Changing the slug for a category can have serious consequences if it is used as part of a URL. Setting this to True will allow users to change the slug of a category.
+Default: False
+Description: Changing the slug for a category can have serious consequences if it is used as part of a URL. Setting this to True will allow users to change the slug of a category.
Default: lambda x: x
Description: Allows the specification of a function to convert non-ASCII characters in the potential slug to ASCII characters. Allows specifying a callable() or a string in the form of 'path.to.module.function'.
A great tool for this is Unidecode. Use it by setting SLUG_TRANSLITERATOR to 'unidecode.unidecode.
Default: 0
Description: This setting will be deprecated soon, but in the mean time, it allows you to specify the amount of time each view result is cached.
Default: []
Description: Relation models is a set of models that a user can associate with this category. You specify models using 'app_name.modelname' syntax.
Default: {}
Description: A dictionary where the keys are in 'app_name.model_name' syntax, and the values are a string, dict, or tuple of dicts. See Registering Models.
Default: {}
Description: A dictionary where the keys are in 'app_name.model_name' syntax, and the values are a string, dict, or tuple of dicts. See Registering Models.
Default: True
+Description: If you write your own category class by subclassing CategoryBase then you probably have no use for registering the default Category class in the admin.
+Default: 'uploads/categories/thumbnails'
Description: Where thumbnails for the categories will be saved.
Default: settings.DEFAULT_FILE_STORAGE
Description: How to store the thumbnails. Allows for external storage engines like S3.
Default: STATIC_URL or MEDIA_URL + 'js/'
Description: Allows for customization of javascript placement.
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
Django Categories v1.0.1 documentation
+Django Categories 1.0.5 documentation
-+
- +
- 'new_level'
-- True if the current item is the start of a new level in -the tree, False otherwise.
+- True if the current item is the start of a new level in +the tree, False otherwise.
- 'closed_levels'
- A list of levels which end after the current item. This will be an empty list if the next item’s level is the same as or greater than the level of the current item.
An optional argument can be provided to specify extra details about the structure which should appear in the dict. This should be a comma-separated list of feature names. The valid feature names are:
-++
-
- ancestors
Adds a list of unicode representations of the ancestors of the current node, in descending order (root node first, immediate @@ -195,7 +198,7 @@ on the right: