Skip to content

Commit

Permalink
Merge branch 'add-pre-commit' of https://github.com/baseplate-admin/d…
Browse files Browse the repository at this point in the history
…jango-ltree-2 into add-pre-commit
  • Loading branch information
baseplate-admin committed Jun 29, 2024
2 parents 50d8482 + 89e6789 commit 47ef6bb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion django_ltree/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
default_app_config = 'django_ltree.apps.DjangoLtreeConfig'
default_app_config = "django_ltree.apps.DjangoLtreeConfig"
3 changes: 0 additions & 3 deletions django_ltree/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def __next__(self):
if path not in self.skip_paths:
return path


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

return label_size


2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def pytest_sessionstart(session):
"NAME": "ltree_test",
"HOST": os.environ.get("DJANGO_DATABASE_HOST", "database"),
"USER": os.environ.get("DJANGO_DATABASE_USER", "postgres"),
"PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD", "")
"PASSWORD": os.environ.get("DJANGO_DATABASE_PASSWORD", ""),
}
},
ROOT_URLCONF="tests.urls",
Expand Down
2 changes: 1 addition & 1 deletion tests/taxonomy/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class TaxonomyConfig(AppConfig):
name = 'taxonomy'
name = "taxonomy"
24 changes: 15 additions & 9 deletions tests/taxonomy/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
]
dependencies = []

operations = [
migrations.CreateModel(
name='Taxonomy',
name="Taxonomy",
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('path', django_ltree.fields.PathField(unique=True)),
('name', models.TextField()),
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("path", django_ltree.fields.PathField(unique=True)),
("name", models.TextField()),
],
options={
'ordering': ('path',),
'abstract': False,
"ordering": ("path",),
"abstract": False,
},
),
]
2 changes: 0 additions & 2 deletions tests/test_path_value.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

from django_ltree.fields import PathValue


Expand Down

0 comments on commit 47ef6bb

Please sign in to comment.