plain 0.71.0__py3-none-any.whl → 0.72.1__py3-none-any.whl

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.
plain/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # plain changelog
2
2
 
3
+ ## [0.72.1](https://github.com/dropseed/plain/releases/plain@0.72.1) (2025-10-02)
4
+
5
+ ### What's changed
6
+
7
+ - Fixed documentation examples to use the correct view attribute names (`self.user` instead of `self.request.user`) ([f6278d9](https://github.com/dropseed/plain/commit/f6278d9bb4))
8
+
9
+ ### Upgrade instructions
10
+
11
+ - No changes required
12
+
13
+ ## [0.72.0](https://github.com/dropseed/plain/releases/plain@0.72.0) (2025-10-02)
14
+
15
+ ### What's changed
16
+
17
+ - Request attributes `user` and `session` are no longer set directly on the request object ([154ee10](https://github.com/dropseed/plain/commit/154ee10375))
18
+ - Test client now uses `plain.auth.requests.get_request_user()` to retrieve user for response object when available ([154ee10](https://github.com/dropseed/plain/commit/154ee10375))
19
+ - Removed `plain.auth.middleware.AuthenticationMiddleware` from default middleware configuration ([154ee10](https://github.com/dropseed/plain/commit/154ee10375))
20
+
21
+ ### Upgrade instructions
22
+
23
+ - No changes required
24
+
3
25
  ## [0.71.0](https://github.com/dropseed/plain/releases/plain@0.71.0) (2025-09-30)
4
26
 
5
27
  ### What's changed
plain/runtime/README.md CHANGED
@@ -37,7 +37,6 @@ AUTH_LOGIN_URL = "login"
37
37
 
38
38
  MIDDLEWARE = [
39
39
  "plain.sessions.middleware.SessionMiddleware",
40
- "plain.auth.middleware.AuthenticationMiddleware",
41
40
  "plain.admin.AdminMiddleware",
42
41
  ]
43
42
  ```
plain/test/client.py CHANGED
@@ -494,9 +494,13 @@ class Client:
494
494
  response.request = request
495
495
  response.json = partial(self._parse_json, response)
496
496
 
497
- # If the request had a user attached, make it available on the response.
498
- if hasattr(response.wsgi_request, "user"):
499
- response.user = response.wsgi_request.user
497
+ # If the request had a user, make it available on the response.
498
+ try:
499
+ from plain.auth.requests import get_request_user
500
+
501
+ response.user = get_request_user(response.wsgi_request)
502
+ except ImportError:
503
+ pass
500
504
 
501
505
  # Attach the ResolverMatch instance to the response.
502
506
  resolver = get_resolver()
plain/views/README.md CHANGED
@@ -181,7 +181,7 @@ class ExampleDetailView(DetailView):
181
181
  def get_object(self):
182
182
  return MyObjectClass.query.get(
183
183
  id=self.url_kwargs["id"],
184
- user=self.request.user, # Limit access
184
+ user=self.user, # Limit access
185
185
  )
186
186
 
187
187
 
@@ -199,7 +199,7 @@ class ExampleUpdateView(UpdateView):
199
199
  def get_object(self):
200
200
  return MyObjectClass.query.get(
201
201
  id=self.url_kwargs["id"],
202
- user=self.request.user, # Limit access
202
+ user=self.user, # Limit access
203
203
  )
204
204
 
205
205
 
@@ -213,7 +213,7 @@ class ExampleDeleteView(DeleteView):
213
213
  def get_object(self):
214
214
  return MyObjectClass.query.get(
215
215
  id=self.url_kwargs["id"],
216
- user=self.request.user, # Limit access
216
+ user=self.user, # Limit access
217
217
  )
218
218
 
219
219
 
@@ -222,7 +222,7 @@ class ExampleListView(ListView):
222
222
 
223
223
  def get_objects(self):
224
224
  return MyObjectClass.query.filter(
225
- user=self.request.user, # Limit access
225
+ user=self.user, # Limit access
226
226
  )
227
227
  ```
228
228
 
@@ -241,7 +241,7 @@ from plain.http import Response
241
241
 
242
242
  class ExampleView(DetailView):
243
243
  def get_object(self):
244
- if self.request.user.exceeds_rate_limit:
244
+ if self.user and self.user.exceeds_rate_limit:
245
245
  raise ResponseException(
246
246
  Response("Rate limit exceeded", status_code=429)
247
247
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain
3
- Version: 0.71.0
3
+ Version: 0.72.1
4
4
  Summary: A web framework for building products with Python.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-File: LICENSE
@@ -1,5 +1,5 @@
1
1
  plain/AGENTS.md,sha256=As6EFSWWHJ9lYIxb2LMRqNRteH45SRs7a_VFslzF53M,1046
2
- plain/CHANGELOG.md,sha256=JwyNoyCYpzq7iJuIM9DnJVDSAWjdhUKvoHVZFT_tlyQ,21390
2
+ plain/CHANGELOG.md,sha256=pD1_OEbmCUj4xU7Q1Vnq_k5bWp1Y7TdPyz7am9_2OmQ,22376
3
3
  plain/README.md,sha256=5BJyKhf0TDanWVbOQyZ3zsi5Lov9xk-LlJYCDWofM6Y,4078
4
4
  plain/__main__.py,sha256=GK39854Lc_LO_JP8DzY9Y2MIQ4cQEl7SXFJy244-lC8,110
5
5
  plain/debug.py,sha256=C2OnFHtRGMrpCiHSt-P2r58JypgQZ62qzDBpV4mhtFM,855
@@ -97,7 +97,7 @@ plain/preflight/registry.py,sha256=87FvZRsbbbuFJGKJ2PC5-o9aZ1MIKgLPYOTR3ghlzK4,2
97
97
  plain/preflight/results.py,sha256=OtqHUCdq0hNdwNxSLL4CEocNE4mDo2HqFN-XgxYsjLo,1069
98
98
  plain/preflight/security.py,sha256=nMbflO2LN49oKAAaa-tYvuweNB0RWv1z3w9niU037n0,3059
99
99
  plain/preflight/urls.py,sha256=Asw_vq-70NRqr15yuBAYL0JCZ04liumORYT3I3KmF_k,437
100
- plain/runtime/README.md,sha256=sTqXXJkckwqkk9O06XMMSNRokAYjrZBnB50JD36BsYI,4873
100
+ plain/runtime/README.md,sha256=ZZ3NPTjtxwyfw1V827YNwkWc8MiH5rWiy27HrN13qZ8,4819
101
101
  plain/runtime/__init__.py,sha256=dvF5ipRckVf6LQgY4kdxE_dTlCdncuawQf3o5EqLq9k,2524
102
102
  plain/runtime/global_settings.py,sha256=Q-bQP3tNnnuJZvfevGai639RIF_jhd7Dszt-DzTTz68,5509
103
103
  plain/runtime/user_settings.py,sha256=Tbd0J6bxp18tKmFsQcdlxeFhUQU68PYtsswzQ2IcfNc,11467
@@ -118,7 +118,7 @@ plain/templates/jinja/filters.py,sha256=g70cw1jzvYco2v-u4SeceOWBX_qxHI5k9AODMn8e
118
118
  plain/templates/jinja/globals.py,sha256=TXl6uObqis_KXYP-jL3SvwqhATaoc7_hU8_fwpBMXyk,570
119
119
  plain/test/README.md,sha256=tNzaVjma0sgowIrViJguCgVy8A2d8mUKApZO2RxTYyU,1140
120
120
  plain/test/__init__.py,sha256=MhNHtp7MYBl9kq-pMRGY11kJ6kU1I6vOkjNkit1TYRg,94
121
- plain/test/client.py,sha256=ZZ7sz1DsopkZrdjwL4Uv30bbjjbcOfa59PdH0tHTUkQ,29647
121
+ plain/test/client.py,sha256=Gy98gsYXf6emaIC99YRqV9Z3wkJQp4uN0PXZLm1pOMs,29720
122
122
  plain/test/encoding.py,sha256=txj_FCbC4GxH-JCkopW5LaZz8cGsrKQiculjFkjkzuY,3372
123
123
  plain/test/exceptions.py,sha256=Cn4cauBelCiZPnbIXru-zKePXEQn-dit8M4v74C_dTk,492
124
124
  plain/urls/README.md,sha256=026RkCK6I0GdqK3RE2QBLcCLIsiwtyKxgI2F0KBX95E,3882
@@ -153,7 +153,7 @@ plain/utils/text.py,sha256=teav7elbqEtGnhKG3ajf-V9Hb-Gsg8uqDrogqWizqjI,10094
153
153
  plain/utils/timesince.py,sha256=a_-ZoPK_s3Pt998CW4rWp0clZ1XyK2x04hCqak2giII,5928
154
154
  plain/utils/timezone.py,sha256=M_I5yvs9NsHbtNBPJgHErvWw9vatzx4M96tRQs5gS3g,6823
155
155
  plain/utils/tree.py,sha256=rj_JpZ2kVD3UExWoKnsRdVCoRjvzkuVOONcHzREjSyw,4766
156
- plain/views/README.md,sha256=caUSKUhCSs5hdxHC5wIVzKkumPXiuNoOFRnIs3CUHfo,7215
156
+ plain/views/README.md,sha256=6mcoSQp60n8qgoIMNDQr29WThpi-NCj8EMqxPNwWpiE,7189
157
157
  plain/views/__init__.py,sha256=a-N1nkklVohJTtz0yD1MMaS0g66HviEjsKydNVVjvVc,392
158
158
  plain/views/base.py,sha256=fk9zAY5BMVBeM45dWL7A9BMTdUi6eTFMeVDd5kBVdv8,4478
159
159
  plain/views/errors.py,sha256=tHD7MNnZcMyiQ46RMAnX1Ne3Zbbkr1zAiVfJyaaLtSQ,1447
@@ -162,8 +162,8 @@ plain/views/forms.py,sha256=ESZOXuo6IeYixp1RZvPb94KplkowRiwO2eGJCM6zJI0,2400
162
162
  plain/views/objects.py,sha256=5y0PoPPo07dQTTcJ_9kZcx0iI1O7regsooAIK4VqXQ0,5579
163
163
  plain/views/redirect.py,sha256=mIpSAFcaEyeLDyv4Fr6g_ektduG4Wfa6s6L-rkdazmM,2154
164
164
  plain/views/templates.py,sha256=9LgDMCv4C7JzLiyw8jHF-i4350ukwgixC_9y4faEGu0,1885
165
- plain-0.71.0.dist-info/METADATA,sha256=3WUR8T6I0LswhEptl-nLFOjLAFD65q0bVZFCxpBEz0Q,4488
166
- plain-0.71.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
167
- plain-0.71.0.dist-info/entry_points.txt,sha256=wvMzY-iREvfqRgyLm77htPp4j_8CQslLoZA15_AnNo8,171
168
- plain-0.71.0.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
169
- plain-0.71.0.dist-info/RECORD,,
165
+ plain-0.72.1.dist-info/METADATA,sha256=votvdTzOMDYAD0cjpQAsTMGVd3PXX3QSJx76mTxlQ9o,4488
166
+ plain-0.72.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
167
+ plain-0.72.1.dist-info/entry_points.txt,sha256=wvMzY-iREvfqRgyLm77htPp4j_8CQslLoZA15_AnNo8,171
168
+ plain-0.72.1.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
169
+ plain-0.72.1.dist-info/RECORD,,
File without changes