fnschool 20251013.80821.836__py3-none-any.whl → 20251013.81200.824__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.
Potentially problematic release.
This version of fnschool might be problematic. Click here for more details.
- fnschoo1/__init__.py +2 -2
- fnschoo1/canteen/templates/canteen/consumption/create.html +3 -0
- fnschoo1/canteen/workbook/generate.py +18 -5
- {fnschool-20251013.80821.836.dist-info → fnschool-20251013.81200.824.dist-info}/METADATA +1 -1
- {fnschool-20251013.80821.836.dist-info → fnschool-20251013.81200.824.dist-info}/RECORD +9 -9
- {fnschool-20251013.80821.836.dist-info → fnschool-20251013.81200.824.dist-info}/WHEEL +0 -0
- {fnschool-20251013.80821.836.dist-info → fnschool-20251013.81200.824.dist-info}/entry_points.txt +0 -0
- {fnschool-20251013.80821.836.dist-info → fnschool-20251013.81200.824.dist-info}/licenses/LICENSE +0 -0
- {fnschool-20251013.80821.836.dist-info → fnschool-20251013.81200.824.dist-info}/top_level.txt +0 -0
fnschoo1/__init__.py
CHANGED
|
@@ -6,7 +6,7 @@ import random
|
|
|
6
6
|
import sys
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
|
|
9
|
-
__version__ = "20251013.
|
|
9
|
+
__version__ = "20251013.81200.824"
|
|
10
10
|
|
|
11
11
|
FNSCHOOL_PATH = Path(__file__).parent
|
|
12
12
|
if FNSCHOOL_PATH.as_posix() not in sys.path:
|
|
@@ -46,7 +46,7 @@ def main():
|
|
|
46
46
|
if is_windows:
|
|
47
47
|
os.startfile(local_url)
|
|
48
48
|
else:
|
|
49
|
-
os.system("open " + local_url)
|
|
49
|
+
os.system("sleep 5 && open " + local_url)
|
|
50
50
|
except Exception as e:
|
|
51
51
|
print(e)
|
|
52
52
|
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
<hr>
|
|
9
9
|
<div class="container">
|
|
10
10
|
<div class="row justify-content-end">
|
|
11
|
+
<button class="btn btn-success col-md-1 col-lg-1 col-2"
|
|
12
|
+
onclick="list_consumptions();">{% trans "Refresh" %}</button>
|
|
13
|
+
|
|
11
14
|
<div class="col col-3 col-md-2 col-lg-2">
|
|
12
15
|
<input class=" form-control"
|
|
13
16
|
onkeydown="if(event.keyCode==13){list_consumptions();}"
|
|
@@ -15,7 +15,15 @@ from dateutil.relativedelta import relativedelta
|
|
|
15
15
|
from django.contrib.auth.decorators import login_required
|
|
16
16
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
17
17
|
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
|
|
18
|
-
from django.db.models import
|
|
18
|
+
from django.db.models import (
|
|
19
|
+
Count,
|
|
20
|
+
DecimalField,
|
|
21
|
+
ExpressionWrapper,
|
|
22
|
+
F,
|
|
23
|
+
Q,
|
|
24
|
+
Sum,
|
|
25
|
+
Value,
|
|
26
|
+
)
|
|
19
27
|
from django.db.models.functions import Coalesce
|
|
20
28
|
from django.http import HttpResponse
|
|
21
29
|
from django.shortcuts import get_object_or_404, redirect, render
|
|
@@ -1603,7 +1611,7 @@ class CanteenWorkBook:
|
|
|
1603
1611
|
consumptions += [
|
|
1604
1612
|
c
|
|
1605
1613
|
for c in ingredient.consumptions.filter(
|
|
1606
|
-
Q(is_disabled=False)
|
|
1614
|
+
Q(date_of_using__lte=self.date_end) & Q(is_disabled=False)
|
|
1607
1615
|
).all()
|
|
1608
1616
|
]
|
|
1609
1617
|
|
|
@@ -1617,10 +1625,13 @@ class CanteenWorkBook:
|
|
|
1617
1625
|
inventory_days.append(date_of_using)
|
|
1618
1626
|
else:
|
|
1619
1627
|
inventory_days.append(date_of_using)
|
|
1628
|
+
|
|
1629
|
+
if len(inventory_days) < 1:
|
|
1630
|
+
inventory_days.insert(-1, self.date_end)
|
|
1631
|
+
|
|
1620
1632
|
inventory_days.insert(
|
|
1621
1633
|
0, (self.date_start.replace(day=1) - timedelta(days=1))
|
|
1622
1634
|
)
|
|
1623
|
-
|
|
1624
1635
|
formed_ingredients = []
|
|
1625
1636
|
for inventory_day in inventory_days:
|
|
1626
1637
|
inventory_day_ingredients = []
|
|
@@ -2107,8 +2118,10 @@ class CanteenWorkBook:
|
|
|
2107
2118
|
|
|
2108
2119
|
|
|
2109
2120
|
def get_workbook_zip(request, month):
|
|
2110
|
-
meal_types = MealType.objects.
|
|
2111
|
-
|
|
2121
|
+
meal_types = MealType.objects.annotate(
|
|
2122
|
+
ingredients_count=Count("ingredients")
|
|
2123
|
+
).filter(
|
|
2124
|
+
Q(user=request.user) & Q(is_disabled=False) & Q(ingredients_count__gt=0)
|
|
2112
2125
|
)
|
|
2113
2126
|
|
|
2114
2127
|
zip_buffer = io.BytesIO()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fnschool
|
|
3
|
-
Version: 20251013.
|
|
3
|
+
Version: 20251013.81200.824
|
|
4
4
|
Summary: Just some school related scripts, without any ambition.
|
|
5
5
|
Author-email: larryw3i <larryw3i@163.com>, Larry Wei <larryw3i@126.com>, Larry W3i <larryw3i@yeah.net>
|
|
6
6
|
Maintainer-email: larryw3i <larryw3i@163.com>, Larry Wei <larryw3i@126.com>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
fnschoo1/__init__.py,sha256=
|
|
1
|
+
fnschoo1/__init__.py,sha256=SbSXFTr7zEcgWFHg92chlgThEpDfsUOXtDTKRjyh-Ns,1507
|
|
2
2
|
fnschoo1/manage.py,sha256=pMv0yE2eTcNrgskSHDUdRrnY51iTm1DXg32I8mWDDqw,696
|
|
3
3
|
fnschoo1/canteen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
fnschoo1/canteen/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
|
|
@@ -28,7 +28,7 @@ fnschoo1/canteen/templates/canteen/category/delete.html,sha256=MnPyFzjO3HonOljwx
|
|
|
28
28
|
fnschoo1/canteen/templates/canteen/category/list.html,sha256=aj81uoA-jmdv8mZT-Y9DxjOHVGrSfI1z0DB1YnJWb4w,2045
|
|
29
29
|
fnschoo1/canteen/templates/canteen/category/update.html,sha256=8Nzdbe8UorrJHzElkrdqvLaPnUvcvGhrViZB4D86wqo,815
|
|
30
30
|
fnschoo1/canteen/templates/canteen/consumption/_create.html,sha256=lpST1R0vL1PEI1YE9d0-bcWWpCMH-INjIF-7pweAHuU,1008
|
|
31
|
-
fnschoo1/canteen/templates/canteen/consumption/create.html,sha256=
|
|
31
|
+
fnschoo1/canteen/templates/canteen/consumption/create.html,sha256=KQbx4htFR_KjBJXqVvcZcZFDmRdASD5Hltu7NZF7-g0,14849
|
|
32
32
|
fnschoo1/canteen/templates/canteen/ingredient/close.html,sha256=pLYeJmGaOEJKMUJdZmYzz_n--l28IRDQ4fXvetP_Vsc,200
|
|
33
33
|
fnschoo1/canteen/templates/canteen/ingredient/create.html,sha256=xZvh0tP_cv2HPQ96JSHChO6Ni23tzHc5YJCUhE2yEqM,807
|
|
34
34
|
fnschoo1/canteen/templates/canteen/ingredient/create_one.html,sha256=O8EPSvAnEZ-4VJiwFdoyxJrMOoMpRkH6CyfvWwHaVgc,599
|
|
@@ -40,7 +40,7 @@ fnschoo1/canteen/templates/canteen/meal_type/delete.html,sha256=1UmCyXD-6lbYl-IE
|
|
|
40
40
|
fnschoo1/canteen/templates/canteen/meal_type/list.html,sha256=c5kJUE1OgpRtSrMV4wFwL_gbRSaX_XMM4Zt1JTx34_g,1907
|
|
41
41
|
fnschoo1/canteen/templates/canteen/meal_type/update.html,sha256=Rfv1TamSFIKHzvUNlgnmrPmfmzrehPpuo5Hv8VF0yek,818
|
|
42
42
|
fnschoo1/canteen/workbook/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
43
|
-
fnschoo1/canteen/workbook/generate.py,sha256=
|
|
43
|
+
fnschoo1/canteen/workbook/generate.py,sha256=n6q0s3qoHbKQ-DpaqcJarnTHsomndOb3DtfC66vHprE,83946
|
|
44
44
|
fnschoo1/fnschool/__init__.py,sha256=TmHhzykpKNMoMf6eD-EKvbvmnlzs1XGHtvD55ae1sXs,287
|
|
45
45
|
fnschoo1/fnschool/asgi.py,sha256=kzkqosS10uBlyBX53EXcsATcvEZmac6nsPzyOHCuucE,393
|
|
46
46
|
fnschoo1/fnschool/settings.py,sha256=l9Y1iQCivSfmsNfnHltfXLzxP6gG4VMIL4GEZgAp8YM,4357
|
|
@@ -93,9 +93,9 @@ fnschoo1/templates/includes/_navigation.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
|
|
|
93
93
|
fnschoo1/templates/includes/_paginator.html,sha256=Z-Hxcdmun4SJ1YcHnWTDLfW8wrngROiBTwr4NZWaPP4,1246
|
|
94
94
|
fnschoo1/templates/registration/logged_out.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
95
95
|
fnschoo1/templates/registration/login.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
96
|
-
fnschool-20251013.
|
|
97
|
-
fnschool-20251013.
|
|
98
|
-
fnschool-20251013.
|
|
99
|
-
fnschool-20251013.
|
|
100
|
-
fnschool-20251013.
|
|
101
|
-
fnschool-20251013.
|
|
96
|
+
fnschool-20251013.81200.824.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
|
|
97
|
+
fnschool-20251013.81200.824.dist-info/METADATA,sha256=b-copPlDf-Am6WcOCl1KGXm7KtzvYxL59wSYY5TL9Kk,4752
|
|
98
|
+
fnschool-20251013.81200.824.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
99
|
+
fnschool-20251013.81200.824.dist-info/entry_points.txt,sha256=To2PDA9r0qhE0Wq1-M8hEE8uXxTrTe16BOcpKPT-q5g,47
|
|
100
|
+
fnschool-20251013.81200.824.dist-info/top_level.txt,sha256=s6ZKnNm94Q0-247a50eI7jDK98uPF6P2kC9Ovd3LUlM,9
|
|
101
|
+
fnschool-20251013.81200.824.dist-info/RECORD,,
|
|
File without changes
|
{fnschool-20251013.80821.836.dist-info → fnschool-20251013.81200.824.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{fnschool-20251013.80821.836.dist-info → fnschool-20251013.81200.824.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{fnschool-20251013.80821.836.dist-info → fnschool-20251013.81200.824.dist-info}/top_level.txt
RENAMED
|
File without changes
|