fnschool 20251016.81138.855__tar.gz → 20251016.81833.820__tar.gz

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.
Files changed (115) hide show
  1. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/PKG-INFO +1 -1
  2. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/__init__.py +1 -1
  3. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/models.py +1 -0
  4. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/consumption/create.html +28 -5
  5. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/views.py +18 -3
  6. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/workbook/generate.py +24 -10
  7. fnschool-20251016.81833.820/src/fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  8. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/PKG-INFO +1 -1
  9. fnschool-20251016.81138.855/src/fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  10. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/LICENSE +0 -0
  11. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/README.md +0 -0
  12. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/pyproject.toml +0 -0
  13. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/setup.cfg +0 -0
  14. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/__init__.py +0 -0
  15. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/admin.py +0 -0
  16. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/apps.py +0 -0
  17. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/forms.py +0 -0
  18. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0001_initial.py +0 -0
  19. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0002_ingredient_is_disabled.py +0 -0
  20. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0003_consumption_is_disabled_alter_ingredient_is_disabled.py +0 -0
  21. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0004_alter_ingredient_name_category_and_more.py +0 -0
  22. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0005_alter_category_created_at_alter_category_name_and_more.py +0 -0
  23. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0006_category_is_disabled_alter_category_user_and_more.py +0 -0
  24. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0007_alter_consumption_amount_used_and_more.py +0 -0
  25. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0008_category_abbreviation_mealtype.py +0 -0
  26. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0009_alter_category_abbreviation_and_more.py +0 -0
  27. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0010_alter_consumption_options_alter_ingredient_options_and_more.py +0 -0
  28. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0011_category_pin_to_consumptions_top.py +0 -0
  29. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0012_alter_ingredient_storage_date.py +0 -0
  30. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0013_alter_consumption_options_alter_ingredient_options_and_more.py +0 -0
  31. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0014_category_priority.py +0 -0
  32. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0015_alter_category_options_alter_category_priority.py +0 -0
  33. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/0016_consumption_unique_ingredient_date_of_using.py +0 -0
  34. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/migrations/__init__.py +0 -0
  35. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/category/create.html +0 -0
  36. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/category/delete.html +0 -0
  37. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/category/list.html +0 -0
  38. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/category/update.html +0 -0
  39. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/close.html +0 -0
  40. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/consumption/_create.html +0 -0
  41. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/ingredient/close.html +0 -0
  42. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/ingredient/create.html +0 -0
  43. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/ingredient/create_one.html +0 -0
  44. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/ingredient/delete.html +0 -0
  45. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/ingredient/list.html +0 -0
  46. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/ingredient/update.html +0 -0
  47. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/meal_type/create.html +0 -0
  48. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/meal_type/delete.html +0 -0
  49. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/meal_type/list.html +0 -0
  50. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/templates/canteen/meal_type/update.html +0 -0
  51. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/tests.py +0 -0
  52. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/urls.py +0 -0
  53. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/canteen/workbook/__init__.py +0 -0
  54. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/fnschool/__init__.py +0 -0
  55. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/fnschool/asgi.py +0 -0
  56. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/fnschool/settings.py +0 -0
  57. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/fnschool/templatetags/__init__.py +0 -0
  58. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/fnschool/templatetags/fnschool_tags.py +0 -0
  59. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/fnschool/urls.py +0 -0
  60. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/fnschool/views.py +0 -0
  61. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/fnschool/wsgi.py +0 -0
  62. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/locale/en/LC_MESSAGES/django.mo +0 -0
  63. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/manage.py +0 -0
  64. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/__init__.py +0 -0
  65. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/admin.py +0 -0
  66. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/apps.py +0 -0
  67. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/forms.py +0 -0
  68. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/migrations/0001_initial.py +0 -0
  69. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/migrations/0002_alter_profile_bio.py +0 -0
  70. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/migrations/0003_alter_profile_options_alter_profile_address_and_more.py +0 -0
  71. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/migrations/0004_profile_gender.py +0 -0
  72. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/migrations/0005_alter_profile_gender.py +0 -0
  73. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/migrations/__init__.py +0 -0
  74. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/models.py +0 -0
  75. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/signals.py +0 -0
  76. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/templates/profiles/create.html +0 -0
  77. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/templates/profiles/detail.html +0 -0
  78. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/templates/profiles/edit.html +0 -0
  79. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/templates/profiles/log_in.html +0 -0
  80. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/templates/profiles/log_out.html +0 -0
  81. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/tests.py +0 -0
  82. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/urls.py +0 -0
  83. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/profiles/views.py +0 -0
  84. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/static/css/bootstrap.min.css +0 -0
  85. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/static/css/fnschool.css +0 -0
  86. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/static/images/favicon.ico +0 -0
  87. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/static/js/bootstrap.bundle.min.js +0 -0
  88. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/static/js/bootstrap.min.js +0 -0
  89. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/static/js/fnschool.js +0 -0
  90. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/static/js/jquery.min.js +0 -0
  91. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/static/js/jquery.slim.min.js +0 -0
  92. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/static/js/popper.min.js +0 -0
  93. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/base/_content.html +0 -0
  94. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/base/_css.html +0 -0
  95. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/base/_js.html +0 -0
  96. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/base/content.html +0 -0
  97. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/base/header_content_footer.html +0 -0
  98. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/close.html +0 -0
  99. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/home.html +0 -0
  100. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/includes/_footer.html +0 -0
  101. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/includes/_header.html +0 -0
  102. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/includes/_navigation.html +0 -0
  103. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/includes/_paginator.html +0 -0
  104. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/registration/logged_out.html +0 -0
  105. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschoo1/templates/registration/login.html +0 -0
  106. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/SOURCES.txt +0 -0
  107. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/SOURCES.txt.py +0 -0
  108. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/dependency_links.txt +0 -0
  109. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/dependency_links.txt.py +0 -0
  110. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/entry_points.txt +0 -0
  111. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/entry_points.txt.py +0 -0
  112. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/requires.txt +0 -0
  113. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/requires.txt.py +0 -0
  114. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/top_level.txt +0 -0
  115. {fnschool-20251016.81138.855 → fnschool-20251016.81833.820}/src/fnschool.egg-info/top_level.txt.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fnschool
