You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The purpose of this was to solve a bug when more than 10 entries at
any given level (including the root level) were inserted. The previous
next-value logic sorted lexicographically but didn't pad values when
converted back from integers, so 1000 got sorted between 100 and 200.
This led to constraint violations when more than 10 rows were
inserted.
Because the previous Python code that generated a SQL expression to
calculate the next value was a nightmare to read, and relied on a dirty
hack overriding parts of the Django ORM's internals, I took this
opportunity to rewrite it as a PL/pgSQL function; this means it can
actually be written in an imperative manner where appropriate, without
having to do multiple round-trips to the database.
Copy file name to clipboardExpand all lines: docs/install.rst
+3-4Lines changed: 3 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Installing django-pgtree
2
2
========================
3
3
4
-
First, install the ``django-pgtree`` package from PyPI using your package manager of choice:
4
+
Install the ``django-pgtree`` package from PyPI using your package manager of choice:
5
5
6
6
.. code-block:: sh
7
7
@@ -11,11 +11,10 @@ First, install the ``django-pgtree`` package from PyPI using your package manage
11
11
# or
12
12
$ pipenv install django-pgtree
13
13
14
-
.. note::
15
14
16
-
Currently, you don't have to add anything to ``INSTALLED_APPS``.
15
+
Then, add ``django_pgtree`` to ``INSTALLED_APPS``.
17
16
18
-
Second, run the following SQL command on any database that's going to use django-pgtree fields or models:
17
+
On your development database and when you first deploy, you'll also need to run the following SQL command on any database that's going to use django-pgtree fields or models:
0 commit comments