diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..c4d1b54 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,39 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Sphinx Pages + # You may pin to the exact commit or the version. + # uses: seanzhengw/sphinx-pages@70dd0557fc226cfcd41c617aec5e9ee4fce4afe2 + uses: seanzhengw/sphinx-pages@d29427677b3b89c1b5311d9eb135fb4168f4ba4a + with: + # Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + # Auto create a README.md file at branch gh-pages root with repo/branch/commit links + source_dir: "doc_src" diff --git a/doc_src/conf.py b/doc_src/conf.py index 0ffb72f..16c8213 100644 --- a/doc_src/conf.py +++ b/doc_src/conf.py @@ -29,7 +29,7 @@ import categories # noqa extensions = [] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +# templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' @@ -95,7 +95,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'default' +# html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/doc_src/requirements.txt b/doc_src/requirements.txt new file mode 100644 index 0000000..22fd550 --- /dev/null +++ b/doc_src/requirements.txt @@ -0,0 +1 @@ +# Add any extensions for Sphinx right here diff --git a/docs/.buildinfo b/docs/.buildinfo deleted file mode 100644 index 0885fbe..0000000 --- a/docs/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: -tags: diff --git a/docs/_sources/adding_the_fields.txt b/docs/_sources/adding_the_fields.txt deleted file mode 100644 index a6a920f..0000000 --- a/docs/_sources/adding_the_fields.txt +++ /dev/null @@ -1,23 +0,0 @@ -.. _adding_the_fields: - -================================= -Adding the fields to the database -================================= - -While Django will create the appropriate columns and tables if you configure Django Categories first, many times that is not possible. You could also reset the table, but you would loose all data in it. There is another way. - -Enter South -*********** - -`South `_ is a Django application for managing database schema changes. South's default behavior is for managing permanent changes to a model's structure. In the case of dynamically adding a field or fields to a model, this doesn't work because you are not making the change permanent. And probably don't want to. - -Django Categories has a management command to create any missing fields. It requires South because it uses the South's API for making changes to databases. The management command is simple: ``python manage.py add_category_fields [app]``\ . If you do not include an app name, it will attempt to do all applications configured. - -Running this command several times will not hurt any data or cause any errors. - -Reconfiguring Fields -******************** - -You can make changes to the field configurations as long as they do not change the underlying database structure. For example, adding a ``related_name`` (see :ref:`registering_a_m2one_relationship`\ ) because it only affects Django code. Changing the name of the field, however, is a different matter. - -Django Categories provides a complementary management command to drop a field from the database (the field must still be in the configuration to do so): ``python manage.py drop_category_field app_name model_name field_name`` \ No newline at end of file diff --git a/docs/_sources/custom_categories.txt b/docs/_sources/custom_categories.txt deleted file mode 100644 index f4ce71e..0000000 --- a/docs/_sources/custom_categories.txt +++ /dev/null @@ -1,56 +0,0 @@ -.. _creating_custom_categories: - -========================== -Creating Custom Categories -========================== - -Django Categories isn't just for using a single category model. It allows you to create your own custom category-like models with as little or much customization as you need. - -Name only -========= - -For many cases, you want a simple user-managed lookup table. You can do this with just a little bit of code. The resulting model will include name, slug and active fields and a hierarchical admin. - -#. Create a model that subclasses :py:class:`CategoryBase` - - .. literalinclude:: code_examples/custom_categories1.py - :linenos: - -#. Create a subclass of CategoryBaseAdmin. - - .. literalinclude:: code_examples/custom_categories2.py - :linenos: - -#. Register your model and custom model admin class. - -Name and other data -=================== - -Sometimes you need more functionality, such as extra metadata and custom functions. The :py:class:`Category` model in this package does this. - -#. Create a model that subclasses :py:class:`CategoryBase` as above. - -#. Add new fields to the model. The :py:class:`Category` model adds these extra fields. - - .. literalinclude:: code_examples/custom_categories3.py - :linenos: - -#. Add new methods to the model. For example, the :py:class:`Category` model adds several new methods, including overriding the :py:meth:`save` method. - - .. literalinclude:: code_examples/custom_categories4.py - :linenos: - -#. Alter :py:class:`Meta` or :py:class:`MPTTMeta` class. Either of these inner classes can be overridden, however your :py:class:`Meta` class should inherit :py:class:`CategoryBase.Meta`. Options for :py:class:`Meta` are in the `Django-MPTT docs `_. - - .. literalinclude:: code_examples/custom_categories5.py - :linenos: - -#. For the admin, you must create a form that subclasses :py:class:`CategoryBaseAdminForm` and at least sets the ``Meta.model`` attribute. You can also alter the form fields and cleaning methods, as :py:class:`Category` does. - - .. literalinclude:: code_examples/custom_categories6.py - :linenos: - -#. Next you must subclass :py:class:`CategoryBaseAdmin` and assign the ``form`` attribute the form class created above. You can alter any other attributes as necessary. - - .. literalinclude:: code_examples/custom_categories7.py - :linenos: diff --git a/docs/_sources/getting_started.txt b/docs/_sources/getting_started.txt deleted file mode 100644 index 4885628..0000000 --- a/docs/_sources/getting_started.txt +++ /dev/null @@ -1,74 +0,0 @@ -=============== -Getting Started -=============== - -You can use Django Categories in two ways: - -1. As storage for one tree of categories, using the :py:class:`Category` model:: - - Top Category 1 - Subcategory 1-1 - Subcategory 1-2 - subcategory 1-2-1 - Top Category 2 - Subcategory 2-1 - -2. As the basis for several custom categories (see :ref:`creating_custom_categories`), e.g. a **MusicGenre** model - - :: - - MusicGenre 1 - MusicSubGenre 1-1 - MusicSubGenre 1-2 - MusicSubGenre 1-2-1 - MusicGenre 2 - MusicSubGenre 2-1 - - and a **Subject** model - - :: - - Subject 1 - Discipline 1-1 - Discipline 1-2 - SubDiscipline 1-2-1 - Subject 2 - Discipline 2-1 - - - -Connecting your model with Django-Categories -============================================ - -There are two ways to add Category fields to an application. If you are in control of the code (it's your application) or you are willing to take control of the code (fork someone else's app) you can make a :ref:`hard_coded_connection`\ . - -For 3rd-party apps or even your own apps that you don't wish to add Django-Categories as a dependency, you can configure a :ref:`lazy_connection`\ . - -.. _hard_coded_connection: - -Hard Coded Connection ---------------------- - -Hard coded connections are done in the exact same way you handle any other foreign key or many-to-many relations to a model. - -.. code-block:: python - - from django.db import models - - class MyModel(models.Model): - name = models.CharField(max_length=100) - category = models.ForeignKey('categories.Category') - -Don't forget to add the field or fields to your ``ModelAdmin`` class as well. - - -.. _lazy_connection: - -Lazy Connection ---------------- - -Lazy connections are done through configuring Django Categories in the project's ``settings.py`` file. When the project starts up, the configured fields are dynamically added to the configured models and admin. - -If you do this before you have created the database (before you ran ``manage.py syncdb``), the fields will also be in the tables. If you do this after you have already created all the tables, you can run ``manage.py add_category_fields`` to create the fields (this requires Django South to be installed). - -You add a many-to-one or many-to-many relationship with Django Categories using the :ref:`FK_REGISTRY` and :ref:`M2M_REGISTRY` settings respectively. For more information see :ref:`registering_models`\ . diff --git a/docs/_sources/index.txt b/docs/_sources/index.txt deleted file mode 100644 index 33705cd..0000000 --- a/docs/_sources/index.txt +++ /dev/null @@ -1,43 +0,0 @@ -============================= -Django Categories v |version| -============================= - -Django Categories grew out of our need to provide a basic hierarchical taxonomy management system that multiple applications could use independently or in concert. - -As a news site, our stories, photos, and other content get divided into "sections" and we wanted all the apps to use the same set of sections. As our needs grew, the Django Categories grew in the functionality it gave to category handling within web pages. - -New in 1.1 -========== - -* Fixed a cosmetic bug in the Django 1.4 admin. Action checkboxes now only appear once. - -* Template tags are refactored to allow easy use of any model derived from ``CategoryBase``. - -* Improved test suite. - -* Improved some of the documentation. - - - -Contents -======== - -.. toctree:: - :maxdepth: 2 - :glob: - - installation - getting_started - usage - registering_models - adding_the_fields - custom_categories - reference/index - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/docs/_sources/installation.txt b/docs/_sources/installation.txt deleted file mode 100644 index 1cff18a..0000000 --- a/docs/_sources/installation.txt +++ /dev/null @@ -1,43 +0,0 @@ -============ -Installation -============ - -To use the Category model -========================= - -1. Install django-categories:: - - pip install django-categories - -2. Add ``"categories"`` and ``"categories.editor"`` to your ``INSTALLED_APPS`` list in your project's ``settings.py`` file. - - .. code-block:: python - - INSTALLED_APPS = [ - # ... - "categories", - "categories.editor", - ] - -3. Run ``./manage.py syncdb`` (or ``./manage.py migrate categories`` if you are using `South `_) - - -To only subclass CategoryBase -============================= - -If you are going to create your own models using :py:class:`CategoryBase`, (see :ref:`creating_custom_categories`) you'll need a few different steps. - -1. Install django-categories:: - - pip install django-categories - -2. Add ``"categories.editor"`` to your ``INSTALLED_APPS`` list in your project's ``settings.py`` file. - - .. code-block:: python - - INSTALLED_APPS = [ - # ... - "categories.editor", - ] - -3. Create your own models. diff --git a/docs/_sources/reference/index.txt b/docs/_sources/reference/index.txt deleted file mode 100644 index 9bca020..0000000 --- a/docs/_sources/reference/index.txt +++ /dev/null @@ -1,12 +0,0 @@ -========= -Reference -========= - -.. toctree:: - :maxdepth: 2 - :glob: - - management_commands - models - settings - templatetags diff --git a/docs/_sources/reference/management_commands.txt b/docs/_sources/reference/management_commands.txt deleted file mode 100644 index b090695..0000000 --- a/docs/_sources/reference/management_commands.txt +++ /dev/null @@ -1,38 +0,0 @@ -.. _management-commands: - -=================== -Management Commands -=================== - -.. _import_categories: - -import_categories -================= - -**Usage:** ``./manage.py import_categories /path/to/file.txt [/path/to/file2.txt]`` - -Imports category tree(s) from a file. Sub categories must be indented by the same multiple of spaces or tabs. The first line in the file cannot start with a space or tab and you can't mix spaces and tabs. - - -.. _add_category_fields: - -add_category_fields -=================== - -**Usage:** ``./manage.py add_category_fields [app1 app2 ...]`` - -Add missing registered category fields to the database table of a specified application or all registered applications. - -Requires Django South. - - -.. _drop_category_field: - -drop_category_field -=================== - -**Usage:** ``./manage.py drop_category_field app_name model_name field_name`` - -Drop the ``field_name`` field from the ``app_name_model_name`` table, if the field is currently registered in ``CATEGORIES_SETTINGS``\ . - -Requires Django South. \ No newline at end of file diff --git a/docs/_sources/reference/models.txt b/docs/_sources/reference/models.txt deleted file mode 100644 index 2ec5444..0000000 --- a/docs/_sources/reference/models.txt +++ /dev/null @@ -1,115 +0,0 @@ -====== -Models -====== - -CategoryBase -============ - -.. py:class:: CategoryBase - - .. py:attribute:: parent - - :py:class:`TreeForeignKey` ``(self)`` - - The category's parent category. Leave this blank for an root category. - - .. py:attribute:: name - - **Required** ``CharField(100)`` - - The name of the category. - - .. py:attribute:: slug - - **Required** ``SlugField`` - - URL-friendly title. It is automatically generated from the title. - - .. py:attribute:: active - - **Required** ``BooleanField`` *default:* ``True`` - - Is this item active. If it is inactive, all children are set to inactive as well. - - .. py:attribute:: objects - - ``CategoryManager`` - - An object manager that adds an ``active`` method for only selecting items whose ``active`` attribute is ``True``. - - .. py:attribute:: tree - - ``TreeManager`` - - A Django-MPTT `TreeManager `_ instance. - -Category -======== - -.. py:class:: Category - - Category is a subclass of :py:class:`CategoryBase` and includes all its attributes. - - .. py:attribute:: thumbnail - - ``FileField`` - - An optional thumbnail, that is uploaded to :ref:`thumbnail_upload_path` via :ref:`THUMBNAIL_STORAGE`. - - .. note:: Why isn't this an ``ImageField``? - - For ``ImageField``\ s, Django checks the file system for the existance of the files to handle the height and width. In many cases this can lead to problems and impact performance. - - For these reasons, a ``FileField`` that manually manages the width and height was chosen. - - .. py:attribute:: thumbnail_width - - ``IntegerField`` - - The thumbnail width. Automatically set on save if a thumbnail is uploaded. - - .. py:attribute:: thumbnail_height - - ``IntegerField`` - - The thumbnail height. Automatically set on save if a thumbnail is uploaded. - - .. py:attribute:: order - - **Required** ``IntegerField`` *default:* 0 - - A manually-managed order of this category in the listing. Items with the same order are sorted alphabetically. - - .. py:attribute:: alternate_title - - ``CharField(100)`` - - An alternative title to use on pages with this category. - - .. py:attribute:: alternate_url - - ``CharField(200)`` - - An alternative URL to use instead of the one derived from the category hierarchy. - - .. note:: Why isn't this a ``URLField``? - - For ``URLField``\ s, Django checks that the URL includes ``http://`` and the site name. This makes it impossible to use relative URLs in that field. - - .. py:attribute:: description - - ``TextField`` - - An optional longer description of the category. Very useful on category landing pages. - - .. py:attribute:: meta_keywords - - ``CharField(255)`` - - Comma-separated keywords for search engines. - - .. py:attribute:: meta_extra - - ``TextField`` - - (Advanced) Any additional HTML to be placed verbatim in the ```` of the page. diff --git a/docs/_sources/reference/settings.txt b/docs/_sources/reference/settings.txt deleted file mode 100644 index 78df52d..0000000 --- a/docs/_sources/reference/settings.txt +++ /dev/null @@ -1,121 +0,0 @@ -.. _reference_settings: - -======== -Settings -======== - -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. - -.. contents:: - :local: - - -The default settings are: - -.. code-block:: python - - CATEGORIES_SETTINGS = { - 'ALLOW_SLUG_CHANGE': False, - 'CACHE_VIEW_LENGTH': 0, - 'RELATION_MODELS': [], - 'M2M_REGISTRY': {}, - 'FK_REGISTRY': {}, - 'THUMBNAIL_UPLOAD_PATH': 'uploads/categories/thumbnails', - 'THUMBNAIL_STORAGE': settings.DEFAULT_FILE_STORAGE, - 'SLUG_TRANSLITERATOR': lambda x: x, - } - - -.. _ALLOW_SLUG_CHANGE: - -ALLOW_SLUG_CHANGE -================= - -**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. - -.. _SLUG_TRANSLITERATOR: - -SLUG_TRANSLITERATOR -=================== - -**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``. - - -.. _CACHE_VIEW_LENGTH: - -CACHE_VIEW_LENGTH -================= - -**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. - -.. _RELATION_MODELS: - -RELATION_MODELS -=============== - -**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. - -.. _M2M_REGISTRY: - -M2M_REGISTRY -============ - -**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 :ref:`registering_models`\ . - -.. _FK_REGISTRY: - -FK_REGISTRY -============ - -**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 :ref:`registering_models`\ . - -.. _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 -===================== - -**Default:** ``'uploads/categories/thumbnails'`` - -**Description:** Where thumbnails for the categories will be saved. - -.. _THUMBNAIL_STORAGE: - -THUMBNAIL_STORAGE -================= - -**Default:** ``settings.DEFAULT_FILE_STORAGE`` - -**Description:** How to store the thumbnails. Allows for external storage engines like S3. - -.. _JAVASCRIPT_URL: - -JAVASCRIPT_URL -============== - -**Default:** ``STATIC_URL or MEDIA_URL + 'js/'`` - -**Description:** Allows for customization of javascript placement. diff --git a/docs/_sources/reference/templatetags.txt b/docs/_sources/reference/templatetags.txt deleted file mode 100644 index 9f846fd..0000000 --- a/docs/_sources/reference/templatetags.txt +++ /dev/null @@ -1,348 +0,0 @@ -========================= -Template tags and filters -========================= - -.. contents:: - :depth: 2 - :local: - :backlinks: top - - -Filters -======= - - -``category_path`` ------------------ - -**Optional Parameter:** separator string. *Default:* ``" :: "`` - -Creates a path represented by a categories by joining the items with a separator. - -Each path item will be coerced to unicode, so you can pass a list of category instances, if required. - -**Example using a list of categories:** - -.. code-block:: django - - {{ some_list|category_path }} - -If ``some_list`` is ``[ , , ]`` the result will be:: - - Country :: Country pop :: Urban Cowboy - -**Example using a category node and optional separator parameter:** - -.. code-block:: django - - {{ some_node.get_ancestors|category_path:" > " }} - -If ``some_node`` was category "Urban Cowboy", the result will be:: - - Country > Country pop > Urban Cowboy - -.. _tree_info: - -``tree_info`` -------------- - -**Optional Parameter:** ``"ancestors"`` - -Given a list of categories, it iterates over the list, generating a tuple of the current category and a dict containing information about the tree structure around it, with the following keys: - -``'new_level'`` - ``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 category's level is the same as or greater than the level of the current item. - -Provide the optional argument, ``"ancestors"``, to add a list of unicode representations of the ancestors of the current category, in descending order (root node first, immediate parent last), under the key 'ancestors'. - -For example: given the sample tree below, the contents of the list which would be available under the 'ancestors' key are given on the right:: - - Country -> [] - Country pop -> [u'Country pop'] - Urban Cowboy -> [u'Country', u'Country pop'] - -Using this filter with unpacking in a {% for %} tag, you should have enough information about the tree structure to create a hierarchical representation of the tree. - -.. code-block:: django - - {% for node,structure in objects|tree_info %} - {% if structure.new_level %}
  • {% else %}
  • {% endif %} - {{ node.name }} - {% for level in structure.closed_levels %}
{% endfor %} - {% endfor %} - -``tree_queryset`` ------------------ - -Convert a regular category :py:class:`QuerySet` into a new, ordered :py:class:`QuerySet` that includes the categories selected and their ancestors. - -This is especially helpful when you have a subset of categories and want to show the hierarchy for all the items. - -For example, if we add it to the example for :ref:`tree_info`: - -.. code-block:: django - - {% for node,structure in objects|tree_queryset|tree_info %} - {% if structure.new_level %}
  • {% else %}
  • {% endif %} - {{ node.name }} - {% for level in structure.closed_levels %}
{% endfor %} - {% endfor %} - -A list of unrelated categories such as ``[, ]``, the above template example will output the two categories and their ancestors: - -.. code-block:: html - -
  • - Country -
    • - Country pop -
      • - Urban cowboy -
