plain.redirection 0.35.1__tar.gz → 0.35.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/.gitignore +2 -0
  2. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/PKG-INFO +2 -2
  3. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/CHANGELOG.md +21 -0
  4. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/chores.py +4 -4
  5. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/migrations/0001_initial.py +7 -4
  6. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/models.py +4 -4
  7. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/pyproject.toml +2 -2
  8. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/LICENSE +0 -0
  9. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/README.md +0 -0
  10. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/README.md +0 -0
  11. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/__init__.py +0 -0
  12. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/admin.py +0 -0
  13. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/config.py +0 -0
  14. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/default_settings.py +0 -0
  15. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/middleware.py +0 -0
  16. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/migrations/0002_rename_plainredire_created_d5f0c7_idx_plainredirection_notfoundlog_created_at_idx_and_more.py +0 -0
  17. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/migrations/0003_redirectlog_plainredirection_redirectlog_redirect_id_idx.py +0 -0
  18. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/migrations/__init__.py +0 -0
  19. {plain_redirection-0.35.1 → plain_redirection-0.35.3}/plain/redirection/templates/admin/plainredirection/redirect_form.html +0 -0
@@ -18,5 +18,7 @@ plain*/tests/.plain
18
18
 
19
19
  .vscode
20
20
  /.claude/settings.local.json
21
+ /.claude/skills/announcements/
21
22
  /CLAUDE.local.md
22
23
  /.benchmarks
24
+ .claude/worktrees
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.redirection
3
- Version: 0.35.1
3
+ Version: 0.35.3
4
4
  Summary: A flexible URL redirection system with admin interface and logging.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
7
7
  License-File: LICENSE
8
8
  Requires-Python: >=3.13
9
- Requires-Dist: plain-postgres<1.0.0,>=0.91.0
9
+ Requires-Dist: plain-postgres<1.0.0,>=0.96.0
10
10
  Requires-Dist: plain<1.0.0,>=0.123.0
11
11
  Description-Content-Type: text/markdown
12
12
 
@@ -1,5 +1,26 @@
1
1
  # plain-redirection changelog
2
2
 
