plain.redirection 0.35.4__tar.gz → 0.35.6__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 (20) hide show
  1. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/.gitignore +3 -0
  2. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/PKG-INFO +2 -2
  3. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/CHANGELOG.md +20 -0
  4. plain_redirection-0.35.6/plain/redirection/__init__.py +7 -0
  5. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/models.py +21 -22
  6. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/pyproject.toml +2 -2
  7. plain_redirection-0.35.4/plain/redirection/__init__.py +0 -3
  8. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/LICENSE +0 -0
  9. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/README.md +0 -0
  10. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/README.md +0 -0
  11. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/admin.py +0 -0
  12. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/chores.py +0 -0
  13. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/config.py +0 -0
  14. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/default_settings.py +0 -0
  15. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/middleware.py +0 -0
  16. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/migrations/0001_initial.py +0 -0
  17. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/migrations/0002_rename_plainredire_created_d5f0c7_idx_plainredirection_notfoundlog_created_at_idx_and_more.py +0 -0
  18. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/migrations/0003_redirectlog_plainredirection_redirectlog_redirect_id_idx.py +0 -0
  19. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/migrations/__init__.py +0 -0
  20. {plain_redirection-0.35.4 → plain_redirection-0.35.6}/plain/redirection/templates/admin/plainredirection/redirect_form.html +0 -0
@@ -3,7 +3,10 @@
3
3
  *.egg-info
4
4
  *.py[co]
5
5
  __pycache__
6
+ .pytest_cache
6
7
  *.DS_Store
8
+ *.swp
9
+ *.swo
7
10
 
