Skip to content

Commit

Permalink
Merge pull request #641 from jdufresne/ws
Browse files Browse the repository at this point in the history
Trim trailing white space throughout the project
  • Loading branch information
craigds committed Apr 15, 2018
2 parents d8b954e + cec6cab commit 0a292c8
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 127 deletions.
6 changes: 3 additions & 3 deletions NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Reparenting

Since it's not unreasonable to assume a good percentage of the people
who use this application will also be using the ``django.contrib.admin``
application or ``forms.ModelForm`` to edit their data, and since in these
cases only the parent field will be editable if users have allowed
``mptt.register`` to create tree fields for them, it would be nice if
application or ``forms.ModelForm`` to edit their data, and since in these
cases only the parent field will be editable if users have allowed
``mptt.register`` to create tree fields for them, it would be nice if
Django MPTT automatically took care of the tree when a ``Model`` instance
has its parent changed.

Expand Down
1 change: 0 additions & 1 deletion docs/admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,3 @@ to ``10``)::
class MyTreeRelatedFieldListFilter(TreeRelatedFieldListFilter):
mptt_level_indent = 20
# ...

1 change: 0 additions & 1 deletion docs/autogenerated.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Autogenerated documentation
===========================

Expand Down
4 changes: 2 additions & 2 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Alternatively, you can get the latest source from our `git`_ repository::
git clone git://github.com/django-mptt/django-mptt.git django-mptt

Add the resulting folder to your `PYTHONPATH`_ or symlink the ``mptt`` directory
inside it into a directory which is on your PYTHONPATH, such as your Python
inside it into a directory which is on your PYTHONPATH, such as your Python
installation's ``site-packages`` directory.

You can verify that the application is available on your PYTHONPATH by
Expand All @@ -49,7 +49,7 @@ from within the ``django-mptt`` directory.
The development version may contain bugs which are not present in the
release version and introduce backwards-incompatible changes.

If you're tracking master, keep an eye on the recent `Commit History`_
If you're tracking master, keep an eye on the recent `Commit History`_
before you update your copy of the source code.

.. _`git`: https://git-scm.com/
Expand Down
12 changes: 6 additions & 6 deletions docs/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -404,33 +404,33 @@ Example usage in the admin

class CategoryAdmin(DraggableMPTTAdmin):
mptt_indent_field = "name"
list_display = ('tree_actions', 'indented_title',
list_display = ('tree_actions', 'indented_title',
'related_products_count', 'related_products_cumulative_count')
list_display_links = ('indented_title',)

def get_queryset(self, request):
qs = super().get_queryset(request)

# Add cumulative product count
qs = Category.objects.add_related_count(
qs,
Product,
'category',
'products_cumulative_count',
cumulative=True)

# Add non cumulative product count
qs = Category.objects.add_related_count(qs,
Product,
'categories',
'products_count',
cumulative=False)
return qs

def related_products_count(self, instance):
return instance.products_count
related_product_count.short_description = 'Related products (for this specific category)'

def related_products_cumulative_count(self, instance):
return instance.products_cumulative_count
related_products_cumulative_count.short_description = 'Related products (in tree)'
Expand Down
2 changes: 1 addition & 1 deletion docs/mptt.fields.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
===============
``mptt.fields``
===============

.. automodule:: mptt.fields
:members:
:undoc-members:
2 changes: 1 addition & 1 deletion docs/mptt.forms.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
==============
``mptt.forms``
==============

.. automodule:: mptt.forms
:members:
:undoc-members:
6 changes: 3 additions & 3 deletions docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ details about how the technique itself works:
* `Trees in SQL`_
* `Storing Hierarchical Data in a Database`_
* `Managing Hierarchical Data in MySQL`_

.. _`Trees in SQL`: https://www.ibase.ru/files/articles/programming/dbmstrees/sqltrees.html
.. _`Storing Hierarchical Data in a Database`: https://www.sitepoint.com/hierarchical-data-database/
.. _`Managing Hierarchical Data in MySQL`: http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
Expand All @@ -31,7 +31,7 @@ details about how the technique itself works:
What is ``django-mptt``?
========================

``django-mptt`` is a reusable Django app which aims to make it easy for you
``django-mptt`` is a reusable Django app which aims to make it easy for you
to use MPTT with your own Django models.

It takes care of the details of managing a database table as a tree
Expand All @@ -58,7 +58,7 @@ Feature overview

* A ``TreeManager`` manager is added to all registered models. This provides
methods to:

* move nodes around a tree, or into a different tree
* insert a node anywhere in a tree
* rebuild the MPTT fields for the tree (useful when you do bulk updates
Expand Down
2 changes: 1 addition & 1 deletion docs/technical_details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Note: In the above paragraph 'client code' means any django app that uses mptt b

.. _`LOCK/UNLOCK statements are not transaction safe`: https://dev.mysql.com/doc/refman/5.7/en/lock-tables-and-transactions.html




Running the test suite
Expand Down
8 changes: 4 additions & 4 deletions docs/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ These are magically inserted into your context while you're inside the

``node`` is an instance of your MPTT model.

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

.. note::
If you already have variables called ``node`` or ``children`` in your
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::

Expand Down Expand Up @@ -202,7 +202,7 @@ Example::
Examples
========

Using ``drilldown_tree_for_node`` and ``tree_info`` together to render a
Using ``drilldown_tree_for_node`` and ``tree_info`` together to render a
drilldown menu for a node, with cumulative counts of related items for the node's
children::

Expand All @@ -218,7 +218,7 @@ children::
{% for level in structure.closed_levels %}</li></ul>{% endfor %}
{% endfor %}

Using ``tree_info`` (with its optional argument) and ``tree_path`` together
Using ``tree_info`` (with its optional argument) and ``tree_path`` together
to create a multiple-select, which:

* doesn't contain root nodes
Expand Down
1 change: 0 additions & 1 deletion docs/tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

========
Tutorial
========
Expand Down
4 changes: 2 additions & 2 deletions mptt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ def register(meta, cls, **kwargs):

bases.insert(0, MPTTModel)
cls.__bases__ = tuple(bases)

is_cls_tree_model = _get_tree_model(cls) is cls

if is_cls_tree_model:
# HACK: _meta.get_field() doesn't work before AppCache.ready in Django>=1.8
# ( see https://code.djangoproject.com/ticket/24231 )
Expand Down
1 change: 0 additions & 1 deletion tests/myapp/doctests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1477,4 +1477,3 @@ ValueError: Cannot insert a node which has already been saved.
<Person: Jess>
>>> list(jane.get_ancestors())
[<Person: Jess>, <Person: Jeff>]

0 comments on commit 0a292c8

Please sign in to comment.