3
- Version: 20251016.81138.855
3
+ Version: 20251016.81833.820
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>
@@ -6,4 +6,4 @@ import random
6
6
  import sys
7
7
  from pathlib import Path
8
8
 
9
- __version__ = "20251016.81138.855"
9
+ __version__ = "20251016.81833.820"
@@ -186,6 +186,7 @@ class Consumption(models.Model):
186
186
  )
187
187
 
188
188
  class Meta:
189
+
189
190
  verbose_name = _("Consumption Record")
190
191
  verbose_name_plural = _("Consumption Records")
191
192
  ordering = ["-date_of_using"]
@@ -49,10 +49,10 @@
49
49
  {% for date_h in date_range %}
50
50
  <th data-date_of_using="{{ date_h }}" class="consumption-date">
51
51
  {{ date_h }}
52
- <br />
53
- |
54
- <br />
55
- |
52
+ {% for meal_type in meal_types %}
53
+ <br />
54
+ |
55
+ {% endfor %}
56
56
  </th>
57
57
  {% empty %}
58
58
  <th></th>
@@ -75,7 +75,7 @@
75
75
  <div class='ingredient-progress'
76
76
  style="width:{% widthratio ingredient.remaining_quantity ingredient.quantity 100 %}%"></div>
77
77
  {{ ingredient.name }}
78
- {% if ingredient.meal_type %}
78
+ {% if ingredient.meal_type != meal_type_name_0 %}
79
79
  <br />
80
80
  ({{ ingredient.meal_type }})
81
81
  {% endif %}
@@ -91,6 +91,9 @@
91
91
  </table>
92
92
  </div>
93
93
  <div class="">