8
11
  /*.code-workspace
9
12
 
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.redirection
3
- Version: 0.35.4
3
+ Version: 0.35.6
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.96.0
9
+ Requires-Dist: plain-postgres<1.0.0,>=0.105.0
10
10
  Requires-Dist: plain<1.0.0,>=0.123.0
11
11
  Description-Content-Type: text/markdown
12
12
 
@@ -1,5 +1,25 @@
1
1
  # plain-redirection changelog
2
2
 
3
+ ## [0.35.6](https://github.com/dropseed/plain/releases/plain-redirection@0.35.6) (2026-05-25)
4
+
5
+ ### What's changed
6
+
7
+ - Internal: model field declarations updated for plain.postgres's new parameterized-descriptor field typing. ([229ecdbbfa](https://github.com/dropseed/plain/commit/229ecdbbfa))
8
+
9
+ ### Upgrade instructions
10
+
11
+ - No changes required.
12
+
13
+ ## [0.35.5](https://github.com/dropseed/plain/releases/plain-redirection@0.35.5) (2026-05-05)
14
+
15
+ ### What's changed
16
+
17
+ - Exposes `__version__` from `importlib.metadata` on `plain.redirection` for version probes that don't want to scrape pip metadata. ([c6cf6edb](https://github.com/dropseed/plain/commit/c6cf6edb))
18
+
19
+ ### Upgrade instructions
20
+
21
+ - No changes required.
22
+
3
23
  ## [0.35.4](https://github.com/dropseed/plain/releases/plain-redirection@0.35.4) (2026-04-30)
4
24
 
5
25
  ### What's changed
@@ -0,0 +1,7 @@
1
+ from importlib.metadata import version
2
+
3
+ __version__ = version("plain.redirection")
4
+
5
+ from .middleware import RedirectionMiddleware
6
+
7
+ __all__ = ["RedirectionMiddleware"]
@@ -1,7 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import re
4
- from datetime import datetime
5
4
  from typing import TYPE_CHECKING
6
5
 
7
6
  from plain import postgres
@@ -15,16 +14,16 @@ __all__ = ["NotFoundLog", "Redirect", "RedirectLog"]
15
14
 
16
15
  @postgres.register_model
17
16
  class Redirect(postgres.Model):
18
- from_pattern: str = types.TextField(max_length=255)
19
- to_pattern: str = types.TextField(max_length=255)
20
- http_status: int = types.SmallIntegerField(
17
+ from_pattern = types.TextField(max_length=255)
18
+ to_pattern = types.TextField(max_length=255)
19
+ http_status = types.SmallIntegerField(
21
20
  default=301
22
21
  ) # Default to permanent - could be choices?
23
- created_at: datetime = types.DateTimeField(create_now=True)
24
- updated_at: datetime = types.DateTimeField(create_now=True, update_now=True)
25
- order: int = types.SmallIntegerField(default=0)
26
- enabled: bool = types.BooleanField(default=True)
27
- is_regex: bool = types.BooleanField(default=False)
22
+ created_at = types.DateTimeField(create_now=True)
23
+ updated_at = types.DateTimeField(create_now=True, update_now=True)
24
+ order = types.SmallIntegerField(default=0)
25
+ enabled = types.BooleanField(default=True)
26
+ is_regex = types.BooleanField(default=False)
28
27
 
29
28
  # query params?
30
29
  # logged in or not? auth not required necessarily...
@@ -94,19 +93,19 @@ class Redirect(postgres.Model):
94
93
 
95
94
  @postgres.register_model
96
95
  class RedirectLog(postgres.Model):
97
- redirect: Redirect = types.ForeignKeyField(Redirect, on_delete=postgres.CASCADE)
96
+ redirect = types.ForeignKeyField(Redirect, on_delete=postgres.CASCADE)
98
97
 
99
98
  # The actuals that were used to redirect
100
- from_url: str = types.URLField(max_length=512)
101
- to_url: str = types.URLField(max_length=512)
102
- http_status: int = types.SmallIntegerField(default=301)
99
+ from_url = types.URLField(max_length=512)
100
+ to_url = types.URLField(max_length=512)
101
+ http_status = types.SmallIntegerField(default=301)
103
102
 
104
103
  # Request metadata
105
- ip_address: str = types.GenericIPAddressField()
106
- user_agent: str = types.TextField(required=False, max_length=512)
107
- referrer: str = types.TextField(required=False, max_length=512)
104
+ ip_address = types.GenericIPAddressField()
105
+ user_agent = types.TextField(required=False, max_length=512)
106
+ referrer = types.TextField(required=False, max_length=512)
108
107
 
109
- created_at: datetime = types.DateTimeField(create_now=True)
108
+ created_at = types.DateTimeField(create_now=True)
110
109
 
111
110
  query: postgres.QuerySet[RedirectLog] = postgres.QuerySet()
112
111
 
@@ -154,14 +153,14 @@ class RedirectLog(postgres.Model):
154
153
 
155
154
  @postgres.register_model
156
155
  class NotFoundLog(postgres.Model):
157
- url: str = types.URLField(max_length=512)
156
+ url = types.URLField(max_length=512)
158
157
 
159
158
  # Request metadata
160
- ip_address: str = types.GenericIPAddressField()
161
- user_agent: str = types.TextField(required=False, max_length=512)
162
- referrer: str = types.TextField(required=False, max_length=512)
159
+ ip_address = types.GenericIPAddressField()
160
+ user_agent = types.TextField(required=False, max_length=512)
161
+ referrer = types.TextField(required=False, max_length=512)
163
162
 
164
- created_at: datetime = types.DateTimeField(create_now=True)
163
+ created_at = types.DateTimeField(create_now=True)
165
164
 
166
165
  query: postgres.QuerySet[NotFoundLog] = postgres.QuerySet()
167
166
 
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "plain.redirection"
3
- version = "0.35.4"
3
+ version = "0.35.6"
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.96.0,<1.0.0"]
9
+ dependencies = ["plain>=0.123.0,<1.0.0", "plain.postgres>=0.105.0,<1.0.0"]
10
10
 
11
11
  [tool.hatch.build.targets.wheel]
12
12
  packages = ["plain"]
@@ -1,3 +0,0 @@
1
- from .middleware import RedirectionMiddleware
2
-
3
- __all__ = ["RedirectionMiddleware"]