plain.admin 0.31.8__py3-none-any.whl → 0.33.0__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.
@@ -0,0 +1,13 @@
1
+ # plain-admin changelog
2
+
3
+ ## [0.33.0](https://github.com/dropseed/plain/releases/plain-admin@0.33.0) (2025-06-23)
4
+
5
+ ### What's changed
6
+
7
+ - The QueryStats browser toolbar now logs a concise summary message in the developer console instead of the full `PerformanceEntry` object, making query-timing information easier to scan ([fcd92a6](https://github.com/dropseed/plain/commit/fcd92a6)).
8
+ - QueryStats middleware now uses `plain.models.db_connection`, aligning with the new single-`DATABASE` configuration and removing the dependency on `DEFAULT_DB_ALIAS` ([d346d81](https://github.com/dropseed/plain/commit/d346d81)).
9
+
10
+ ### Upgrade instructions
11
+
12
+ - No changes required
13
+
@@ -124,49 +124,6 @@ module.exports = {
124
124
 
125
125
  If you aren't using Tailwind, and don't intend to, open an issue to discuss other options.
126
126
 
127
- # plain.requestlog
128
-
129
- The request log stores a local history of HTTP requests and responses during `plain work` (Django runserver).
130
-
131
- The request history will make it easy to see redirects,
132
- 400 and 500 level errors,
133
- form submissions,
134
- API calls,
135
- webhooks,
136
- and more.
137
-
138
- [Watch on YouTube](https://www.youtube.com/watch?v=AwI7Pt5oZnM)
139
-
140
- Requests can be re-submitted by clicking the "replay" button.
141
-
142
- [![Django request log](https://user-images.githubusercontent.com/649496/213781414-417ad043-de67-4836-9ef1-2b91404336c3.png)](https://user-images.githubusercontent.com/649496/213781414-417ad043-de67-4836-9ef1-2b91404336c3.png)
143
-
144
- ## Installation
145
-
146
- ```python
147
- # settings.py
148
- INSTALLED_PACKAGES += [
149
- "plainrequestlog",
150
- ]
151
-
152
- MIDDLEWARE = MIDDLEWARE + [
153
- # ...
154
- "plainrequestlog.RequestLogMiddleware",
155
- ]
156
- ```
157
-
158
- The default settings can be customized if needed:
159
-
160
- ```python
161
- # settings.py
162
- DEV_REQUESTS_IGNORE_PATHS = [
163
- "/sw.js",
164
- "/favicon.ico",
165
- "/admin/jsi18n/",
166
- ]
167
- DEV_REQUESTS_MAX = 50
168
- ```
169
-
170
127
  ## Tailwind CSS
171
128
 
172
129
  This package is styled with [Tailwind CSS](https://tailwindcss.com/),
@@ -3,7 +3,7 @@ import logging
3
3
  import re
4
4
 
5
5
  from plain.json import PlainJSONEncoder
6
- from plain.models import DEFAULT_DB_ALIAS, connections
6
+ from plain.models import db_connection
7
7
  from plain.runtime import settings
8
8
 
9
9
  from .core import QueryStats
@@ -21,7 +21,6 @@ class QueryStatsJSONEncoder(PlainJSONEncoder):
21
21
  try:
22
22
  return super().default(obj)
23
23
  except TypeError:
24
- print(type(obj))
25
24
  if psycopg and isinstance(obj, psycopg.types.json.Json):
26
25
  return obj.obj
27
26
  elif psycopg and isinstance(obj, psycopg.types.json.Jsonb):
@@ -60,11 +59,11 @@ class QueryStatsMiddleware:
60
59
 
61
60
  querystats = QueryStats(include_tracebacks=is_tracking())
62
61
 
63
- with connections[DEFAULT_DB_ALIAS].execute_wrapper(querystats):
62
+ with db_connection.execute_wrapper(querystats):
64
63
  is_admin = self.is_admin_request(request)
65
64
 
66
65
  if settings.DEBUG or is_admin:
67
- with connections[DEFAULT_DB_ALIAS].execute_wrapper(querystats):
66
+ with db_connection.execute_wrapper(querystats):
68
67
  response = self.get_response(request)
69
68
 
70
69
  if settings.DEBUG:
@@ -37,7 +37,7 @@ Search
37
37
  {% for view in searchable_views %}
38
38
  <div
39
39
  hx-get="{{ view.get_view_url() }}?search={{ global_search_query }}&page_size=5"
40
- hx-trigger="plainhtmx:load from:body"
40
+ hx-trigger="load from:body"
41
41
  plain-hx-fragment="list">
42
42
  </div>
43
43
  {% endfor %}
@@ -66,7 +66,8 @@
66
66
  }
67
67
  for (const timing of entry.serverTiming) {
68
68
  if (timing.name === "querystats") {
69
- console.log("Querystats timing", entry)
69
+ // Log a helpful summary instead of the entire entry object
70
+ console.log(`[Querystats] ${timing.description} on ${entry.name}`, entry)
70
71
  timing.url = entry.name; // Store this for reference later
71
72
  for (const existingTiming of querystatsTimings) {
72
73
  if (existingTiming == timing) {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plain.admin
3
- Version: 0.31.8
3
+ Version: 0.33.0
4
4
  Summary: Admin dashboard and tools for Plain.
5
5
  Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
6
  License-Expression: BSD-3-Clause
@@ -1,3 +1,4 @@
1
+ plain/admin/CHANGELOG.md,sha256=lawKWp82rYmngoptI1aA6pUtKR5dgP9ZewkjXiKGQKY,664
1
2
  plain/admin/README.md,sha256=w5N8yhHdMgY2RIf4WUvIXKvBrRTHLy4CV0ROtdK2Jiw,4614
2
3
  plain/admin/__init__.py,sha256=bPv9iftT8aLqBH6dDy-HTVXW66dQUhfIiEZ-LIUMC0Y,78
3
4
  plain/admin/config.py,sha256=TDYmJe4UYmKw4bz0x5s9PkDa-X4V-9JoJlka162-J7M,676
@@ -27,10 +28,10 @@ plain/admin/impersonate/permissions.py,sha256=N0EFshs0pgwFIAsK2MUgfnyhdb2rYheY_l
27
28
  plain/admin/impersonate/settings.py,sha256=4wbWBN9eZIzei4fwkFLfw-_T5pvP_GG4l1lDdVpL_Co,193
28
29
  plain/admin/impersonate/urls.py,sha256=s8bwi8qPueKCCYcLW75p-hPFkBKhm2AMi6AQKQcZsWc,304
29
30
  plain/admin/impersonate/views.py,sha256=PzVmzhlS0LmbHgxdLhc2G27ltvk3zgmO-3QWNAcD-l0,807
30
- plain/admin/querystats/README.md,sha256=ONscu4dQOVe20CPHFyI8vR8iL2kvo3cOM8iwVO-lDyM,4821
31
+ plain/admin/querystats/README.md,sha256=MtogVsRuBU9LLyfG5zBC6TRxoAg-bUm8MbT1Zp0GwBM,3833
31
32
  plain/admin/querystats/__init__.py,sha256=VmP1aQ5Pviq4Z3izCB8G9g0Weq-2SYR88UFNtwqAPpo,81
32
33
  plain/admin/querystats/core.py,sha256=myHdmpUoJyvVHZ4knuJrrtF2TcTdHjqhLXq2Whyi4Qs,4456
33
- plain/admin/querystats/middleware.py,sha256=jGPuQ7YXXys80Px4eBrqHgkBwMBgZr2X0HfFfwvYsOg,3404
34
+ plain/admin/querystats/middleware.py,sha256=Vmja3FzMuOcexkdttVPGdxAFJSUseCOenptKV1IlraU,3327
34
35
  plain/admin/querystats/urls.py,sha256=H8wMpqKBnXqA8ZsdwdxTKQguNYJ0JsMRqqMunccBm2I,198
35
36
  plain/admin/querystats/views.py,sha256=cXmHZtEgRwXNN5d9HsKBe5G_VnDgSNwpwoRaEvuJ7vo,2375
36
37
  plain/admin/templates/admin/base.html,sha256=urUvdcgcZZWjevZSvkagXdcrUe5LYUeaWme7S2gckMU,8509
@@ -39,7 +40,7 @@ plain/admin/templates/admin/detail.html,sha256=AizpXs6HguFzwbk7JDbH8poJB5dM2CaVV
39
40
  plain/admin/templates/admin/index.html,sha256=b65tcZhv9QfvmjePySU7MmzUlpMECIXP8dBH-a3Eyxw,69
40
41
  plain/admin/templates/admin/list.html,sha256=SvZcBTO4vhrCouyVYh0wln3P_6NpLyVsVTvMRQ_295s,8658
41
42
  plain/admin/templates/admin/page.html,sha256=wzRR-JLs8CgCOoB3BMoYWqTMpYM0z4X2qlqdwAe0YjM,67
42
- plain/admin/templates/admin/search.html,sha256=zfwnXoztAFnj8OmwxJcWaqo-SKCy50bLwfwSrAnAtoQ,1799
43
+ plain/admin/templates/admin/search.html,sha256=JLD2FNcG7wTJk5N4Mm3zAU2PALpu3RjRTXJRmNOiogs,1789
43
44
  plain/admin/templates/admin/cards/base.html,sha256=jNw61yM0R40roC8UqGWXFCegObSIV0rbvQ0021gzUi0,913
44
45
  plain/admin/templates/admin/cards/card.html,sha256=f3-7OogoGqKKfUopeWzMLQFPgzsgkMBSImvV1qPb4L4,300
45
46
  plain/admin/templates/admin/cards/chart.html,sha256=boQRaWXiZvwKkMudT3IDsRvaofv5LHgbSeWr_HEGghg,642
@@ -67,7 +68,7 @@ plain/admin/templates/elements/admin/Submit.html,sha256=9HGqeDnAzhDaL3PM7WxS4Xf8
67
68
  plain/admin/templates/elements/admin/Textarea.html,sha256=nCSaGa9t5A5Oj6ZPWW-jSJiGqI1NLPahhXJblq62QME,363
68
69
  plain/admin/templates/elements/admin/TextareaField.html,sha256=K_vgEVIntg0SiMSTqR2c4sQEG0Ktp5wfY0hCCaQNgrA,251
69
70
  plain/admin/templates/querystats/querystats.html,sha256=xJ6fU22aWFQq3wATmRo7vFakmq-x7P6Z3OdZ2aVYmSs,7514
70
- plain/admin/templates/querystats/toolbar.html,sha256=mvERfzU-CdzIBS7aQNosazSeCe9iyDOsswCGFxssdXc,4319
71
+ plain/admin/templates/querystats/toolbar.html,sha256=ba4kNfeDcn6LrIiIetA8Iao9FHySYNyXw28RPDToYTk,4437
71
72
  plain/admin/templates/toolbar/exception.html,sha256=4WcrcBTCuyO_Jket8aaMFEL17o3FN3pF2QLrP7Pr60o,937
72
73
  plain/admin/templates/toolbar/querystats.html,sha256=A_nRAyrVGM94CnQk-jqz9FKFqL0ynVXIykhl8mw_r6I,997
73
74
  plain/admin/templates/toolbar/request.html,sha256=VyxNpEISVYZtGkR4J0XiXkv8d3LticUldJYXGE-OQNg,2967
@@ -79,7 +80,7 @@ plain/admin/views/objects.py,sha256=eKL8A2B1ZMgTrCbTXnh6vCeju_HObxwetn_xc1vYlfY,
79
80
  plain/admin/views/registry.py,sha256=Lxib4YSQCMHb_zACnLKymJakV8jCZPWYll7J8-aV9Xw,3712
80
81
  plain/admin/views/types.py,sha256=ONMMdUoapgMoUVYgSIe-4YCdfvaVMQ4jgPWYiMo0pDk,178
81
82
  plain/admin/views/viewsets.py,sha256=dqMlQ6kLn9iqd9BwBWAZT1S271wH1FdfM5HXbOgBMEw,1655
82
- plain_admin-0.31.8.dist-info/METADATA,sha256=uibT4F7MeLcXAk8gOhX78TayBHv5YI2RavTJzt0LK40,5051
83
- plain_admin-0.31.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
84
- plain_admin-0.31.8.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
85
- plain_admin-0.31.8.dist-info/RECORD,,
83
+ plain_admin-0.33.0.dist-info/METADATA,sha256=R6GMnyUZrAQqWlZgPPDjbN8bH3BVU2COMfbcV7J5PYQ,5051
84
+ plain_admin-0.33.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
85
+ plain_admin-0.33.0.dist-info/licenses/LICENSE,sha256=cvKM3OlqHx3ijD6e34zsSUkPvzl-ya3Dd63A6EHL94U,1500
86
+ plain_admin-0.33.0.dist-info/RECORD,,