94
+ <button id="body_mp0_trigger"
95
+ onclick="set_body_to_mp0();"
96
+ class="btn btn-submit-consumptions btn-success float-end">||</button>
94
97
  <button onclick="generate_spreadsheet();"
95
98
  class="btn btn-submit-consumptions btn-success float-end">{% trans "Generate Spreadsheet" %}</button>
96
99
  <select class="workbook-month-select form-select float-end mx-2"
@@ -112,6 +115,26 @@
112
115
 
113
116
  var dont_submit = false
114
117
 
118
+ $(document).ready(function() {
119
+ var body_mp0_cookie = get_cookie("body_mp0")
120
+ if (body_mp0_cookie == "" || body_mp0_cookie == null) {
121
+ $("#body_mp0_trigger").html("&lt;")
122
+ } else {
123
+ $("#body_mp0_trigger").html("&gt;")
124
+ }
125
+ });
126
+
127
+ function set_body_to_mp0() {
128
+ if ($('body').hasClass("m-0")) {
129
+ set_simple_cookie("body_mp0", "")
130
+ $("#body_mp0_trigger").html("&gt;")
131
+ $('body').removeClass("m-0 p-0");
132
+ } else {
133
+ set_simple_cookie("body_mp0", "1")
134
+ $('#body_mp0_trigger').html("&lt;")
135
+ $('body').addClass("m-0 p-0");
136
+ }
137
+ }
115
138
 
116
139
  function list_consumptions_rapidly() {
117
140
  query = {
@@ -57,6 +57,9 @@ from .forms import (
57
57
  from .models import Category, Consumption, Ingredient, MealType
58
58
 
59
59
  # Create your views here.
60
+
61
+ meal_type_name_0 = _("Meal type 0")
62
+
60
63
  decimal_prec = getattr(settings, "DECIMAL_PREC", 2)
61
64
 
62
65
  storage_date_header = (
@@ -197,6 +200,15 @@ def create_consumptions(request, ingredient_id=None):
197
200
  consumptions = ingredient.consumptions.filter(
198
201
  Q(is_disabled=False)
199
202
  ).all()
203
+
204
+ consumptions_len = len(consumptions)
205
+ for c_index in range(consumptions_len):
206
+ consumption = consumptions[c_index]
207
+ for c0_index in range(c_index + 1, consumptions_len):
208
+ consumption0 = consumptions[c0_index]
209
+ if consumption.date_of_using == consumption0.date_of_using:
210
+ consumption.delete()
211
+
200
212
  consumption_dates = list(set([c.date_of_using for c in consumptions]))
201
213
 
202
214
  for per_day in date_range:
@@ -206,9 +218,6 @@ def create_consumptions(request, ingredient_id=None):
206
218
  c for c in consumptions if c.date_of_using == per_day
207
219
  ]
208
220
  consumption = consumptions_per_day[0]
209
- if len(consumptions_per_day) > 1:
210
- for c in consumptions_per_day[1:]:
211
- c.delete()
212
221
 
213
222
  else:
214
223
  consumption = Consumption()
@@ -298,6 +307,7 @@ def create_consumptions(request, ingredient_id=None):
298
307
  "ingredient_ids": ingredient_ids,
299
308
  "months": months,
300
309
  "storage_date_start": date_start,
310
+ "meal_type_name_0": meal_type_name_0,
301
311
  },
302
312
  )
303
313
 
@@ -508,6 +518,11 @@ def create_ingredients(request):
508
518
  for index, row in df.iterrows():
509
519
  category_name = row[category_header[0]]
510
520
  meal_type_name = row[meal_type_header[0]]
521
+ meal_type_name = (
522
+ meal_type_name_0
523
+ if meal_type_name is np.nan
524
+ else meal_type_name
525
+ )
511
526
 
512
527
  category = Category.objects.filter(
513
528
  Q(name=category_name) & Q(user=request.user)
@@ -1087,7 +1087,22 @@ class CanteenWorkBook:
1087
1087
  )
1088
1088
  last_category = consumption.ingredient.category
1089
1089
 
1090
- sheet.cell(consumption_row_num, 2, consumption.ingredient.name)
1090
+ ingredient_name_cell = sheet.cell(consumption_row_num, 2)
1091
+ ingredient_name_cell.value = consumption.ingredient.name
1092
+ if consumption.ingredient.name:
1093
+ ingredient_name_cell.comment = Comment(
1094
+ _(
1095
+ "{meal_type}({category}, Storaged/Checked at {storage_date})."
1096
+ ).format(
1097
+ meal_type=consumption.ingredient.meal_type,
1098
+ category=consumption.ingredient.category,
1099
+ storage_date=consumption.ingredient.storage_date.strftime(
1100
+ "%Y.%m.%d"
1101
+ ),
1102
+ ),
1103
+ user.username,
1104
+ )
1105
+
1091
1106
  sheet.cell(
1092
1107
  consumption_row_num,
1093
1108
  3,
@@ -1097,8 +1112,8 @@ class CanteenWorkBook:
1097
1112
  consumption_row_num,
1098
1113
  4,
1099
1114
  (
1100
- consumption.ingredient.quantity
1101
- if consumption.ingredient.quantity
1115
+ consumption.amount_used
1116
+ if consumption.ingredient.name
1102
1117
  else ""
1103
1118
  ),
1104
1119
  )
@@ -1107,7 +1122,7 @@ class CanteenWorkBook:
1107
1122
  5,
1108
1123
  (
1109
1124
  consumption.ingredient.unit_price
1110
- if consumption.ingredient.unit_price
1125
+ if consumption.ingredient.name
1111
1126
  else ""
1112
1127
  ),
1113
1128
  )
