Skip to content

Commit 47ef6bb

Browse files
Merge branch 'add-pre-commit' of https://github.com/baseplate-admin/django-ltree-2 into add-pre-commit
2 parents 50d8482 + 89e6789 commit 47ef6bb

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

django_ltree/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
default_app_config = 'django_ltree.apps.DjangoLtreeConfig'
1+
default_app_config = "django_ltree.apps.DjangoLtreeConfig"

django_ltree/paths.py

-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def __next__(self):
2828
if path not in self.skip_paths:
2929
return path
3030

31-
3231
@staticmethod
3332
def guess_the_label_size(path_size: int, combination_size: int) -> int:
3433
# The theoritical limit for this at the time of writing is 2_538_557_185_841_324_496 (python 3.12.2)
@@ -53,5 +52,3 @@ def guess_the_label_size(path_size: int, combination_size: int) -> int:
5352
label_size += 1
5453

5554
return label_size
56-
57-

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def pytest_sessionstart(session):
1313
"NAME": "ltree_test",
1414
"HOST": os.environ.get("DJANGO_DATABASE_HOST", "database"),
1515
"USER": os.environ.get("DJANGO_DATABASE_USER", "postgres"),
16-
"PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD", "")
16+
"PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD", ""),
1717
}
1818
},
1919
ROOT_URLCONF="tests.urls",

tests/taxonomy/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class TaxonomyConfig(AppConfig):
5-
name = 'taxonomy'
5+
name = "taxonomy"

tests/taxonomy/migrations/0001_initial.py

+15-9
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,29 @@
77

88

99
class Migration(migrations.Migration):
10-
1110
initial = True
1211

13-
dependencies = [
14-
]
12+
dependencies = []
1513

1614
operations = [
1715
migrations.CreateModel(
18-
name='Taxonomy',
16+
name="Taxonomy",
1917
fields=[
20-
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21-
('path', django_ltree.fields.PathField(unique=True)),
22-
('name', models.TextField()),
18+
(
19+
"id",
20+
models.AutoField(
21+
auto_created=True,
22+
primary_key=True,
23+
serialize=False,
24+
verbose_name="ID",
25+
),
26+
),
27+
("path", django_ltree.fields.PathField(unique=True)),
28+
("name", models.TextField()),
2329
],
2430
options={
25-
'ordering': ('path',),
26-
'abstract': False,
31+
"ordering": ("path",),
32+
"abstract": False,
2733
},
2834
),
2935
]

tests/test_path_value.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import pytest
2-
31
from django_ltree.fields import PathValue
42

53

0 commit comments

Comments
 (0)