Skip to content

Commit b3a759c

Browse files
committed
Remove more old django references
1 parent 8247991 commit b3a759c

File tree

17 files changed

+25
-1478
lines changed

17 files changed

+25
-1478
lines changed

plain-code/poetry.lock

Lines changed: 2 additions & 450 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plain-code/pyproject.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,12 @@ authors = ["Dave Gaeddert <[email protected]>"]
1515

1616
[tool.poetry.dependencies]
1717
python = "^3.11"
18-
1918
plain = "<1.0.0"
20-
2119
ruff = "^0.1.0"
2220

2321
[tool.poetry.group.dev.dependencies]
2422
plain = { path = "../plain", develop = true }
2523

26-
pytest = "^7.1.2"
27-
ipdb = "^0.13.9"
28-
isort = "^5.10.1"
29-
black = "^23.1.0"
30-
pytest-django = "^4.5.2"
31-
3224
[build-system]
3325
requires = ["poetry-core>=1.0.0"]
3426
build-backend = "poetry.core.masonry.api"

plain-elements/poetry.lock

Lines changed: 2 additions & 450 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plain-elements/pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ plain = "<1.0.0"
1414

1515
[tool.poetry.group.dev.dependencies]
1616
plain = { path = "../plain", develop = true }
17-
pytest = "^7.1.2"
18-
ipdb = "^0.13.9"
19-
isort = "^5.10.1"
20-
black = "^23.1.0"
21-
pytest-django = "^4.5.2"
2217

2318
[build-system]
2419
requires = ["poetry-core>=1.0.0"]

plain-importmap/plain/importmap/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(
4949
self.map_dev = {}
5050

5151
def load(self):
52-
# TODO django check to compare lock and config hash
52+
# TODO preflight check to compare lock and config hash
5353

5454
self.config = self.load_config()
5555

plain-models/plain/models/backends/postgresql/introspection.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,7 @@ def get_constraints(self, cursor, table_name):
276276
) in cursor.fetchall():
277277
if index not in constraints:
278278
basic_index = (
279-
type_ == self.index_default_access_method
280-
and
281-
# '_btree' references
282-
# django.contrib.postgres.indexes.BTreeIndex.suffix.
283-
not index.endswith("_btree")
284-
and options is None
279+
type_ == self.index_default_access_method and options is None
285280
)
286281
constraints[index] = {
287282
"columns": columns if columns != [None] else [],

plain-models/plain/models/cli.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from plain.models.migrations.utils import get_migration_name_timestamp
2525
from plain.models.migrations.writer import MigrationWriter
2626
from plain.packages import packages
27-
from plain.runtime import __version__, settings
27+
from plain.runtime import settings
2828
from plain.utils.module_loading import module_has_submodule
2929
from plain.utils.text import Truncator
3030

@@ -988,9 +988,7 @@ def optimize_migration(package_label, migration_name, check, verbosity):
988988
if migration.replaces:
989989
raise click.ClickException(
990990
"Migration will require manual porting but is already a squashed "
991-
"migration.\nTransition to a normal migration first: "
992-
f"https://docs.djangoproject.com/en/{__version__}/topics/migrations/"
993-
"#squashing-migrations"
991+
"migration.\nTransition to a normal migration first."
994992
)
995993
# Make a new migration with those operations.
996994
subclass = type(
@@ -1270,8 +1268,7 @@ def find_migration(loader, package_label, name):
12701268
if smigration.replaces:
12711269
raise click.ClickException(
12721270
"You cannot squash squashed migrations! Please transition it to a "
1273-
f"normal migration first: https://docs.djangoproject.com/en/{__version__}/"
1274-
"topics/migrations/#squashing-migrations"
1271+
"normal migration first"
12751272
)
12761273
operations.extend(smigration.operations)
12771274
for dependency in smigration.dependencies:

plain-models/plain/models/database_url.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
urlparse.uses_netloc.append(key)
4747

4848

49-
# From https://docs.djangoproject.com/en/4.0/ref/settings/#databases
5049
class DBConfig(TypedDict, total=False):
5150
AUTOCOMMIT: bool
5251
CONN_MAX_AGE: int | None

plain-models/plain/models/db.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from plain.utils.module_loading import import_string
1010

1111
DEFAULT_DB_ALIAS = "default"
12-
PLAIN_VERSION_PICKLE_KEY = "_django_version"
12+
PLAIN_VERSION_PICKLE_KEY = "_plain_version"
1313

1414

1515
class Error(Exception):
@@ -68,7 +68,7 @@ def __enter__(self):
6868
def __exit__(self, exc_type, exc_value, traceback):
6969
if exc_type is None:
7070
return
71-
for dj_exc_type in (
71+
for plain_exc_type in (
7272
DataError,
7373
OperationalError,
7474
IntegrityError,
@@ -79,14 +79,14 @@ def __exit__(self, exc_type, exc_value, traceback):
7979
InterfaceError,
8080
Error,
8181
):
82-
db_exc_type = getattr(self.wrapper.Database, dj_exc_type.__name__)
82+
db_exc_type = getattr(self.wrapper.Database, plain_exc_type.__name__)
8383
if issubclass(exc_type, db_exc_type):
84-
dj_exc_value = dj_exc_type(*exc_value.args)
84+
plain_exc_value = plain_exc_type(*exc_value.args)
8585
# Only set the 'errors_occurred' flag for errors that may make
8686
# the connection unusable.
87-
if dj_exc_type not in (DataError, IntegrityError):
87+
if plain_exc_type not in (DataError, IntegrityError):
8888
self.wrapper.errors_occurred = True
89-
raise dj_exc_value.with_traceback(traceback) from exc_value
89+
raise plain_exc_value.with_traceback(traceback) from exc_value
9090

9191
def __call__(self, func):
9292
# Note that we are intentionally not using @wraps here for performance

plain-models/plain/models/migrations/questioner.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from plain.models.fields import NOT_PROVIDED
77
from plain.packages import packages
8-
from plain.runtime import __version__
98
from plain.utils import timezone
109

1110
from .loader import MigrationLoader
@@ -276,17 +275,13 @@ def ask_auto_now_add_addition(self, field_name, model_name):
276275
def ask_unique_callable_default_addition(self, field_name, model_name):
277276
"""Adding a unique field with a callable default."""
278277
if not self.dry_run:
279-
version = __version__
280278
choice = self._choice_input(
281279
f"Callable default on unique field {model_name}.{field_name} "
282280
f"will not generate unique values upon migrating.\n"
283281
f"Please choose how to proceed:\n",
284282
[
285-
f"Continue making this migration as the first step in "
286-
f"writing a manual migration to generate unique values "
287-
f"described here: "
288-
f"https://docs.djangoproject.com/en/{version}/howto/"
289-
f"writing-migrations/#migrations-that-add-unique-fields.",
283+
"Continue making this migration as the first step in "
284+
"writing a manual migration to generate unique values.",
290285
"Quit and edit field options in models.py.",
291286
],
292287
)

0 commit comments

Comments
 (0)