sqladmin 0.20.0__py3-none-any.whl → 0.20.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.
- sqladmin/__init__.py +1 -1
- sqladmin/models.py +10 -8
- {sqladmin-0.20.0.dist-info → sqladmin-0.20.1.dist-info}/METADATA +1 -1
- {sqladmin-0.20.0.dist-info → sqladmin-0.20.1.dist-info}/RECORD +6 -6
- {sqladmin-0.20.0.dist-info → sqladmin-0.20.1.dist-info}/WHEEL +0 -0
- {sqladmin-0.20.0.dist-info → sqladmin-0.20.1.dist-info}/licenses/LICENSE.md +0 -0
sqladmin/__init__.py
CHANGED
sqladmin/models.py
CHANGED
|
@@ -403,16 +403,16 @@ class ModelView(BaseView, metaclass=ModelViewMeta):
|
|
|
403
403
|
Normally, objects have three save options:
|
|
404
404
|
``Save`, `Save and continue editing` and `Save and add another`.
|
|
405
405
|
|
|
406
|
-
If save_as is True, `Save and add another` will be replaced
|
|
407
|
-
by a `Save as new` button
|
|
408
|
-
that creates a new object (with a new ID)
|
|
406
|
+
If save_as is True, `Save and add another` will be replaced
|
|
407
|
+
by a `Save as new` button
|
|
408
|
+
that creates a new object (with a new ID)
|
|
409
409
|
rather than updating the existing object.
|
|
410
410
|
|
|
411
411
|
By default, `save_as` is set to `False`.
|
|
412
412
|
"""
|
|
413
413
|
|
|
414
414
|
save_as_continue: ClassVar[bool] = True
|
|
415
|
-
"""When `save_as=True`, the default redirect after saving the new object
|
|
415
|
+
"""When `save_as=True`, the default redirect after saving the new object
|
|
416
416
|
is to the edit view for that object.
|
|
417
417
|
If you set `save_as_continue=False`, the redirect will be to the list view.
|
|
418
418
|
|
|
@@ -1194,14 +1194,16 @@ class ModelView(BaseView, metaclass=ModelViewMeta):
|
|
|
1194
1194
|
) -> StreamingResponse:
|
|
1195
1195
|
async def generate() -> AsyncGenerator[str, None]:
|
|
1196
1196
|
yield "["
|
|
1197
|
-
|
|
1197
|
+
len_data = len(data)
|
|
1198
|
+
last_idx = len_data - 1
|
|
1199
|
+
separator = "," if len_data > 1 else ""
|
|
1198
1200
|
|
|
1199
|
-
for row in data:
|
|
1201
|
+
for idx, row in enumerate(data):
|
|
1200
1202
|
row_dict = {
|
|
1201
|
-
name: await self.get_prop_value(row, name)
|
|
1203
|
+
name: str(await self.get_prop_value(row, name))
|
|
1202
1204
|
for name in self._export_prop_names
|
|
1203
1205
|
}
|
|
1204
|
-
yield json.dumps(row_dict) + separator
|
|
1206
|
+
yield json.dumps(row_dict) + (separator if idx < last_idx else "")
|
|
1205
1207
|
|
|
1206
1208
|
yield "]"
|
|
1207
1209
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sqladmin/__init__.py,sha256=
|
|
1
|
+
sqladmin/__init__.py,sha256=3kjWCBseZv6vxNmMtKgrBicZUgE93ZwOF14aquXK_p0,216
|
|
2
2
|
sqladmin/_menu.py,sha256=V6uKvIJGKrC0kmXq4M-DAgvPoHvgoGgKAw47OjsswGA,2609
|
|
3
3
|
sqladmin/_queries.py,sha256=KqxMABvepoA0j-8Xizg6ASYS-sZDSdm5iFlU74vilQY,9697
|
|
4
4
|
sqladmin/_types.py,sha256=3Zs0aPb14OS-9leahKxxzFopnIOiNftPZwdUmFDBKog,347
|
|
@@ -11,7 +11,7 @@ sqladmin/fields.py,sha256=1CWoVSMr1WkhBJww0-rakx71gRATeIGA6dKgc26z99M,11660
|
|
|
11
11
|
sqladmin/formatters.py,sha256=K06la0mm9-Bs5UA9L6KGJC_X_lV3UHdJ3ENI6j9j2Zg,480
|
|
12
12
|
sqladmin/forms.py,sha256=5VhbRWbsG23eDAGz2c03HnED-titNkBdYzDr-TaBSi0,21541
|
|
13
13
|
sqladmin/helpers.py,sha256=VTPOFbWkiC1My6MYYyVUCAdg7UmnViiYE2ZigiXx628,8615
|
|
14
|
-
sqladmin/models.py,sha256=
|
|
14
|
+
sqladmin/models.py,sha256=Ygm5UetuHdn62n1zU5rukNs3dbjypgNC8NfVte9IIXY,40743
|
|
15
15
|
sqladmin/pagination.py,sha256=zg_bAvqZd2Rf0wKJ7uiVfNV9vR0hrsilmi9Ak0SOG_U,2600
|
|
16
16
|
sqladmin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
sqladmin/templating.py,sha256=o-QMikTrOEgrneLonqCWR3SpAthr-9DoMwOmobM9zq0,2252
|
|
@@ -47,7 +47,7 @@ sqladmin/templates/sqladmin/login.html,sha256=Y_hlcIapfVFPNbSIbCe4Tbj5DLLD46emkS
|
|
|
47
47
|
sqladmin/templates/sqladmin/modals/delete.html,sha256=jTuv6geT-AhK5HTgRmntrJ8CEi98-kwKrVDrzkOQWhw,1092
|
|
48
48
|
sqladmin/templates/sqladmin/modals/details_action_confirmation.html,sha256=mN8LJ5OqypxNLAg2_GYZgQmGeK4E6t7JL5RmOEYuliM,1020
|
|
49
49
|
sqladmin/templates/sqladmin/modals/list_action_confirmation.html,sha256=U52LLNmpLaMuUZSVtGK15oLXsEu6m2S3l9zj9sjN6uM,1078
|
|
50
|
-
sqladmin-0.20.
|
|
51
|
-
sqladmin-0.20.
|
|
52
|
-
sqladmin-0.20.
|
|
53
|
-
sqladmin-0.20.
|
|
50
|
+
sqladmin-0.20.1.dist-info/METADATA,sha256=ypbLpPnHwEMZZov5kKz416eplyFOOBwkp1BhWICYHWM,5270
|
|
51
|
+
sqladmin-0.20.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
52
|
+
sqladmin-0.20.1.dist-info/licenses/LICENSE.md,sha256=4zzpHQMPtND4hzIgJA5qnb4R_wRBWJlYGqNrZolBeP8,1488
|
|
53
|
+
sqladmin-0.20.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|