@@ -1117,8 +1132,7 @@ class CanteenWorkBook:
1117
1132
  (
1118
1133
  consumption.ingredient.unit_price
1119
1134
  * consumption.amount_used
1120
- if consumption.ingredient.unit_price
1121
- and consumption.amount_used
1135
+ if consumption.ingredient.name
1122
1136
  else ""
1123
1137
  ),
1124
1138
  )
@@ -1946,6 +1960,7 @@ class CanteenWorkBook:
1946
1960
  category_ingredients = []
1947
1961
  for category in categories:
1948
1962
  _ingredients = [i for i in ingredients if i.category == category]
1963
+ _ingredients = sorted(_ingredients, key=lambda i: (i.storage_date))
1949
1964
  split_count = math.ceil(len(_ingredients) / ingredient_rows_count)
1950
1965
  for i in range(0, len(_ingredients), ingredient_rows_count):
1951
1966
  _split_ingredients = _ingredients[i : i + ingredient_rows_count]
@@ -1968,9 +1983,6 @@ class CanteenWorkBook:
1968
1983
  )
1969
1984
  ]
1970
1985
 
1971
- _split_ingredients = sorted(
1972
- _split_ingredients, key=lambda i: (i.storage_date)
1973
- )
1974
1986
  category_ingredients.append([category, _split_ingredients])
1975
1987
 
1976
1988
  for index, (category, c_ingredients) in enumerate(category_ingredients):
@@ -2151,6 +2163,8 @@ class CanteenWorkBook:
2151
2163
 
2152
2164
 
2153
2165
  def get_workbook_zip(request, month):
2166
+ from ..views import meal_type_name_0
2167
+
2154
2168
  meal_types = MealType.objects.annotate(
2155
2169
  ingredients_count=Count("ingredients")
2156
2170
  ).filter(
@@ -2166,7 +2180,7 @@ def get_workbook_zip(request, month):
2166
2180
  ).format(
2167
2181
  meal_type=(
2168
2182
  (meal_type.abbreviation or meal_type.name)
2169
- if meal_type
2183
+ if not meal_type.name == meal_type_name_0
2170
2184
  else ""
2171
2185
  ),
2172
2186
  month=month.replace("-", ""),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fnschool
3
- Version: 20251016.81138.855
3
+ Version: 20251016.81833.820
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>