3
+ ## [0.35.3](https://github.com/dropseed/plain/releases/plain-redirection@0.35.3) (2026-04-17)
4
+
5
+ ### What's changed
6
+
7
+ - Updated `Redirect`, `RedirectLog`, and `NotFoundLog` timestamps to the new `create_now` / `update_now` kwargs for plain-postgres 0.96.0. ([5d145e4](https://github.com/dropseed/plain/commit/5d145e4), [a44e5ec](https://github.com/dropseed/plain/commit/a44e5ec), [091bac7](https://github.com/dropseed/plain/commit/091bac7))
8
+
9
+ ### Upgrade instructions
10
+
11
+ - Requires `plain-postgres>=0.96.0`. Run `plain postgres sync` after upgrading to reconcile column defaults.
12
+
13
+ ## [0.35.2](https://github.com/dropseed/plain/releases/plain-redirection@0.35.2) (2026-04-14)
14
+
15
+ ### What's changed
16
+
17
+ - Updated the `DeleteLogs` chore to the new `QuerySet.delete()` return type (an `int` directly instead of a `(count, by_label)` tuple) from plain-postgres 0.95.0. ([29e10dba51d9](https://github.com/dropseed/plain/commit/29e10dba51d9))
18
+ - Raised `plain.postgres` floor to `>=0.95.0`.
19
+
20
+ ### Upgrade instructions
21
+
22
+ - Requires `plain-postgres>=0.95.0`.
23
+
3
24
  ## [0.35.1](https://github.com/dropseed/plain/releases/plain-redirection@0.35.1) (2026-03-29)
4
25
 
5
26
  ### What's changed
@@ -14,10 +14,10 @@ class DeleteLogs(Chore):
14
14
  def run(self) -> str:
15
15
  cutoff = timezone.now() - settings.REDIRECTION_LOG_RETENTION_TIMEDELTA
16
16
 
17
- result = RedirectLog.query.filter(created_at__lt=cutoff).delete()
18
- output = f"{result[0]} redirect logs deleted"
17
+ redirects = RedirectLog.query.filter(created_at__lt=cutoff).delete()
18
+ output = f"{redirects} redirect logs deleted"
19
19
 
20
- result = NotFoundLog.query.filter(created_at__lt=cutoff).delete()
21
- output += f", {result[0]} not found logs deleted"
20
+ not_founds = NotFoundLog.query.filter(created_at__lt=cutoff).delete()
21
+ output += f", {not_founds} not found logs deleted"
22
22
 
23
23
  return output
@@ -18,8 +18,11 @@ class Migration(migrations.Migration):
18
18
  ("from_pattern", postgres.TextField(max_length=255)),
19
19
  ("to_pattern", postgres.TextField(max_length=255)),
20
20
  ("http_status", postgres.SmallIntegerField(default=301)),
21
- ("created_at", postgres.DateTimeField(auto_now_add=True)),
22
- ("updated_at", postgres.DateTimeField(auto_now=True)),
21
+ ("created_at", postgres.DateTimeField(create_now=True)),
22
+ (
23
+ "updated_at",
24
+ postgres.DateTimeField(create_now=True, update_now=True),
25
+ ),
23
26
  ("order", postgres.SmallIntegerField(default=0)),
24
27
  ("enabled", postgres.BooleanField(default=True)),
25
28
  ("is_regex", postgres.BooleanField(default=False)),
@@ -38,7 +41,7 @@ class Migration(migrations.Migration):
38
41
  ("ip_address", postgres.GenericIPAddressField()),
39
42
  ("user_agent", postgres.TextField(max_length=512, required=False)),
40
43
  ("referrer", postgres.TextField(max_length=512, required=False)),
41
- ("created_at", postgres.DateTimeField(auto_now_add=True)),
44
+ ("created_at", postgres.DateTimeField(create_now=True)),
42
45
  ],
43
46
  options={
44
47
  "ordering": ["-created_at"],
@@ -52,7 +55,7 @@ class Migration(migrations.Migration):
52
55
  ("ip_address", postgres.GenericIPAddressField()),
53
56
  ("user_agent", postgres.TextField(max_length=512, required=False)),
54
57
  ("referrer", postgres.TextField(max_length=512, required=False)),
55
- ("created_at", postgres.DateTimeField(auto_now_add=True)),
58
+ ("created_at", postgres.DateTimeField(create_now=True)),
56
59
  ],
57
60
  options={
58
61
  "ordering": ["-created_at"],
@@ -20,8 +20,8 @@ class Redirect(postgres.Model):
20
20
  http_status: int = types.SmallIntegerField(
21
21
  default=301
22
22
  ) # Default to permanent - could be choices?
23
- created_at: datetime = types.DateTimeField(auto_now_add=True)
24
- updated_at: datetime = types.DateTimeField(auto_now=True)
23
+ created_at: datetime = types.DateTimeField(create_now=True)
24
+ updated_at: datetime = types.DateTimeField(create_now=True, update_now=True)
25
25
  order: int = types.SmallIntegerField(default=0)
26
26
  enabled: bool = types.BooleanField(default=True)
27
27
  is_regex: bool = types.BooleanField(default=False)
@@ -106,7 +106,7 @@ class RedirectLog(postgres.Model):
106
106
  user_agent: str = types.TextField(required=False, max_length=512)
107
107
  referrer: str = types.TextField(required=False, max_length=512)
108
108
 
109
- created_at: datetime = types.DateTimeField(auto_now_add=True)
109
+ created_at: datetime = types.DateTimeField(create_now=True)
110
110
 
111
111
  query: postgres.QuerySet[RedirectLog] = postgres.QuerySet()
112
112
 
@@ -161,7 +161,7 @@ class NotFoundLog(postgres.Model):
161
161
  user_agent: str = types.TextField(required=False, max_length=512)
162
162
  referrer: str = types.TextField(required=False, max_length=512)
163
163
 
164
- created_at: datetime = types.DateTimeField(auto_now_add=True)
164
+ created_at: datetime = types.DateTimeField(create_now=True)
165
165
 
166
166
  query: postgres.QuerySet[NotFoundLog] = postgres.QuerySet()
167
167
 
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "plain.redirection"
3
- version = "0.35.1"
3
+ version = "0.35.3"
4
4
  description = "A flexible URL redirection system with admin interface and logging."
5
5
  authors = [{ name = "Dave Gaeddert", email = "dave.gaeddert@dropseed.dev" }]
6
6
  readme = "README.md"
7
7
  license = "BSD-3-Clause"
8
8
  requires-python = ">=3.13"
9
- dependencies = ["plain>=0.123.0,<1.0.0", "plain.postgres>=0.91.0,<1.0.0"]
9
+ dependencies = ["plain>=0.123.0,<1.0.0", "plain.postgres>=0.96.0,<1.0.0"]
10
10
 
11
11
  [tool.hatch.build.targets.wheel]
12
12
  packages = ["plain"]