-
  • - Rhythm and blues -
    • - Urban contemporary -
- -.. note:: - Categories that have similar ancestors are grouped accordingly. There is no duplication of the ancestor tree. - - -Inclusion tags -============== - -``display_path_as_ul`` ----------------------- - -**Template Rendered:** ``categories/ul_tree.html`` - -**Syntax 1:** ``{% display_path_as_ul %}`` - -**Syntax 2:** ``{% display_path_as_ul [ using="app.Model"] %}`` - -Render the category with ancestors, but no children. - -Pass either an object that subclasses :py:class:`CategoryBase` or a path string for the category. Add ``using="app.Model"`` to specify which model when using a path string. The default model used is :py:class:`Category`. - -**Example, using Category model:** - -.. code-block:: django - - {% display_path_as_ul "/Grandparent/Parent" %} - -**Example, using custom model:** - -.. code-block:: django - - {% display_path_as_ul "/Grandparent/Parent" using="coolapp.MusicGenre" %} - -**Example, using an object:** - -.. code-block:: django - - {% display_path_as_ul category_obj %} - -Returns: - -.. code-block:: html - - - - -``display_drilldown_as_ul`` ---------------------------- - -**Template rendered:** ``categories/ul_tree.html`` - -**Syntax 1:** ``{% display_drilldown_as_ul category_obj %}`` - -**Syntax 2:** ``{% display_drilldown_as_ul "/Grandparent/Parent" [using="app.Model"] %}`` - -Render the category with ancestors and children. - -**Example, using Category model:** - -.. code-block:: django - - {% display_drilldown_as_ul "/Grandparent/Parent" %} - -**Example, using custom model:** - -.. code-block:: django - - {% display_drilldown_as_ul "/Grandparent/Parent" using="coolapp.MusicGenre" %} - -**Example, using an object:** - -.. code-block:: django - - {% display_drilldown_as_ul category_obj %} - -Returns: - -.. code-block:: html - - - - -``breadcrumbs tag`` -------------------- - -**Template rendered:** ``categories/breadcrumbs.html`` - -**Syntax 1:** ``{% breadcrumbs category_obj [separator=" :: "] %}`` - -**Syntax 2:** ``{% breadcrumbs "/Grandparent/Parent" [separator=" :: "] [using="app.Model"] %}`` - -Render breadcrumbs for the given path using ``::`` or the given separator. - -**Example using Category model:** - -.. code-block:: django - - {% breadcrumbs "/Grandparent/Parent" %} - -**Example using a custom model:** - -.. code-block:: django - - {% breadcrumbs "/Grandparent/Parent" using="coolapp.MusicGenre" %} - -**Example using an object:** - -.. code-block:: django - - {% breadcrumbs category_obj %} - -Returns: - -.. code-block:: html - - Grandparent / Parent - -You can alter the separator used in the template by adding a separator argument: - -.. code-block:: django - - {% breadcrumbs category_obj separator=" > " %} - -Returns: - -.. code-block:: html - - Grandparent > Parent - - -Template Tags -============= - -``get_top_level_categories`` ----------------------------- - -Retrieves an alphabetical list of all the categories that have no parents. - -Syntax: - -.. code-block:: django - - {% get_top_level_categories [using "app.Model"] as categories %} - -Returns an list of categories ``[, , [using "app.Model"] as %}`` - -**Syntax 2:** ``{% get_category_drilldown as %}`` - -Retrieves the specified category, its ancestors and its immediate children as an iterable. Syntax 1 allows for the retrieval of the category object via a slash-delimited path. The optional ``using "app.Model"`` allows you to specify from which model to retrieve the object. - -Example: - -.. code-block:: django - - {% get_category_drilldown "/Grandparent/Parent" using "family.Member" as family %} - -The second syntax uses an instance of any object that subclasses :py:class:`CategoryBase` - -.. code-block:: django - - {% get_category_drilldown category_obj as family %} - -Both examples sets ``family`` to:: - - [Grandparent, Parent, Child 1, Child 2, Child n] - -``recursetree`` ---------------- - -This tag renders a section of your template recursively for each node in your -tree. - -For example: - -.. code-block:: django - -
    - {% recursetree nodes %} -
  • - {{ node.name }} - {% if not node.is_leaf_node %} -
      - {{ children }} -
    - {% endif %} -
  • - {% endrecursetree %} -
