fnschool 20251013.80821.836__py3-none-any.whl → 20251013.81257.813__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 CHANGED
@@ -6,7 +6,7 @@ import random
6
6
  import sys
7
7
  from pathlib import Path
8
8
 
9
- __version__ = "20251013.80821.836"
9
+ __version__ = "20251013.81257.813"
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 DecimalField, ExpressionWrapper, F, Q, Sum, Value
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 = []
@@ -1808,9 +1819,10 @@ class CanteenWorkBook:
1808
1819
  ingredient_name_cell.value = ingredient.name
1809
1820
  if ingredient.name:
1810
1821
  ingredient_name_cell.comment = Comment(
1811
- _("{meal_type} ({category})").format(
1822
+ _("{meal_type} ({category}, Checked/Storaged at {storage_date})").format(
1812
1823
  meal_type=ingredient.meal_type,
1813
1824
  category=ingredient.category,
1825
+ storage_date = ingredient.storage_date,
1814
1826
  ),
1815
1827
  user.username,
1816
1828
  )
@@ -2107,8 +2119,10 @@ class CanteenWorkBook:
2107
2119
 
2108
2120
 
2109
2121
  def get_workbook_zip(request, month):
2110
- meal_types = MealType.objects.filter(
2111
- Q(user=request.user) & Q(is_disabled=False)
2122
+ meal_types = MealType.objects.annotate(
2123
+ ingredients_count=Count("ingredients")
2124
+ ).filter(
2125
+ Q(user=request.user) & Q(is_disabled=False) & Q(ingredients_count__gt=0)
2112
2126
  )
2113
2127
 
2114
2128
  zip_buffer = io.BytesIO()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fnschool
3
- Version: 20251013.80821.836
3
+ Version: 20251013.81257.813
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=GeuZo0S1MIWL867jcYL4Zkuw_G1hZSc2SJs9eyxvd_g,1496
1
+ fnschoo1/__init__.py,sha256=54_Eg0ox7ZdmjqsHdjSCxZQVqHYYi0GJVejIvUkak64,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=uqS5rEWdAn3u7L7F4SgpOHK931u60rGMDQAA7IofRlk,14714
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=dSIhK0SKr7w_q7rFgdgjfvD68RRtdkiLW9wk3Z0vzWE,83686
43
+ fnschoo1/canteen/workbook/generate.py,sha256=Wi8zHdPeuu4hqZlwDT5cC_tQspqD8qt8_35aD82W4Qs,84050
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
@@ -50,7 +50,7 @@ fnschoo1/fnschool/wsgi.py,sha256=dQq4S0vZWCz8w5R9KooJeLYTVFXvEgJRYe7NFZwVxU8,393
50
50
  fnschoo1/fnschool/templatetags/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
51
51
  fnschoo1/fnschool/templatetags/fnschool_tags.py,sha256=l5Zov4VlQKpz-69SFftP4kXyMymz-a0D5F_ss_eiFc4,568
52
52
  fnschoo1/locale/en/LC_MESSAGES/django.mo,sha256=M8AB6fmjwlEd761iFlasNWdiEYfE-2nIwBoioGtEVUo,404
53
- fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=P0tb0kB1WEjdQ87eI-sm0GD4l-MI5JKFsKJA1tcNJs8,19747
53
+ fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=ebmNakYKNhf5PvcND8WhIZgm8eS5fO4LklFOLx-t4KQ,19884
54
54
  fnschoo1/profiles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
55
  fnschoo1/profiles/admin.py,sha256=93UCvdODI63KzCDfFFnKmfvCMGCp6FCG9WErE91i79Y,522
56
56
  fnschoo1/profiles/apps.py,sha256=WDu6eceFnDkBFMqquAolMZMo7XPb0ah6l2q2AruTrl4,215
@@ -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.80821.836.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
97
- fnschool-20251013.80821.836.dist-info/METADATA,sha256=Y1gulE_dYuQ74rqKBzcmPOJcrTpFiZyZwY14XsxoXLw,4752
98
- fnschool-20251013.80821.836.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
- fnschool-20251013.80821.836.dist-info/entry_points.txt,sha256=To2PDA9r0qhE0Wq1-M8hEE8uXxTrTe16BOcpKPT-q5g,47
100
- fnschool-20251013.80821.836.dist-info/top_level.txt,sha256=s6ZKnNm94Q0-247a50eI7jDK98uPF6P2kC9Ovd3LUlM,9
101
- fnschool-20251013.80821.836.dist-info/RECORD,,
96
+ fnschool-20251013.81257.813.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
97
+ fnschool-20251013.81257.813.dist-info/METADATA,sha256=FtMBvqV2t-XoXXWBhaJTqhmiPaqH7PdltIwoDiQqvOY,4752
98
+ fnschool-20251013.81257.813.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
+ fnschool-20251013.81257.813.dist-info/entry_points.txt,sha256=To2PDA9r0qhE0Wq1-M8hEE8uXxTrTe16BOcpKPT-q5g,47
100
+ fnschool-20251013.81257.813.dist-info/top_level.txt,sha256=s6ZKnNm94Q0-247a50eI7jDK98uPF6P2kC9Ovd3LUlM,9
101
+ fnschool-20251013.81257.813.dist-info/RECORD,,