- -Note the special variables ``node`` and ``children``. -These are magically inserted into your context while you're inside the -``recursetree`` tag. - - ``node`` is an instance of your MPTT model. - - ``children`` : This variable holds the rendered HTML for the children of - ``node``. - -.. note:: - If you already have variables called ``node`` or ``children`` in your - template, and you need to access them inside the ``recursetree`` block, - you'll need to alias them to some other name first: - - .. code-block:: django - - {% with node as friendly_node %} - {% recursetree nodes %} - {{ node.name }} is friends with {{ friendly_node.name }} - {{ children }} - {% endrecursetree %} - {% endwith %} diff --git a/docs/_sources/registering_models.txt b/docs/_sources/registering_models.txt deleted file mode 100644 index e44f652..0000000 --- a/docs/_sources/registering_models.txt +++ /dev/null @@ -1,139 +0,0 @@ -.. _registering_models: - -================== -Registering Models -================== - - -Registering models in settings.py -================================= - -It is nice to not have to modify the code of applications to add a relation to categories. You can therefore do all the registering in ``settings.py``\ . For example: - -.. code-block:: python - - CATEGORIES_SETTINGS = { - 'FK_REGISTRY': { - 'app.AModel': 'category', - 'app.MyModel': ( - 'primary_category', - {'name': 'secondary_category', 'related_name': 'mymodel_sec_cat'}, ) - }, - 'M2M_REGISTRY': { - 'app.BModel': 'categories', - 'app.MyModel': ('other_categories', 'more_categories', ), - } - } - -The ``FK_REGISTRY`` is a dictionary whose keys are the model to which to add the new field(s). The value is a string or tuple of strings or dictionaries specifying the necessary information for each field. - -The ``M2M_REGISTRY`` is a dictionary whose keys are the model to which to add the new field(s). The value is a string or tuple of strings specifying the necessary information for each field. - - -Registering one Category field to model -*************************************** - -The simplest way is to specify the name of the field, such as: - -.. code-block:: python - - CATEGORIES_SETTINGS = { - 'FK_REGISTRY': { - 'app.AModel': 'category' - } - } - -This is equivalent to adding the following the ``AModel`` of ``app``\ : - -.. code-block:: python - - category = models.ForeignKey(Category) - - -If you want more control over the new field, you can use a dictionary and pass other ``ForeignKey`` options. The ``name`` key is required: - -.. code-block:: python - - CATEGORIES_SETTINGS = { - 'FK_REGISTRY': { - 'app.AModel': {'name': 'category', 'related_name': 'amodel_cats'} - } - } - -This is equivalent to adding the following the ``AModel`` of ``app``\ : - -.. code-block:: python - - category = models.ForeignKey(Category, related_name='amodel_cats') - -Registering two or more Category fields to a Model -************************************************** - -When you want more than one relation to ``Category``\ , all but one of the fields must specify a ``related_name`` to avoid conflicts, like so: - -.. code-block:: python - - CATEGORIES_SETTINGS = { - 'FK_REGISTRY': { - 'app.MyModel': ( - 'primary_category', - {'name': 'secondary_category', 'related_name': 'mymodel_sec_cat'}, ) - }, - -Registering one or more Many-to-Many Category fields to a Model -*************************************************************** - -.. code-block:: python - - CATEGORIES_SETTINGS = { - 'M2M_REGISTRY': { - 'app.AModel': 'categories', - 'app.MyModel': ( - {'name': 'other_categories', 'related_name': 'other_cats'}, - {'name': 'more_categories', 'related_name': 'more_cats'}, - ), - } - } - -.. _registering_a_m2one_relationship: - -Registering a many-to-one relationship -====================================== - -To create a many-to-one relationship (foreign key) between a model and Django Categories, you register your model with the ``register_fk`` function. - -.. py:function:: register_fk(model, field_name='category', extra_params={}]) - - :param model: The Django Model to link to Django Categories - :param field_name: Optional name for the field **default:** category - :param extra_params: Optional dictionary of extra parameters passed to the ``ForeignKey`` class. - -Example, in your ``models.py``:: - - import categories - categories.register_fk(MyModel) - -If you want more than one field on a model you have to have some extra arguments:: - - import categories - categories.register_fk(MyModel, 'primary_category') - categories.register_fk(MyModel, 'secondary_category', {'related_name':'mymodel_sec_cat'}) - -The ``extra_args`` allows you to specify the related_name of one of the fields so it doesn't clash. - - -Registering a many-to-many relationship -======================================= - -To create a many-to-many relationship between a model and Django Categories, you register your model with the ``register_m2m`` function. - -.. py:function:: register_m2m(model, field_name='categories', extra_params={}]) - - :param model: The Django Model to link to Django Categories - :param field_name: Optional name for the field **default:** categories - :param extra_params: Optional dictionary of extra parameters passed to the ``ManyToManyField`` class. - -Example, in your ``models.py``:: - - import categories - categories.register_m2m(MyModel) diff --git a/docs/_sources/templatetags.txt b/docs/_sources/templatetags.txt deleted file mode 100644 index b5463f4..0000000 --- a/docs/_sources/templatetags.txt +++ /dev/null @@ -1,146 +0,0 @@ -============= -Template Tags -============= - -get_top_level_categories -======================== - -Retrieves an alphabetical list of all the categories that have no parents. - -Syntax: - -.. code-block:: django - - {% get_top_level_categories as categories %} - -Returns an list of categories ``[, , -
  • Top - -
  • - - - -get_category_drilldown -====================== - -Retrieves the specified category, its ancestors and its immediate children -as an iterable. - -Example: - -.. code-block:: django - - {% get_category_drilldown "/Grandparent/Parent" as family %} - -or - -.. code-block:: django - - {% get_category_drilldown category_obj as family %} - -Sets ``family`` to:: - - [Grandparent, Parent, Child 1, Child 2, Child n] - - -display_drilldown_as_ul -======================= - -Render the category with ancestors and children using the -``categories/ul_tree.html`` template. - -Example: - -.. code-block:: django - - {% display_drilldown_as_ul "/Grandparent/Parent" %} - -or: - -.. code-block:: django - - {% display_drilldown_as_ul category_obj %} - -Returns: - -.. code-block:: html - - - - -breadcrumbs tag -=============== - -Render breadcrumbs, using the ``categories/breadcrumbs.html`` template, using the optional ``separator`` argument. - -Example: - -.. code-block:: django - - {% breadcrumbs "/Grandparent/Parent" %} - -or: - -.. code-block:: django - - {% breadcrumbs category_obj %} - -Returns: - -.. code-block:: html - - Grandparent / Parent - -You can alter the separator used in the template by adding a string argument to be the separator: - -.. code-block:: django - - {% breadcrumbs category_obj "::" %} - -Returns: - -.. code-block:: html - - Grandparent :: Parent diff --git a/docs/_sources/usage.txt b/docs/_sources/usage.txt deleted file mode 100644 index c54c3b2..0000000 --- a/docs/_sources/usage.txt +++ /dev/null @@ -1,62 +0,0 @@ -============================= -Using categories in templates -============================= - - -Getting all items within a category -=================================== - -The :py:class:`Category` model automatically gets `reverse relationships `_ with all other models related to it. - -This allows you access to the related objects from the template without altering any views. For example, if you only had ``Entry`` models related to :py:class:`Category`, your ``categories/category_detail.html`` template could look like - -.. literalinclude:: usage_example_template.html - :language: django - :linenos: - - -If you have ``related_name`` parameters to the configuration (see :ref:`registering_models`), then you would use ``category.related_name.all`` instead of ``category.relatedmodel_set.all``\ . - - -Template Tags -============= - -To use the template tags:: - - {% import category_tags %} - - -``tree_info`` -------------- - -Given a list of categories, iterates over the list, generating -two-tuples of the current tree item and a ``dict`` containing -information about the tree structure around the item, with the following -keys: - - ``'new_level'`` - ``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 - parent last), under the key ``'ancestors'``. - - For example: given the sample tree below, the contents of the list - which would be available under the ``'ancestors'`` key are given - on the right:: - - Books -> [] - Sci-fi -> [u'Books'] - Dystopian Futures -> [u'Books', u'Sci-fi'] - diff --git a/docs/_static/ajax-loader.gif b/docs/_static/ajax-loader.gif deleted file mode 100644 index 61faf8c..0000000 Binary files a/docs/_static/ajax-loader.gif and /dev/null differ diff --git a/docs/_static/basic.css b/docs/_static/basic.css deleted file mode 100644 index 32630d5..0000000 --- a/docs/_static/basic.css +++ /dev/null @@ -1,528 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -img { - border: 0; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - clear: both; - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.refcount { - color: #060; -} - -.optional { - font-size: 1.3em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -tt.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -tt.descclassname { - background-color: transparent; -} - -tt.xref, a tt { - background-color: transparent; - font-weight: bold; -} - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} diff --git a/docs/_static/breadcrumb_background.png b/docs/_static/breadcrumb_background.png deleted file mode 100644 index 9b45910..0000000 Binary files a/docs/_static/breadcrumb_background.png and /dev/null differ diff --git a/docs/_static/comment-bright.png b/docs/_static/comment-bright.png deleted file mode 100644 index 551517b..0000000 Binary files a/docs/_static/comment-bright.png and /dev/null differ diff --git a/docs/_static/comment-close.png b/docs/_static/comment-close.png deleted file mode 100644 index 09b54be..0000000 Binary files a/docs/_static/comment-close.png and /dev/null differ diff --git a/docs/_static/comment.png b/docs/_static/comment.png deleted file mode 100644 index 92feb52..0000000 Binary files a/docs/_static/comment.png and /dev/null differ diff --git a/docs/_static/default.css b/docs/_static/default.css deleted file mode 100644 index c719235..0000000 --- a/docs/_static/default.css +++ /dev/null @@ -1,773 +0,0 @@ -/** - * Sphinx stylesheet -- basic theme - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - h3 { - color:#000000; - font-size: 17px; - margin-bottom:0.5em; - margin-top:2em; - } -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- header ---------------------------------------------------------------- */ - -#header #title { - background:#29334F url(title_background.png) repeat-x scroll 0 0; - border-bottom:1px solid #B6B6B6; - height:25px; - overflow:hidden; -} -#headerButtons { - position: absolute; - list-style: none outside; - top: 26px; - left: 0px; - right: 0px; - margin: 0px; - padding: 0px; - border-top: 1px solid #2B334F; - border-bottom: 1px solid #EDEDED; - height: 20px; - font-size: 8pt; - overflow: hidden; - background-color: #D8D8D8; -} - -#headerButtons li { - background-repeat:no-repeat; - display:inline; - margin-top:0; - padding:0; -} - -.headerButton { - display: inline; - height:20px; -} - -.headerButton a { - text-decoration: none; - float: right; - height: 20px; - padding: 4px 15px; - border-left: 1px solid #ACACAC; - font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; - color: black; -} -.headerButton a:hover { - color: white; - background-color: #787878; - -} - -li#toc_button { - text-align:left; -} - -li#toc_button .headerButton a { - width:198px; - padding-top: 4px; - font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; - color: black; - float: left; - padding-left:15px; - border-right:1px solid #ACACAC; - background:transparent url(triangle_open.png) no-repeat scroll 4px 6px; -} - -li#toc_button .headerButton a:hover { - background-color: #787878; - color: white; -} - -li#page_buttons { -position:absolute; -right:0; -} - -#breadcrumbs { - color: black; - background-image:url(breadcrumb_background.png); - border-top:1px solid #2B334F; - bottom:0; - font-size:10px; - height:15px; - left:0; - overflow:hidden; - padding:3px 10px 0; - position:absolute; - right:0; - white-space:nowrap; - z-index:901; -} -#breadcrumbs a { - color: black; - text-decoration: none; -} -#breadcrumbs a:hover { - text-decoration: underline; -} -#breadcrumbs img { - padding-left: 3px; -} -/* -- sidebar --------------------------------------------------------------- */ -#sphinxsidebar { - position: absolute; - top: 84px; - bottom: 19px; - left: 0px; - width: 229px; - background-color: #E4EBF7; - border-right: 1px solid #ACACAC; - border-top: 1px solid #2B334F; - overflow-x: hidden; - overflow-y: auto; - padding: 0px 0px 0px 0px; - font-size:11px; -} - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -#sphinxsidebar li { - margin: 0px; - padding: 0px; - font-weight: normal; - margin: 0px 0px 7px 0px; - overflow: hidden; - text-overflow: ellipsis; - font-size: 11px; -} - -#sphinxsidebar ul { - list-style: none; - margin: 0px 0px 0px 0px; - padding: 0px 5px 0px 5px; -} - -#sphinxsidebar ul ul, -#sphinxsidebar ul.want-points { - list-style: square; -} - -#sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -#sphinxsidebar form { - margin-top: 10px; -} - -#sphinxsidebar input { - border: 1px solid #787878; - font-family: sans-serif; - font-size: 1em; -} - -img { - border: 0; -} - -#sphinxsidebar li.toctree-l1 a { - font-weight: bold; - color: #000; - text-decoration: none; -} - -#sphinxsidebar li.toctree-l2 a { - font-weight: bold; - color: #4f4f4f; - text-decoration: none; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} -#sphinxsidebar input.prettysearch {border:none;} -input.searchbutton { - float: right; -} -.search-wrapper {width: 100%; height: 25px;} -.search-wrapper input.prettysearch { border: none; width:200px; height: 16px; background: url(searchfield_repeat.png) center top repeat-x; border: 0px; margin: 0; padding: 3px 0 0 0; font: 11px "Lucida Grande", "Lucida Sans Unicode", Arial, sans-serif; } -.search-wrapper input.prettysearch { width: 184px; margin-left: 20px; *margin-top:-1px; *margin-right:-2px; *margin-left:10px; } -.search-wrapper .search-left { display: block; position: absolute; width: 20px; height: 19px; background: url(searchfield_leftcap.png) left top no-repeat; } -.search-wrapper .search-right { display: block; position: relative; left: 204px; top: -19px; width: 10px; height: 19px; background: url(searchfield_rightcap.png) right top no-repeat; } - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -/* -- general body styles --------------------------------------------------- */ -.document { - border-top:1px solid #2B334F; - overflow:auto; - padding-left:2em; - padding-right:2em; - position:absolute; - z-index:1; - top:84px; - bottom:19px; - right:0; - left:230px; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -/* -- sidebars -------------------------------------------------------------- */ - -/*div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} -*/ -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ -.admonition { - border: 1px solid #a1a5a9; - background-color: #f7f7f7; - margin: 20px; - padding: 0px 8px 7px 9px; - text-align: left; -} -.warning { - background-color:#E8E8E8; - border:1px solid #111111; - margin:30px; -} -.admonition p { - font: 12px 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; - margin-top: 7px; - margin-bottom: 0px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; - padding-top: 3px; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border-collapse: collapse; - border-top: 1px solid #919699; - border-left: 1px solid #919699; - border-right: 1px solid #919699; - font-size:12px; - padding:8px; - text-align:left; - vertical-align:top; -} - -table.docutils td, table.docutils th { - padding: 8px; - font-size: 12px; - text-align: left; - vertical-align: top; - border-bottom: 1px solid #919699; -} - -table.docutils th { - font-weight: bold; -} -/* This alternates colors in up to six table rows (light blue for odd, white for even)*/ -.docutils tr { - background: #F0F5F9; -} - -.docutils tr + tr { - background: #FFFFFF; -} - -.docutils tr + tr + tr { - background: #F0F5F9; -} - -.docutils tr + tr + tr + tr { - background: #FFFFFF; -} - -.docutils tr + tr + tr +tr + tr { - background: #F0F5F9; -} - -.docutils tr + tr + tr + tr + tr + tr { - background: #FFFFFF; -} - -.docutils tr + tr + tr + tr + tr + tr + tr { - background: #F0F5F9; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -/* -- other body styles ----------------------------------------------------- */ - -dl { - margin-bottom: 15px; - font-size: 12px; -} - -dd p { - margin-top: 0px; - font-size: 12px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; - font-size: 12px; -} - -dt:target, .highlight { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 0.8em; -} - -dl.glossary dd { - font-size:12px; -} -.field-list ul { - vertical-align: top; - margin: 0; - padding-bottom: 0; - list-style: none inside; -} - -.field-list ul li { - margin-top: 0; -} - -.field-list p { - margin: 0; -} - -.refcount { - color: #060; -} - -.optional { - font-size: 1.3em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - background-color:#F1F5F9; - border:1px solid #C9D1D7; - border-spacing:0; - font-family:"Bitstream Vera Sans Mono",Monaco,"Lucida Console",Courier,Consolas,monospace; - font-size:11px; - padding: 10px; -} - -td.linenos { - width: 2em; -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -td.code { - -} - -table.highlighttable { - margin-left: 0.5em; - width: 100%; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} -table.highlighttable td.linenos { - text-align: right; - width: 1.5em; - padding-right: 0; -} -tt { - font-family:"Bitstream Vera Sans Mono",Monaco,"Lucida Console",Courier,Consolas,monospace; -} - -tt.descname { - background-color: transparent; - font-weight: bold; - font-size: 1em; -} - -tt.descclassname { - background-color: transparent; -} - -tt.xref, a tt { - background-color: transparent; - font-weight: bold; -} - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - background-color: transparent; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} - -body { - font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; -} - -dl.class dt { - padding: 3px; -/* border-top: 2px solid #999;*/ -} - -em.property { - font-style: normal; -} - -dl.class dd p { - margin-top: 6px; -} - -dl.class dd dl.exception dt { - padding: 3px; - background-color: #FFD6D6; - border-top: none; -} - -dl.class dd dl.method dt { - padding: 3px; - background-color: #e9e9e9; - border-top: none; - -} - -dl.function dt { - padding: 3px; - border-top: 2px solid #999; -} - -ul { -list-style-image:none; -list-style-position:outside; -list-style-type:square; -margin:0 0 0 30px; -padding:0 0 12px 6px; -} -#docstitle { - height: 36px; - background-image: url(header_sm_mid.png); - left: 0; - top: 0; - position: absolute; - width: 100%; -} -#docstitle p { - padding:7px 0 0 45px; - margin: 0; - color: white; - text-shadow:0 1px 0 #787878; - background: transparent url(documentation.png) no-repeat scroll 10px 3px; - height: 36px; - font-size: 15px; -} -#header { -height:45px; -left:0; -position:absolute; -right:0; -top:36px; -z-index:900; -} - -#header h1 { -font-size:10pt; -margin:0; -padding:5px 0 0 10px; -text-shadow:0 1px 0 #D5D5D5; -white-space:nowrap; -} - -h1 { --x-system-font:none; -color:#000000; -font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; -font-size:30px; -font-size-adjust:none; -font-stretch:normal; -font-style:normal; -font-variant:normal; -font-weight:bold; -line-height:normal; -margin-bottom:25px; -margin-top:1em; -} - -.footer { -border-top:1px solid #DDDDDD; -clear:both; -padding-top:9px; -width:100%; -font-size:10px; -} - -p { --x-system-font:none; -font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; -font-size:12px; -font-size-adjust:none; -font-stretch:normal; -font-style:normal; -font-variant:normal; -font-weight:normal; -line-height:normal; -margin-bottom:10px; -margin-top:0; -} - -h2 { -border-bottom:1px solid #919699; -color:#000000; -font-size:24px; -margin-top:2.5em; -padding-bottom:2px; -} - -a:link:hover { -color:#093D92; -text-decoration:underline; -} - -a:link { -color:#093D92; -text-decoration:none; -} - - -ol { -list-style-position:outside; -list-style-type:decimal; -margin:0 0 0 30px; -padding:0 0 12px 6px; -} -li { -margin-top:7px; -font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; -font-size:12px; -font-size-adjust:none; -font-stretch:normal; -font-style:normal; -font-variant:normal; -font-weight:normal; -line-height:normal; -} -li > p { -display:inline; -} -li p { -margin-top:8px; -} \ No newline at end of file diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js deleted file mode 100644 index 8b9bd2c..0000000 --- a/docs/_static/doctools.js +++ /dev/null @@ -1,247 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilties for all documentation. - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -} - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * small function to check if an array contains - * a given item. - */ -jQuery.contains = function(arr, item) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == item) - return true; - } - return false; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash && $.browser.mozilla) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('.sidebar .this-page-menu')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); diff --git a/docs/_static/documentation.png b/docs/_static/documentation.png deleted file mode 100644 index f0d334b..0000000 Binary files a/docs/_static/documentation.png and /dev/null differ diff --git a/docs/_static/down-pressed.png b/docs/_static/down-pressed.png deleted file mode 100644 index 6f7ad78..0000000 Binary files a/docs/_static/down-pressed.png and /dev/null differ diff --git a/docs/_static/down.png b/docs/_static/down.png deleted file mode 100644 index 3003a88..0000000 Binary files a/docs/_static/down.png and /dev/null differ diff --git a/docs/_static/file.png b/docs/_static/file.png deleted file mode 100644 index d18082e..0000000 Binary files a/docs/_static/file.png and /dev/null differ diff --git a/docs/_static/header_sm_mid.png b/docs/_static/header_sm_mid.png deleted file mode 100644 index dce5a40..0000000 Binary files a/docs/_static/header_sm_mid.png and /dev/null differ diff --git a/docs/_static/jquery.js b/docs/_static/jquery.js deleted file mode 100644 index 7c24308..0000000 --- a/docs/_static/jquery.js +++ /dev/null @@ -1,154 +0,0 @@ -/*! - * jQuery JavaScript Library v1.4.2 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Sat Feb 13 22:33:48 2010 -0500 - */ -(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, -Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& -(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, -a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== -"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, -function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
    a"; -var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, -parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= -false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= -s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, -applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; -else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, -a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== -w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, -cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= -c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); -a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, -function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); -k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), -C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= -e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& -f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; -if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", -e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, -"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, -d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, -e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); -t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| -g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, -CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, -g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, -text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, -setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= -h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== -"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, -h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& -q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; -if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

    ";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); -(function(){var g=s.createElement("div");g.innerHTML="
    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: -function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= -{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== -"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", -d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? -a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== -1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
    ","
    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, -""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); -return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", -""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= -c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? -c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= -function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= -Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, -"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= -a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= -a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== -"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
    ").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, -serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), -function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, -global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& -e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? -"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== -false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= -false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", -c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| -d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); -g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== -1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== -"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; -if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== -"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| -c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; -this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= -this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, -e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
    "; -a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); -c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, -d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- -f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": -"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in -e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); diff --git a/docs/_static/minus.png b/docs/_static/minus.png deleted file mode 100644 index da1c562..0000000 Binary files a/docs/_static/minus.png and /dev/null differ diff --git a/docs/_static/plus.png b/docs/_static/plus.png deleted file mode 100644 index b3cb374..0000000 Binary files a/docs/_static/plus.png and /dev/null differ diff --git a/docs/_static/pygments.css b/docs/_static/pygments.css deleted file mode 100644 index 1a14f2a..0000000 --- a/docs/_static/pygments.css +++ /dev/null @@ -1,62 +0,0 @@ -.highlight .hll { background-color: #ffffcc } -.highlight { background: #eeffcc; } -.highlight .c { color: #408090; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ -.highlight .k { color: #007020; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ -.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #007020 } /* Comment.Preproc */ -.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ -.highlight .gd { color: #A00000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #303030 } /* Generic.Output */ -.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0040D0 } /* Generic.Traceback */ -.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ -.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ -.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ -.highlight .kp { color: #007020 } /* Keyword.Pseudo */ -.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ -.highlight .kt { color: #902000 } /* Keyword.Type */ -.highlight .m { color: #208050 } /* Literal.Number */ -.highlight .s { color: #4070a0 } /* Literal.String */ -.highlight .na { color: #4070a0 } /* Name.Attribute */ -.highlight .nb { color: #007020 } /* Name.Builtin */ -.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ -.highlight .no { color: #60add5 } /* Name.Constant */ -.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ -.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ -.highlight .ne { color: #007020 } /* Name.Exception */ -.highlight .nf { color: #06287e } /* Name.Function */ -.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ -.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ -.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #bb60d5 } /* Name.Variable */ -.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #208050 } /* Literal.Number.Float */ -.highlight .mh { color: #208050 } /* Literal.Number.Hex */ -.highlight .mi { color: #208050 } /* Literal.Number.Integer */ -.highlight .mo { color: #208050 } /* Literal.Number.Oct */ -.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ -.highlight .sc { color: #4070a0 } /* Literal.String.Char */ -.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ -.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ -.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ -.highlight .sx { color: #c65d09 } /* Literal.String.Other */ -.highlight .sr { color: #235388 } /* Literal.String.Regex */ -.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ -.highlight .ss { color: #517918 } /* Literal.String.Symbol */ -.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ -.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ -.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ -.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/_static/scrn1.png b/docs/_static/scrn1.png deleted file mode 100644 index 6499b3c..0000000 Binary files a/docs/_static/scrn1.png and /dev/null differ diff --git a/docs/_static/scrn2.png b/docs/_static/scrn2.png deleted file mode 100644 index 2a60215..0000000 Binary files a/docs/_static/scrn2.png and /dev/null differ diff --git a/docs/_static/searchfield_leftcap.png b/docs/_static/searchfield_leftcap.png deleted file mode 100644 index cc00c22..0000000 Binary files a/docs/_static/searchfield_leftcap.png and /dev/null differ diff --git a/docs/_static/searchfield_repeat.png b/docs/_static/searchfield_repeat.png deleted file mode 100644 index b429a16..0000000 Binary files a/docs/_static/searchfield_repeat.png and /dev/null differ diff --git a/docs/_static/searchfield_rightcap.png b/docs/_static/searchfield_rightcap.png deleted file mode 100644 index 8e13620..0000000 Binary files a/docs/_static/searchfield_rightcap.png and /dev/null differ diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js deleted file mode 100644 index dae92b5..0000000 --- a/docs/_static/searchtools.js +++ /dev/null @@ -1,518 +0,0 @@ -/* - * searchtools.js - * ~~~~~~~~~~~~~~ - * - * Sphinx JavaScript utilties for the full-text search. - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * helper function to return a node containing the - * search summary for a given text. keywords is a list - * of stemmed words, hlwords is the list of normal, unstemmed - * words. the first one is used to find the occurance, the - * latter for highlighting it. - */ - -jQuery.makeSearchSummary = function(text, keywords, hlwords) { - var textLower = text.toLowerCase(); - var start = 0; - $.each(keywords, function() { - var i = textLower.indexOf(this.toLowerCase()); - if (i > -1) - start = i; - }); - start = Math.max(start - 120, 0); - var excerpt = ((start > 0) ? '...' : '') + - $.trim(text.substr(start, 240)) + - ((start + 240 - text.length) ? '...' : ''); - var rv = $('
    ').text(excerpt); - $.each(hlwords, function() { - rv = rv.highlightText(this, 'highlighted'); - }); - return rv; -} - -/** - * Porter Stemmer - */ -var PorterStemmer = function() { - - var step2list = { - ational: 'ate', - tional: 'tion', - enci: 'ence', - anci: 'ance', - izer: 'ize', - bli: 'ble', - alli: 'al', - entli: 'ent', - eli: 'e', - ousli: 'ous', - ization: 'ize', - ation: 'ate', - ator: 'ate', - alism: 'al', - iveness: 'ive', - fulness: 'ful', - ousness: 'ous', - aliti: 'al', - iviti: 'ive', - biliti: 'ble', - logi: 'log' - }; - - var step3list = { - icate: 'ic', - ative: '', - alize: 'al', - iciti: 'ic', - ical: 'ic', - ful: '', - ness: '' - }; - - var c = "[^aeiou]"; // consonant - var v = "[aeiouy]"; // vowel - var C = c + "[^aeiouy]*"; // consonant sequence - var V = v + "[aeiou]*"; // vowel sequence - - var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 - var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 - var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 - var s_v = "^(" + C + ")?" + v; // vowel in stem - - this.stemWord = function (w) { - var stem; - var suffix; - var firstch; - var origword = w; - - if (w.length < 3) - return w; - - var re; - var re2; - var re3; - var re4; - - firstch = w.substr(0,1); - if (firstch == "y") - w = firstch.toUpperCase() + w.substr(1); - - // Step 1a - re = /^(.+?)(ss|i)es$/; - re2 = /^(.+?)([^s])s$/; - - if (re.test(w)) - w = w.replace(re,"$1$2"); - else if (re2.test(w)) - w = w.replace(re2,"$1$2"); - - // Step 1b - re = /^(.+?)eed$/; - re2 = /^(.+?)(ed|ing)$/; - if (re.test(w)) { - var fp = re.exec(w); - re = new RegExp(mgr0); - if (re.test(fp[1])) { - re = /.$/; - w = w.replace(re,""); - } - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1]; - re2 = new RegExp(s_v); - if (re2.test(stem)) { - w = stem; - re2 = /(at|bl|iz)$/; - re3 = new RegExp("([^aeiouylsz])\\1$"); - re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re2.test(w)) - w = w + "e"; - else if (re3.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - else if (re4.test(w)) - w = w + "e"; - } - } - - // Step 1c - re = /^(.+?)y$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(s_v); - if (re.test(stem)) - w = stem + "i"; - } - - // Step 2 - re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step2list[suffix]; - } - - // Step 3 - re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - suffix = fp[2]; - re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step3list[suffix]; - } - - // Step 4 - re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; - re2 = /^(.+?)(s|t)(ion)$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - if (re.test(stem)) - w = stem; - } - else if (re2.test(w)) { - var fp = re2.exec(w); - stem = fp[1] + fp[2]; - re2 = new RegExp(mgr1); - if (re2.test(stem)) - w = stem; - } - - // Step 5 - re = /^(.+?)e$/; - if (re.test(w)) { - var fp = re.exec(w); - stem = fp[1]; - re = new RegExp(mgr1); - re2 = new RegExp(meq1); - re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) - w = stem; - } - re = /ll$/; - re2 = new RegExp(mgr1); - if (re.test(w) && re2.test(w)) { - re = /.$/; - w = w.replace(re,""); - } - - // and turn initial Y back to y - if (firstch == "y") - w = firstch.toLowerCase() + w.substr(1); - return w; - } -} - - -/** - * Search Module - */ -var Search = { - - _index : null, - _queued_query : null, - _pulse_status : -1, - - init : function() { - var params = $.getQueryParameters(); - if (params.q) { - var query = params.q[0]; - $('input[name="q"]')[0].value = query; - this.performSearch(query); - } - }, - - loadIndex : function(url) { - $.ajax({type: "GET", url: url, data: null, success: null, - dataType: "script", cache: true}); - }, - - setIndex : function(index) { - var q; - this._index = index; - if ((q = this._queued_query) !== null) { - this._queued_query = null; - Search.query(q); - } - }, - - hasIndex : function() { - return this._index !== null; - }, - - deferQuery : function(query) { - this._queued_query = query; - }, - - stopPulse : function() { - this._pulse_status = 0; - }, - - startPulse : function() { - if (this._pulse_status >= 0) - return; - function pulse() { - Search._pulse_status = (Search._pulse_status + 1) % 4; - var dotString = ''; - for (var i = 0; i < Search._pulse_status; i++) - dotString += '.'; - Search.dots.text(dotString); - if (Search._pulse_status > -1) - window.setTimeout(pulse, 500); - }; - pulse(); - }, - - /** - * perform a search for something - */ - performSearch : function(query) { - // create the required interface elements - this.out = $('#search-results'); - this.title = $('

    ' + _('Searching') + '

    ').appendTo(this.out); - this.dots = $('').appendTo(this.title); - this.status = $('

    ').appendTo(this.out); - this.output = $(' - - - - \ No newline at end of file diff --git a/docs/custom_categories.html b/docs/custom_categories.html deleted file mode 100644 index 34726a3..0000000 --- a/docs/custom_categories.html +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - Creating Custom Categories — Django Categories v1.1 documentation - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Creating Custom Categories

    -

    Django Categories isn’t just for using a single category model. It allows you to create your own custom category-like models with as little or much customization as you need.

    -
    -

    Name only

    -

    For many cases, you want a simple user-managed lookup table. You can do this with just a little bit of code. The resulting model will include name, slug and active fields and a hierarchical admin.

    -
      -
    1. Create a model that subclasses CategoryBase

      -
      1
      -2
      -3
      -4
      -5
      -6
      -7
      -8
      -9
      from categories.models import CategoryBase
      -
      -class SimpleCategory(CategoryBase):
      -    """
      -    A simple of catgorizing example
      -    """
      -    
      -    class Meta:
      -        verbose_name_plural = 'simple categories'
      -
      -
      -
    2. -
    3. Create a subclass of CategoryBaseAdmin.

      -
       1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
      - 8
      - 9
      -10
      from django.contrib import admin
      -
      -from categories.admin import CategoryBaseAdmin
      -
      -from .models import SimpleCategory
      -
      -class SimpleCategoryAdmin(CategoryBaseAdmin):
      -    pass
      -
      -admin.site.register(SimpleCategory, SimpleCategoryAdmin)
      -
      -
      -
    4. -
    5. Register your model and custom model admin class.

      -
    6. -
    -
    -
    -

    Name and other data

    -

    Sometimes you need more functionality, such as extra metadata and custom functions. The Category model in this package does this.

    -
      -
    1. Create a model that subclasses CategoryBase as above.

      -
    2. -
    3. Add new fields to the model. The Category model adds these extra fields.

      -
       1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
      - 8
      - 9
      -10
      -11
      -12
      -13
      -14
      -15
      -16
      -17
      -18
      -19
      -20
      -21
      -22
      -23
      -24
      -25
      -26
      -27
      -28
      -29
      class Category(CategoryBase):
      -    thumbnail = models.FileField(
      -        upload_to=THUMBNAIL_UPLOAD_PATH, 
      -        null=True, blank=True,
      -        storage=STORAGE(),)
      -    thumbnail_width = models.IntegerField(blank=True, null=True)
      -    thumbnail_height = models.IntegerField(blank=True, null=True)
      -    order = models.IntegerField(default=0)
      -    alternate_title = models.CharField(
      -        blank=True,
      -        default="",
      -        max_length=100,
      -        help_text="An alternative title to use on pages with this category.")
      -    alternate_url = models.CharField(
      -        blank=True, 
      -        max_length=200, 
      -        help_text="An alternative URL to use instead of the one derived from "
      -                  "the category hierarchy.")
      -    description = models.TextField(blank=True, null=True)
      -    meta_keywords = models.CharField(
      -        blank=True,
      -        default="",
      -        max_length=255,
      -        help_text="Comma-separated keywords for search engines.")
      -    meta_extra = models.TextField(
      -        blank=True,
      -        default="",
      -        help_text="(Advanced) Any additional HTML to be placed verbatim "
      -                  "in the &lt;head&gt;")
      -
      -
      -
    4. -
    5. Add new methods to the model. For example, the Category model adds several new methods, including overriding the save() method.

      -
       1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
      - 8
      - 9
      -10
      -11
      -12
      -13
      -14
      -15
      def save(self, *args, **kwargs):
      -    if self.thumbnail:
      -        from django.core.files.images import get_image_dimensions
      -        import django
      -        if django.VERSION[1] < 2:
      -            width, height = get_image_dimensions(self.thumbnail.file)
      -        else:
      -            width, height = get_image_dimensions(self.thumbnail.file, close=True)
      -    else:
      -        width, height = None, None
      -    
      -    self.thumbnail_width = width
      -    self.thumbnail_height = height
      -    
      -    super(Category, self).save(*args, **kwargs)
      -
      -
      -
    6. -
    7. Alter Meta or MPTTMeta class. Either of these inner classes can be overridden, however your Meta class should inherit CategoryBase.Meta. Options for Meta are in the Django-MPTT docs.

      -
      1
      -2
      -3
      -4
      -5
      class Meta(CategoryBase.Meta):
      -    verbose_name_plural = 'categories'
      -
      -class MPTTMeta:
      -    order_insertion_by = ('order', 'name')
      -
      -
      -
    8. -
    9. For the admin, you must create a form that subclasses CategoryBaseAdminForm and at least sets the Meta.model attribute. You can also alter the form fields and cleaning methods, as Category does.

      -
      1
      -2
      -3
      -4
      -5
      -6
      -7
      -8
      -9
      class CategoryAdminForm(CategoryBaseAdminForm):
      -    class Meta:
      -        model = Category
      -    
      -    def clean_alternate_title(self):
      -        if self.instance is None or not self.cleaned_data['alternate_title']:
      -            return self.cleaned_data['name']
      -        else:
      -            return self.cleaned_data['alternate_title']
      -
      -
      -
    10. -
    11. Next you must subclass CategoryBaseAdmin and assign the form attribute the form class created above. You can alter any other attributes as necessary.

      -
       1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
      - 8
      - 9
      -10
      -11
      -12
      -13
      -14
      -15
      -16
      -17
      class CategoryAdmin(CategoryBaseAdmin):
      -    form = CategoryAdminForm
      -    list_display = ('name', 'alternate_title', 'active')
      -    fieldsets = (
      -        (None, {
      -            'fields': ('parent', 'name', 'thumbnail', 'active')
      -        }),
      -        ('Meta Data', {
      -            'fields': ('alternate_title', 'alternate_url', 'description', 
      -                        'meta_keywords', 'meta_extra'),
      -            'classes': ('collapse',),
      -        }),
      -        ('Advanced', {
      -            'fields': ('order', 'slug'),
      -            'classes': ('collapse',),
      -        }),
      -    )
      -
      -
      -
    12. -
    -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/genindex.html b/docs/genindex.html deleted file mode 100644 index a0f5ab9..0000000 --- a/docs/genindex.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - Index — Django Categories v1.1 documentation - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - - - - - - -
    -
    - - - - - - - - \ No newline at end of file diff --git a/docs/getting_started.html b/docs/getting_started.html deleted file mode 100644 index bb2ac50..0000000 --- a/docs/getting_started.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - Getting Started — Django Categories v1.1 documentation - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Getting Started

    -

    You can use Django Categories in two ways:

    -
      -
    1. As storage for one tree of categories, using the Category model:

      -
      Top Category 1
      -  Subcategory 1-1
      -    Subcategory 1-2
      -      subcategory 1-2-1
      -Top Category 2
      -  Subcategory 2-1
      -
      -
    2. -
    3. As the basis for several custom categories (see Creating Custom Categories), e.g. a MusicGenre model

      -
      MusicGenre 1
      -  MusicSubGenre 1-1
      -  MusicSubGenre 1-2
      -    MusicSubGenre 1-2-1
      -MusicGenre 2
      -  MusicSubGenre 2-1
      -
      -

      and a Subject model

      -
      Subject 1
      -  Discipline 1-1
      -  Discipline 1-2
      -    SubDiscipline 1-2-1
      -Subject 2
      -  Discipline 2-1
      -
      -
    4. -
    -
    -

    Connecting your model with Django-Categories

    -

    There are two ways to add Category fields to an application. If you are in control of the code (it’s your application) or you are willing to take control of the code (fork someone else’s app) you can make a Hard Coded Connection.

    -

    For 3rd-party apps or even your own apps that you don’t wish to add Django-Categories as a dependency, you can configure a Lazy Connection.

    -
    -

    Hard Coded Connection

    -

    Hard coded connections are done in the exact same way you handle any other foreign key or many-to-many relations to a model.

    -
    from django.db import models
    -
    -class MyModel(models.Model):
    -    name = models.CharField(max_length=100)
    -    category = models.ForeignKey('categories.Category')
    -
    -
    -

    Don’t forget to add the field or fields to your ModelAdmin class as well.

    -
    -
    -

    Lazy Connection

    -

    Lazy connections are done through configuring Django Categories in the project’s settings.py file. When the project starts up, the configured fields are dynamically added to the configured models and admin.

    -

    If you do this before you have created the database (before you ran manage.py syncdb), the fields will also be in the tables. If you do this after you have already created all the tables, you can run manage.py add_category_fields to create the fields (this requires Django South to be installed).

    -

    You add a many-to-one or many-to-many relationship with Django Categories using the FK_REGISTRY and M2M_REGISTRY settings respectively. For more information see Registering Models.

    -
    -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 092b98f..0000000 --- a/docs/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - Django Categories v 1.1 — Django Categories v1.1 documentation - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Django Categories v 1.1

    -

    Django Categories grew out of our need to provide a basic hierarchical taxonomy management system that multiple applications could use independently or in concert.

    -

    As a news site, our stories, photos, and other content get divided into “sections” and we wanted all the apps to use the same set of sections. As our needs grew, the Django Categories grew in the functionality it gave to category handling within web pages.

    -
    -

    New in 1.1

    -
      -
    • Fixed a cosmetic bug in the Django 1.4 admin. Action checkboxes now only appear once.
    • -
    • Template tags are refactored to allow easy use of any model derived from CategoryBase.
    • -
    • Improved test suite.
    • -
    • Improved some of the documentation.
    • -
    -
    - -
    -

    Indices and tables

    - -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/installation.html b/docs/installation.html deleted file mode 100644 index b97eb78..0000000 --- a/docs/installation.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - Installation — Django Categories v1.1 documentation - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Installation

    -
    -

    To use the Category model

    -
      -
    1. Install django-categories:

      -
      pip install django-categories
      -
      -
    2. -
    3. Add "categories" and "categories.editor" to your INSTALLED_APPS list in your project’s settings.py file.

      -
      INSTALLED_APPS = [
      -    # ...
      -    "categories",
      -    "categories.editor",
      -]
      -
      -
      -
    4. -
    5. Run ./manage.py syncdb (or ./manage.py migrate categories if you are using South)

      -
    6. -
    -
    -
    -

    To only subclass CategoryBase

    -

    If you are going to create your own models using CategoryBase, (see Creating Custom Categories) you’ll need a few different steps.

    -
      -
    1. Install django-categories:

      -
      pip install django-categories
      -
      -
    2. -
    3. Add "categories.editor" to your INSTALLED_APPS list in your project’s settings.py file.

      -
      INSTALLED_APPS = [
      -    # ...
      -    "categories.editor",
      -]
      -
      -
      -
    4. -
    5. Create your own models.

      -
    6. -
    -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/objects.inv b/docs/objects.inv deleted file mode 100644 index faaf6d6..0000000 Binary files a/docs/objects.inv and /dev/null differ diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index 90a267b..0000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - Reference — Django Categories v1.1 documentation - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - - - - - - \ No newline at end of file diff --git a/docs/reference/management_commands.html b/docs/reference/management_commands.html deleted file mode 100644 index be65f11..0000000 --- a/docs/reference/management_commands.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - Management Commands — Django Categories v1.1 documentation - - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Management Commands

    -
    -

    import_categories

    -

    Usage: ./manage.py import_categories /path/to/file.txt [/path/to/file2.txt]

    -

    Imports category tree(s) from a file. Sub categories must be indented by the same multiple of spaces or tabs. The first line in the file cannot start with a space or tab and you can’t mix spaces and tabs.

    -
    -
    -

    add_category_fields

    -

    Usage: ./manage.py add_category_fields [app1 app2 ...]

    -

    Add missing registered category fields to the database table of a specified application or all registered applications.

    -

    Requires Django South.

    -
    -
    -

    drop_category_field

    -

    Usage: ./manage.py drop_category_field app_name model_name field_name

    -

    Drop the field_name field from the app_name_model_name table, if the field is currently registered in CATEGORIES_SETTINGS.

    -

    Requires Django South.

    -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/reference/models.html b/docs/reference/models.html deleted file mode 100644 index 639b4be..0000000 --- a/docs/reference/models.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - Models — Django Categories v1.1 documentation - - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Models

    -
    -

    CategoryBase

    -
    -
    -class CategoryBase
    -
    -
    -parent
    -

    TreeForeignKey (self)

    -

    The category’s parent category. Leave this blank for an root category.

    -
    - -
    -
    -name
    -

    Required CharField(100)

    -

    The name of the category.

    -
    - -
    -
    -slug
    -

    Required SlugField

    -

    URL-friendly title. It is automatically generated from the title.

    -
    - -
    -
    -active
    -

    Required BooleanField default: True

    -

    Is this item active. If it is inactive, all children are set to inactive as well.

    -
    - -
    -
    -objects
    -

    CategoryManager

    -

    An object manager that adds an active method for only selecting items whose active attribute is True.

    -
    - -
    -
    -tree
    -

    TreeManager

    -

    A Django-MPTT TreeManager instance.

    -
    - -
    - -
    -
    -

    Category

    -
    -
    -class Category
    -

    Category is a subclass of CategoryBase and includes all its attributes.

    -
    -
    -thumbnail
    -

    FileField

    -

    An optional thumbnail, that is uploaded to REGISTER_ADMIN via THUMBNAIL_STORAGE.

    -
    -

    Note

    -

    Why isn’t this an ImageField?

    -

    For ImageFields, Django checks the file system for the existance of the files to handle the height and width. In many cases this can lead to problems and impact performance.

    -

    For these reasons, a FileField that manually manages the width and height was chosen.

    -
    -
    - -
    -
    -thumbnail_width
    -

    IntegerField

    -

    The thumbnail width. Automatically set on save if a thumbnail is uploaded.

    -
    - -
    -
    -thumbnail_height
    -

    IntegerField

    -

    The thumbnail height. Automatically set on save if a thumbnail is uploaded.

    -
    - -
    -
    -order
    -

    Required IntegerField default: 0

    -

    A manually-managed order of this category in the listing. Items with the same order are sorted alphabetically.

    -
    - -
    -
    -alternate_title
    -

    CharField(100)

    -

    An alternative title to use on pages with this category.

    -
    - -
    -
    -alternate_url
    -

    CharField(200)

    -

    An alternative URL to use instead of the one derived from the category hierarchy.

    -
    -

    Note

    -

    Why isn’t this a URLField?

    -

    For URLFields, Django checks that the URL includes http:// and the site name. This makes it impossible to use relative URLs in that field.

    -
    -
    - -
    -
    -description
    -

    TextField

    -

    An optional longer description of the category. Very useful on category landing pages.

    -
    - -
    -
    -meta_keywords
    -

    CharField(255)

    -

    Comma-separated keywords for search engines.

    -
    - -
    -
    -meta_extra
    -

    TextField

    -

    (Advanced) Any additional HTML to be placed verbatim in the <head> of the page.

    -
    - -
    - -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/reference/settings.html b/docs/reference/settings.html deleted file mode 100644 index 17693b9..0000000 --- a/docs/reference/settings.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - Settings — Django Categories v1.1 documentation - - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Settings

    -

    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:

    -
    CATEGORIES_SETTINGS = {
    -    'ALLOW_SLUG_CHANGE': False,
    -    'CACHE_VIEW_LENGTH': 0,
    -    'RELATION_MODELS': [],
    -    'M2M_REGISTRY': {},
    -    'FK_REGISTRY': {},
    -    'THUMBNAIL_UPLOAD_PATH': 'uploads/categories/thumbnails',
    -    'THUMBNAIL_STORAGE': settings.DEFAULT_FILE_STORAGE,
    -    'SLUG_TRANSLITERATOR': lambda x: x,
    -}
    -
    -
    -
    -

    ALLOW_SLUG_CHANGE

    -

    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.

    -
    -
    -

    SLUG_TRANSLITERATOR

    -

    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.

    -
    -
    -

    CACHE_VIEW_LENGTH

    -

    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.

    -
    -
    -

    RELATION_MODELS

    -

    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.

    -
    -
    -

    M2M_REGISTRY

    -

    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.

    -
    -
    -

    FK_REGISTRY

    -

    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.

    -
    -
    -

    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

    -

    Default: 'uploads/categories/thumbnails'

    -

    Description: Where thumbnails for the categories will be saved.

    -
    -
    -

    THUMBNAIL_STORAGE

    -

    Default: settings.DEFAULT_FILE_STORAGE

    -

    Description: How to store the thumbnails. Allows for external storage engines like S3.

    -
    -
    -

    JAVASCRIPT_URL

    -

    Default: STATIC_URL or MEDIA_URL + 'js/'

    -

    Description: Allows for customization of javascript placement.

    -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/reference/templatetags.html b/docs/reference/templatetags.html deleted file mode 100644 index 024a499..0000000 --- a/docs/reference/templatetags.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - - Template tags and filters — Django Categories v1.1 documentation - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Template tags and filters

    - -
    -

    Filters

    -
    -

    category_path

    -

    Optional Parameter: separator string. Default: " :: "

    -

    Creates a path represented by a categories by joining the items with a separator.

    -

    Each path item will be coerced to unicode, so you can pass a list of category instances, if required.

    -

    Example using a list of categories:

    -
    {{ some_list|category_path }}
    -
    -
    -

    If some_list is [ <Category: Country>, <Category: Country pop>, <Category: Urban Cowboy>] the result will be:

    -
    Country :: Country pop :: Urban Cowboy
    -
    -

    Example using a category node and optional separator parameter:

    -
    {{ some_node.get_ancestors|category_path:" > " }}
    -
    -
    -

    If some_node was category “Urban Cowboy”, the result will be:

    -
    Country > Country pop > Urban Cowboy
    -
    -
    -
    -

    tree_info

    -

    Optional Parameter: "ancestors"

    -

    Given a list of categories, it iterates over the list, generating a tuple of the current category and a dict containing information about the tree structure around it, with the following keys:

    -
    -
    'new_level'
    -
    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 category’s level is the same as or greater than the level of the current item.
    -
    -

    Provide the optional argument, "ancestors", to add a list of unicode representations of the ancestors of the current category, in descending order (root node first, immediate parent last), under the key ‘ancestors’.

    -

    For example: given the sample tree below, the contents of the list which would be available under the ‘ancestors’ key are given on the right:

    -
    Country             ->  []
    -   Country pop      ->  [u'Country pop']
    -      Urban Cowboy  ->  [u'Country', u'Country pop']
    -
    -

    Using this filter with unpacking in a {% for %} tag, you should have enough information about the tree structure to create a hierarchical representation of the tree.

    -
    {% for node,structure in objects|tree_info %}
    -    {% if structure.new_level %}<ul><li>{% else %}</li><li>{% endif %}
    -    {{ node.name }}
    -    {% for level in structure.closed_levels %}</li></ul>{% endfor %}
    -{% endfor %}
    -
    -
    -
    -
    -

    tree_queryset

    -

    Convert a regular category QuerySet into a new, ordered QuerySet that includes the categories selected and their ancestors.

    -

    This is especially helpful when you have a subset of categories and want to show the hierarchy for all the items.

    -

    For example, if we add it to the example for tree_info:

    -
    {% for node,structure in objects|tree_queryset|tree_info %}
    -    {% if structure.new_level %}<ul><li>{% else %}</li><li>{% endif %}
    -    {{ node.name }}
    -    {% for level in structure.closed_levels %}</li></ul>{% endfor %}
    -{% endfor %}
    -
    -
    -

    A list of unrelated categories such as [<Category: Urban cowboy>, <Category: Urban comtemporary>], the above template example will output the two categories and their ancestors:

    -
    <ul><li>
    -Country
    -<ul><li>
    -Country pop
    -<ul><li>
    -Urban cowboy
    -</li></ul></li></ul></li></ul>
    -<ul><li>
    -Rhythm and blues
    -<ul><li>
    -Urban contemporary
    -</li></ul></li></ul>
    -
    -
    -
    -

    Note

    -

    Categories that have similar ancestors are grouped accordingly. There is no duplication of the ancestor tree.

    -
    -
    -
    -
    -

    Inclusion tags

    -
    -

    display_path_as_ul

    -

    Template Rendered: categories/ul_tree.html

    -

    Syntax 1: {% display_path_as_ul <category_obj> %}

    -

    Syntax 2: {% display_path_as_ul <path_string>[ using="app.Model"] %}

    -

    Render the category with ancestors, but no children.

    -

    Pass either an object that subclasses CategoryBase or a path string for the category. Add using="app.Model" to specify which model when using a path string. The default model used is Category.

    -

    Example, using Category model:

    -
    {% display_path_as_ul "/Grandparent/Parent" %}
    -
    -
    -

    Example, using custom model:

    -
    {% display_path_as_ul "/Grandparent/Parent" using="coolapp.MusicGenre" %}
    -
    -
    -

    Example, using an object:

    -
    {% display_path_as_ul category_obj %}
    -
    -
    -

    Returns:

    -
    <ul>
    -  <li><a href="/categories/">Top</a>
    -  <ul>
    -    <li><a href="/categories/grandparent/">Grandparent</a></li>
    -  </ul>
    -  </li>
    -</ul>
    -
    -
    -
    -
    -

    display_drilldown_as_ul

    -

    Template rendered: categories/ul_tree.html

    -

    Syntax 1: {% display_drilldown_as_ul category_obj %}

    -

    Syntax 2: {% display_drilldown_as_ul "/Grandparent/Parent" [using="app.Model"] %}

    -

    Render the category with ancestors and children.

    -

    Example, using Category model:

    -
    {% display_drilldown_as_ul "/Grandparent/Parent" %}
    -
    -
    -

    Example, using custom model:

    -
    {% display_drilldown_as_ul "/Grandparent/Parent" using="coolapp.MusicGenre" %}
    -
    -
    -

    Example, using an object:

    -
    {% display_drilldown_as_ul category_obj %}
    -
    -
    -

    Returns:

    -
    <ul>
    -  <li><a href="/categories/">Top</a>
    -  <ul>
    -    <li><a href="/categories/grandparent/">Grandparent</a>
    -    <ul>
    -      <li><a href="/categories/grandparent/parent/">Parent</a>
    -      <ul>
    -        <li><a href="/categories/grandparent/parent/child1">Child1</a></li>
    -        <li><a href="/categories/grandparent/parent/child2">Child2</a></li>
    -        <li><a href="/categories/grandparent/parent/child3">Child3</a></li>
    -      </ul>
    -      </li>
    -    </ul>
    -    </li>
    -  </ul>
    -  </li>
    -</ul>
    -
    -
    -
    - -
    -
    -

    Template Tags

    -
    -

    get_top_level_categories

    -

    Retrieves an alphabetical list of all the categories that have no parents.

    -

    Syntax:

    -
    {% get_top_level_categories [using "app.Model"] as categories %}
    -
    -
    -

    Returns an list of categories [<category>, <category>, <category, ...]

    -
    -
    -

    get_category_drilldown

    -

    Syntax 1: {% get_category_drilldown <path_string> [using "app.Model"] as <varname> %}

    -

    Syntax 2: {% get_category_drilldown <object> as <varname> %}

    -

    Retrieves the specified category, its ancestors and its immediate children as an iterable. Syntax 1 allows for the retrieval of the category object via a slash-delimited path. The optional using "app.Model" allows you to specify from which model to retrieve the object.

    -

    Example:

    -
    {% get_category_drilldown "/Grandparent/Parent" using "family.Member" as family %}
    -
    -
    -

    The second syntax uses an instance of any object that subclasses CategoryBase

    -
    {% get_category_drilldown category_obj as family %}
    -
    -
    -

    Both examples sets family to:

    -
    [Grandparent, Parent, Child 1, Child 2, Child n]
    -
    -
    -
    -

    recursetree

    -

    This tag renders a section of your template recursively for each node in your -tree.

    -

    For example:

    -
    <ul class="root">
    -    {% recursetree nodes %}
    -        <li>
    -            {{ node.name }}
    -            {% if not node.is_leaf_node %}
    -                <ul class="children">
    -                    {{ children }}
    -                </ul>
    -            {% endif %}
    -        </li>
    -    {% endrecursetree %}
    -</ul>
    -
    -
    -

    Note the special variables node and children. -These are magically inserted into your context while you’re inside the -recursetree tag.

    -
    -

    node is an instance of your MPTT model.

    -

    children : This variable holds the rendered HTML for the children of -node.

    -
    -
    -

    Note

    -

    If you already have variables called node or children in your -template, and you need to access them inside the recursetree block, -you’ll need to alias them to some other name first:

    -
    {% with node as friendly_node %}
    -    {% recursetree nodes %}
    -        {{ node.name }} is friends with {{ friendly_node.name }}
    -        {{ children }}
    -    {% endrecursetree %}
    -{% endwith %}
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/registering_models.html b/docs/registering_models.html deleted file mode 100644 index 5397a5e..0000000 --- a/docs/registering_models.html +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - - - Registering Models — Django Categories v1.1 documentation - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - - - - - -
    -
    -
    -
    - -
    -

    Registering Models

    -
    -

    Registering models in settings.py

    -

    It is nice to not have to modify the code of applications to add a relation to categories. You can therefore do all the registering in settings.py. For example:

    -
    CATEGORIES_SETTINGS = {
    -    'FK_REGISTRY': {
    -        'app.AModel': 'category',
    -        'app.MyModel': (
    -            'primary_category',
    -            {'name': 'secondary_category', 'related_name': 'mymodel_sec_cat'}, )
    -    },
    -    'M2M_REGISTRY': {
    -        'app.BModel': 'categories',
    -        'app.MyModel': ('other_categories', 'more_categories', ),
    -    }
    -}
    -
    -
    -

    The FK_REGISTRY is a dictionary whose keys are the model to which to add the new field(s). The value is a string or tuple of strings or dictionaries specifying the necessary information for each field.

    -

    The M2M_REGISTRY is a dictionary whose keys are the model to which to add the new field(s). The value is a string or tuple of strings specifying the necessary information for each field.

    -
    -

    Registering one Category field to model

    -

    The simplest way is to specify the name of the field, such as:

    -
    CATEGORIES_SETTINGS = {
    -    'FK_REGISTRY': {
    -        'app.AModel': 'category'
    -    }
    -}
    -
    -
    -

    This is equivalent to adding the following the AModel of app:

    -
    category = models.ForeignKey(Category)
    -
    -
    -

    If you want more control over the new field, you can use a dictionary and pass other ForeignKey options. The name key is required:

    -
    CATEGORIES_SETTINGS = {
    -    'FK_REGISTRY': {
    -        'app.AModel': {'name': 'category', 'related_name': 'amodel_cats'}
    -    }
    -}
    -
    -
    -

    This is equivalent to adding the following the AModel of app:

    -
    category = models.ForeignKey(Category, related_name='amodel_cats')
    -
    -
    -
    -
    -

    Registering two or more Category fields to a Model

    -

    When you want more than one relation to Category, all but one of the fields must specify a related_name to avoid conflicts, like so:

    -
    CATEGORIES_SETTINGS = {
    -    'FK_REGISTRY': {
    -        'app.MyModel': (
    -            'primary_category',
    -            {'name': 'secondary_category', 'related_name': 'mymodel_sec_cat'}, )
    -    },
    -
    -
    -
    -

    Registering one or more Many-to-Many Category fields to a Model

    -
    CATEGORIES_SETTINGS = {
    -    'M2M_REGISTRY': {
    -        'app.AModel': 'categories',
    -        'app.MyModel': (
    -            {'name': 'other_categories', 'related_name': 'other_cats'},
    -            {'name': 'more_categories', 'related_name': 'more_cats'},
    -        ),
    -    }
    -}
    -
    -
    -
    -
    -
    -

    Registering a many-to-one relationship

    -

    To create a many-to-one relationship (foreign key) between a model and Django Categories, you register your model with the register_fk function.

    -
    -
    -register_fk(model, field_name='category', extra_params={}])
    -
    --- - - - -
    Parameters:
      -
    • model – The Django Model to link to Django Categories
    • -
    • field_name – Optional name for the field default: category
    • -
    • extra_params – Optional dictionary of extra parameters passed to the ForeignKey class.
    • -
    -
    -
    - -

    Example, in your models.py:

    -
    import categories
    -categories.register_fk(MyModel)
    -
    -
    -

    If you want more than one field on a model you have to have some extra arguments:

    -
    import categories
    -categories.register_fk(MyModel, 'primary_category')
    -categories.register_fk(MyModel, 'secondary_category', {'related_name':'mymodel_sec_cat'})
    -
    -
    -

    The extra_args allows you to specify the related_name of one of the fields so it doesn’t clash.

    -
    -
    -

    Registering a many-to-many relationship

    -

    To create a many-to-many relationship between a model and Django Categories, you register your model with the register_m2m function.

    -
    -
    -register_m2m(model, field_name='categories', extra_params={}])
    -
    --- - - - -
    Parameters:
      -
    • model – The Django Model to link to Django Categories
    • -
    • field_name – Optional name for the field default: categories
    • -
    • extra_params – Optional dictionary of extra parameters passed to the ManyToManyField class.
    • -
    -
    -
    - -

    Example, in your models.py:

    -
    import categories
    -categories.register_m2m(MyModel)
    -
    -
    -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/search.html b/docs/search.html deleted file mode 100644 index 394cb8c..0000000 --- a/docs/search.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - Search — Django Categories v1.1 documentation - - - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - - - - - -
    -
    -
    -
    - -

    Search

    -
    - -

    - Please activate JavaScript to enable the search - functionality. -

    -
    -

    - From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing fewer words won't appear in the result list. -

    -
    - - - -
    - -
    - -
    - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/searchindex.js b/docs/searchindex.js deleted file mode 100644 index 94c7fe9..0000000 --- a/docs/searchindex.js +++ /dev/null @@ -1 +0,0 @@ -Search.setIndex({objects:{"":{Category:[0,0,1],register_m2m:[8,2,1],CategoryBase:[0,0,1],register_fk:[8,2,1]},Category:{meta_keywords:[0,1,1],description:[0,1,1],meta_extra:[0,1,1],thumbnail_width:[0,1,1],order:[0,1,1],alternate_title:[0,1,1],alternate_url:[0,1,1],thumbnail_height:[0,1,1],thumbnail:[0,1,1]},CategoryBase:{name:[0,1,1],parent:[0,1,1],tree:[0,1,1],objects:[0,1,1],active:[0,1,1],slug:[0,1,1]}},terms:{represent:[5,6],all:[0,1,2,8,6,5,9,10,11],code:[9,7,8,11],sci:5,forget:11,is_leaf_nod:6,follow:[5,8,6],children:[0,5,6],hard_coded_connect:[],hierarch:[1,6,7],whose:[0,8],depend:11,upload_to:7,friendli:0,categorymanag:0,rhythm:6,under:[5,6],cache_view_length:[4,2],child1:6,child2:6,child3:6,fieldset:7,string:[2,8,6],bmodel:8,fals:[5,2,6],mechan:[],parti:11,coolapp:6,veri:0,affect:9,syntax:[2,6],exact:11,magic:6,level:[5,6],list:[0,5,3,6],upload:[0,2],iter:[5,6],item:[0,1,6,5],categories_set:[10,2,8],endrecursetre:6,consequ:2,second:6,treemanag:0,alternate_url:[0,7],treeforeignkei:0,full_tree_for_categori:[],even:11,index:1,what:[],appear:[5,1],section:[1,6],current:[5,10,6],version:7,"new":[5,1,8,6,7],varnam:6,method:[0,7],metadata:7,full:[],deriv:[0,1,7],gener:[0,5,6],never:[],fk_registri:[4,2,8,11],path:[10,2,6],full_tree_for_model:[],modifi:8,valu:[2,8],treeleaf:[],search:[0,1,7],genr:[],thumbnail_upload_path:[7,2,4],amount:2,related_nam:[9,5,8],action:1,chang:[9,2],control:[8,11],via:[0,6],dictionari:[2,8],extra:[5,7,8],appli:[],app:[9,1,8,6,11],disciplin:11,deprec:2,api:9,subcategori:[5,11],famili:6,simplecategoryadmin:7,instal:[1,3,11],txt:10,select:[0,6],from:[0,1,5,6,7,9,10,11],would:[9,5,6],regist:[1,2,8,7,5,9,10,11],two:[5,8,6,11],next:[5,7,6],few:3,call:6,type:[],tell:[],more:[7,8,11],sort:0,clean_alternate_titl:7,relat:[5,2,8,11],hurt:9,indic:1,hold:6,unpack:6,cach:2,must:[9,7,8,10],none:7,join:6,alia:6,work:9,recursetre:6,treelevel:[],can:[0,2,8,5,6,7,9,10,11],root:[0,5,6],def:7,overrid:[7,2],want:[1,2,8,6,7,9],fragment:[],get_top_level_categori:6,templat:[5,1,6,4],manytomanyfield:8,tag:[5,1,6,4],tab:10,multipl:[1,10],divid:1,anoth:9,write:2,allow_slug_chang:[4,2],more_cat:8,meta_keyword:[0,7],default_file_storag:2,instead:[0,7,5],ancestor:[5,6],app_name_model_nam:10,updat:[],overridden:7,after:[5,6,11],befor:11,extra_param:8,end:[5,6],data:[9,1,7],ul_tre:6,attempt:9,get_latest_objects_by_categori:[],seriou:2,django:[0,1,3,7,8,9,10,11],caus:9,inform:[5,8,6,11],allow:[1,2,8,6,7,5],enter:[9,1],callabl:2,first:[9,10,6,5],order:[0,7,6,5],category_detail:5,help:6,slugif:[],over:[5,8,6],becaus:9,comma:[0,7,5],hierarchi:[0,7,6],taxonomi:1,secondary_categori:8,dynam:[9,11],paramet:[5,8,6],group:6,catgor:7,other_categori:8,chosen:0,fix:1,therefor:8,alter:[5,7,6],them:6,categorybaseadminform:7,"return":[7,6],greater:[5,6],thei:9,handl:[0,1,11],extra_arg:8,var_nam:[],initi:[],mymodel_sec_set:[],now:1,document:1,name:[0,1,8,7,6,9,5,11],unidecod:2,simpl:[9,7],drop:[9,10],separ:[0,7,6,5],easili:[],each:[2,8,6],categoryadmin:7,unicod:[5,6],collaps:7,mean:2,subset:6,hard:11,"7beta1":[],urlfield:0,"7beta3":[],meta:7,connect:[1,11],our:1,happen:[],special:6,out:1,variabl:6,"3rd":11,space:10,categori:[0,1,2,3,4,5,6,7,8,9,10,11],verbatim:[0,7],import_categori:[4,10],rel:0,insid:6,advanc:[0,7],migrat:3,given:[5,6],get_image_dimens:7,headlin:5,reason:0,base:5,transliter:[],drop_category_field:[9,4,10],basi:11,reconfigur:[9,1],indent:10,meta_extra:[0,7],appnam:[],could:[9,1,5],static_url:2,filter:[1,6,4],musicgenr:[6,11],perman:9,charfield:[0,7,11],assign:7,south:[9,1,3,11,10],lambda:2,render:6,onc:1,independ:1,number:[],sometim:7,mymodel_sec_cat:8,alreadi:[6,11],done:11,blank:[0,7],installed_app:3,miss:[9,10],differ:[9,3],lazy_connect:[],width:[0,7],associ:2,top:[6,11],system:[0,1],least:7,stori:1,max_length:[7,11],accordingli:6,store:2,schema:9,urban:6,option:[0,7,8,6,5],relationship:[9,1,8,11,5],especi:6,get_absolute_url:5,specifi:[5,10,2,8,6],part:2,textfield:[0,7],than:[5,8,6],category_path:6,grew:1,keyword:[0,7],provid:[9,1,6,5],tree:[0,10,11,6,5],structur:[9,5,6],charact:2,project:[3,11],matter:9,endspaceless:[],friend:6,imagefield:0,browser:[],"function":[1,2,8,7],behavior:9,ran:11,pass:[7,8,6],queryset:6,argument:[5,8,6],packag:7,mptt:[0,7,6],have:[5,2,8,6,11],tabl:[9,1,11,10,7],need:[1,3,6,7],"null":7,engin:[0,7,2],categorybas:[0,1,2,3,4,6,7],equival:8,self:[0,7],register_fk:8,note:[0,6],also:[9,7,11],exampl:[9,7,8,6,5],take:11,which:[5,2,8,6],tupl:[5,2,8,6],tool:2,singl:7,compat:[],endfor:[5,6],clash:8,though:[],object:[0,5,6],regular:6,relation_model:[4,2],"class":[0,2,8,6,7,11],sub:10,don:[9,2,11],url:[0,7,2],doc:7,mymodel:[8,11],doe:7,place:[0,7],clean:7,register_m2m:8,show:6,model_nam:[9,10,2],checkbox:1,breadcrumbs_tag:[],contemporari:6,filefield:[0,7],impact:0,access:[5,6],onli:[0,1,2,3,5,7,9],coerc:6,configur:[9,5,11],activ:[0,7],should:[5,7,6],dict:[5,2,6],tree_info:[5,6],media_url:2,count:5,get:[5,1,11],simplest:8,soon:2,cannot:10,increas:[],requir:[0,8,6,9,10,11],amodel_cat:8,get_ancestor:6,contain:[5,6],through:11,cache_middleware_second:[],where:2,view:[5,2],set:[0,1,2,3,4,6,7,8,11],concert:1,thumbnail_width:[0,7],displai:[],javascript_url:[4,2],see:[9,5,2,3,11],result:[7,2,6],arg:7,close:7,subject:11,still:9,kei:[5,2,8,6,11],databas:[9,1,11,10],enough:6,between:8,"import":[5,7,8,11,10],thumbnail:[0,7,2],modeladmin:11,attribut:[0,7],altern:[0,7],grandpar:6,extend:5,javascript:2,treebranch:[],complementari:9,come:[],popul:[],both:6,last:[5,6],delimit:6,admin:[1,2,11,7],similar:6,howev:[9,7],lazi:11,foreign:[8,11],instanc:[0,7,6],context:6,new_level:[5,6],mani:[0,1,8,7,9,11],display_path_as_ul:6,thumbnail_storag:[0,4,2],simpli:[],slugfield:0,height:[0,7],mpttmeta:7,respect:11,duplic:6,empti:[5,6],much:7,basic:1,addit:[0,7],imag:7,convert:[2,6],ani:[0,1,7,6,9,5,11],child:[5,6],closed_level:[5,6],"case":[0,7,9],display_drilldown_as_ul:6,look:5,modelnam:2,"while":[9,6],abov:[7,6],error:9,some_list:6,loos:9,endblock:5,categorybaseadmin:7,non:2,kwarg:7,ascii:2,sever:[9,7,11],parent:[0,7,6,5],welcom:[],perform:0,alphabet:[0,6],make:[0,9,11],more_categori:8,same:[0,1,6,5,10,11],member:6,python:9,html:[0,7,6,5],descend:[5,6],m2m_registri:[4,2,8,11],eventu:[],conflict:8,http:0,categoryadminform:7,blue:6,someon:11,user:[7,2],countri:6,extern:2,cosmet:1,appropri:9,dystopian:5,entri:5,well:[0,11],inherit:7,without:5,command:[9,1,10,4],thi:[0,2,8,5,6,7,9,11],endif:[5,6],model:[0,1,2,3,4,5,6,7,9,8,11],latest:[],relatedmodel_set:5,just:7,photo:1,simplecategoryadminform:[],endwith:6,alternate_titl:[0,7],thumbnail_height:[0,7],forloop:[],web:1,entries_set:5,register_admin:[0,4,2],easi:1,mix:10,had:5,littl:7,add:[0,3,6,7,8,5,10,11],book:5,inner:7,tweak:[],els:[5,7,6,11],save:[0,7,2],modul:[1,2],gave:1,applic:[9,1,8,11,10],around:[5,6],amodel:8,format:[],pop:6,field_nam:[9,10,8],bit:7,recurs:6,insert:6,like:[5,7,2,8],specif:2,other_cat:8,manual:0,href:[5,6],necessari:[7,8],either:[7,6],output:6,list_displai:7,page:[0,1,7],underli:9,revers:5,simplecategori:7,some:[1,8,6],intern:[],sampl:[5,6],syncdb:[3,11],inact:0,category_set:[],tree_path:[],integerfield:[0,7],lead:0,slug_transliter:[4,2],avoid:8,subclass:[0,1,2,3,6,7],add_category_field:[9,4,11,10],leav:0,tree_queryset:6,content:[5,1,6],refer:[1,4],core:7,set_nam:[],run:[9,3,11],imposs:0,usag:10,comtemporari:6,how:2,step:3,isn:[0,7],"super":7,slug:[0,7,2],about:[5,6],column:9,verbose_name_plur:7,date_field:[],includ:[0,7,2,6,9],cowboi:6,category_obj:6,other:[1,8,6,7,5,11],block:[5,6],file2:10,own:[7,2,3,11],within:[5,1],automat:[0,5],slash:6,right:[5,6],subdisciplin:11,contrib:7,storag:[7,2,11],your:[1,2,3,6,7,5,8,11],manag:[0,1,3,7,4,9,10,11],inclus:[4,6],wai:[9,8,11],musicsubgenr:11,"long":9,custom:[1,2,3,6,7,11],avail:[5,6],start:[5,1,11,6,10],editor:3,suit:1,fork:11,head:[0,7],cleaned_data:7,form:[7,2],great:2,category_tag:5,link:8,placement:2,line:10,"true":[0,7,2,6,5],bug:1,reset:9,immedi:[5,6],path_str:6,possibl:9,"default":[0,2,8,6,7,9],wish:11,app2:10,app1:10,below:[5,6],foreignkei:[8,11],site:[0,1,7],otherwis:[5,6],problem:0,unrel:6,booleanfield:0,app_nam:[9,10,2],featur:5,creat:[1,3,6,7,9,8,11],retriev:6,"abstract":[],primary_categori:8,doesn:[9,8],repres:6,exist:0,file:[0,7,3,11,10],pip:3,improv:1,check:0,probabl:[9,2],titl:[0,7],when:[8,6,11],detail:5,refactor:1,field:[0,1,8,7,9,10,11],valid:5,lookup:7,futur:5,test:1,you:[2,3,5,6,7,8,9,10,11],nice:8,node:[5,6],some_nod:6,friendly_nod:6,order_insertion_bi:7,why:0,breadcrumb:6,land:0,longer:0,help_text:7,get_category_drilldown:6,descript:[0,7,2,5],"6b1":[],potenti:2,time:[9,2]},objtypes:{"0":"py:class","1":"py:attribute","2":"py:function"},titles:["Models","Django Categories v 1.1","Settings","Installation","Reference","Using categories in templates","Template tags and filters","Creating Custom Categories","Registering Models","Adding the fields to the database","Management Commands","Getting Started"],objnames:{"0":"Python class","1":"Python attribute","2":"Python function"},filenames:["reference/models","index","reference/settings","installation","reference/index","usage","reference/templatetags","custom_categories","registering_models","adding_the_fields","reference/management_commands","getting_started"]}) \ No newline at end of file diff --git a/docs/templatetags.html b/docs/templatetags.html deleted file mode 100644 index 6b4a500..0000000 --- a/docs/templatetags.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - Template Tags — Django Categories v0.7beta1 documentation - - - - - - - - - - - -
    -

    Django Categories v0.7beta1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Template Tags

    -
    -

    get_top_level_categories

    -

    Retrieves an alphabetical list of all the categories that have no parents.

    -

    Syntax:

    -
    {% get_top_level_categories as categories %}
    -
    -
    -

    Returns an list of categories [<category>, <category>, <category, ...]

    -
    -
    -

    display_path_as_ul

    -

    Render the category with ancestors, but no children using the categories/ul_tree.html template.

    -

    Example:

    -
    {% display_path_as_ul "/Grandparent/Parent" %}
    -
    -
    -

    or

    -
    {% display_path_as_ul category_obj %}
    -
    -
    -

    Returns:

    -
    <ul>
    -  <li><a href="/categories/">Top</a>
    -  <ul>
    -    <li><a href="/categories/grandparent/">Grandparent</a></li>
    -  </ul>
    -  </li>
    -</ul>
    -
    -
    -
    -
    -

    get_category_drilldown

    -

    Retrieves the specified category, its ancestors and its immediate children -as an iterable.

    -

    Example:

    -
    {% get_category_drilldown "/Grandparent/Parent" as family %}
    -
    -
    -

    or

    -
    {% get_category_drilldown category_obj as family %}
    -
    -
    -

    Sets family to:

    -
    [Grandparent, Parent, Child 1, Child 2, Child n]
    -
    -
    -
    -

    display_drilldown_as_ul

    -

    Render the category with ancestors and children using the -categories/ul_tree.html template.

    -

    Example:

    -
    {% display_drilldown_as_ul "/Grandparent/Parent" %}
    -
    -
    -

    or:

    -
    {% display_drilldown_as_ul category_obj %}
    -
    -
    -

    Returns:

    -
    <ul>
    -  <li><a href="/categories/">Top</a>
    -  <ul>
    -    <li><a href="/categories/grandparent/">Grandparent</a>
    -    <ul>
    -      <li><a href="/categories/grandparent/parent/">Parent</a>
    -      <ul>
    -        <li><a href="/categories/grandparent/parent/child1">Child1</a></li>
    -        <li><a href="/categories/grandparent/parent/child2">Child2</a></li>
    -        <li><a href="/categories/grandparent/parent/child3">Child3</a></li>
    -      </ul>
    -      </li>
    -    </ul>
    -    </li>
    -  </ul>
    -  </li>
    -</ul>
    -
    -
    -
    - -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file diff --git a/docs/usage.html b/docs/usage.html deleted file mode 100644 index 2fb9c25..0000000 --- a/docs/usage.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - Using categories in templates — Django Categories v1.1 documentation - - - - - - - - - - - -
    -

    Django Categories v1.1 documentation

    -
    - - -
    -
    - - - -

    This Page

    - - - -
    -
    - - - -
    -
    -
    -
    - -
    -

    Using categories in templates

    -
    -

    Getting all items within a category

    -

    The Category model automatically gets reverse relationships with all other models related to it.

    -

    This allows you access to the related objects from the template without altering any views. For example, if you only had Entry models related to Category, your categories/category_detail.html template could look like

    -
     1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    {% extends 'categories/base.html' %}
    -{% block content %}
    -<h1>{{ category }}</h1>
    -{% if category.parent %}
    -    <h2>Go up to 
    -        <a href="{{ category.parent.get_absolute_url }}">
    -            {{ category.parent }}
    -        </a></h2>
    -{% endif %}
    -{% if category.description %}<p>{{ category.description }}</p>{% endif %}
    -{% if category.children.count %}
    -    <h2>Subcategories</h2>
    -    <ul>
    -        {% for child in category.children.all %}
    -        <li><a href="{{ child.get_absolute_url }}">{{ child }}</a></li>
    -        {% endfor %}
    -    </ul>
    -{% endif %}
    -<h2>Entries</h2>
    -{% if category.entries_set.all %}
    -    {% for entry in category.entries_set.all %}
    -        <p><a href="{{ entry.get_absolute_url }}">{{ entry.headline }}</a></p>
    -    {% endfor %}
    -{% else %}
    -    <p><em>No entries for {{ category }}</em></p>
    -{% endif %}
    -
    -{% endblock %}
    -
    -
    -

    If you have related_name parameters to the configuration (see Registering Models), then you would use category.related_name.all instead of category.relatedmodel_set.all.

    -
    -
    -

    Template Tags

    -

    To use the template tags:

    -
    {% import category_tags %}
    -
    -
    -

    tree_info

    -

    Given a list of categories, iterates over the list, generating -two-tuples of the current tree item and a dict containing -information about the tree structure around the item, with the following -keys:

    -
    -
    -
    'new_level'
    -
    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 -parent last), under the key 'ancestors'.

    -

    For example: given the sample tree below, the contents of the list -which would be available under the 'ancestors' key are given -on the right:

    -
    Books                    ->  []
    -   Sci-fi                ->  [u'Books']
    -      Dystopian Futures  ->  [u'Books', u'Sci-fi']
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    -
    - - - - \ No newline at end of file