fnschool 20251020.82239.858__tar.gz → 20251021.80056.821__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.

Potentially problematic release.


This version of fnschool might be problematic. Click here for more details.

Files changed (116) hide show
  1. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/PKG-INFO +1 -1
  2. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/__init__.py +1 -1
  3. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/views.py +25 -34
  4. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  5. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/static/js/fnschool.js +11 -1
  6. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/PKG-INFO +1 -1
  7. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/LICENSE +0 -0
  8. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/README.md +0 -0
  9. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/pyproject.toml +0 -0
  10. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/setup.cfg +0 -0
  11. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/__init__.py +0 -0
  12. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/admin.py +0 -0
  13. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/apps.py +0 -0
  14. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/forms.py +0 -0
  15. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0001_initial.py +0 -0
  16. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0002_ingredient_is_disabled.py +0 -0
  17. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0003_consumption_is_disabled_alter_ingredient_is_disabled.py +0 -0
  18. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0004_alter_ingredient_name_category_and_more.py +0 -0
  19. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0005_alter_category_created_at_alter_category_name_and_more.py +0 -0
  20. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0006_category_is_disabled_alter_category_user_and_more.py +0 -0
  21. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0007_alter_consumption_amount_used_and_more.py +0 -0
  22. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0008_category_abbreviation_mealtype.py +0 -0
  23. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0009_alter_category_abbreviation_and_more.py +0 -0
  24. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0010_alter_consumption_options_alter_ingredient_options_and_more.py +0 -0
  25. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0011_category_pin_to_consumptions_top.py +0 -0
  26. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0012_alter_ingredient_storage_date.py +0 -0
  27. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0013_alter_consumption_options_alter_ingredient_options_and_more.py +0 -0
  28. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0014_category_priority.py +0 -0
  29. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0015_alter_category_options_alter_category_priority.py +0 -0
  30. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0016_consumption_unique_ingredient_date_of_using.py +0 -0
  31. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/0017_ingredient_updated_at_alter_category_created_at_and_more.py +0 -0
  32. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/migrations/__init__.py +0 -0
  33. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/models.py +0 -0
  34. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/category/create.html +0 -0
  35. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/category/delete.html +0 -0
  36. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/category/list.html +0 -0
  37. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/category/update.html +0 -0
  38. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/close.html +0 -0
  39. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/consumption/_create.html +0 -0
  40. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/consumption/create.html +0 -0
  41. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/ingredient/close.html +0 -0
  42. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/ingredient/create.html +0 -0
  43. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/ingredient/create_one.html +0 -0
  44. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/ingredient/delete.html +0 -0
  45. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/ingredient/list.html +0 -0
  46. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/ingredient/update.html +0 -0
  47. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/meal_type/create.html +0 -0
  48. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/meal_type/delete.html +0 -0
  49. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/meal_type/list.html +0 -0
  50. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/templates/canteen/meal_type/update.html +0 -0
  51. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/tests.py +0 -0
  52. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/urls.py +0 -0
  53. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/workbook/__init__.py +0 -0
  54. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/canteen/workbook/generate.py +0 -0
  55. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/fnschool/__init__.py +0 -0
  56. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/fnschool/_settings.py +0 -0
  57. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/fnschool/asgi.py +0 -0
  58. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/fnschool/settings.py +0 -0
  59. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/fnschool/templatetags/__init__.py +0 -0
  60. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/fnschool/templatetags/fnschool_tags.py +0 -0
  61. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/fnschool/urls.py +0 -0
  62. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/fnschool/views.py +0 -0
  63. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/fnschool/wsgi.py +0 -0
  64. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/locale/en/LC_MESSAGES/django.mo +0 -0
  65. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/manage.py +0 -0
  66. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/__init__.py +0 -0
  67. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/admin.py +0 -0
  68. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/apps.py +0 -0
  69. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/forms.py +0 -0
  70. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/migrations/0001_initial.py +0 -0
  71. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/migrations/0002_alter_profile_bio.py +0 -0
  72. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/migrations/0003_alter_profile_options_alter_profile_address_and_more.py +0 -0
  73. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/migrations/0004_profile_gender.py +0 -0
  74. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/migrations/0005_alter_profile_gender.py +0 -0
  75. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/migrations/__init__.py +0 -0
  76. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/models.py +0 -0
  77. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/signals.py +0 -0
  78. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/templates/profiles/create.html +0 -0
  79. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/templates/profiles/detail.html +0 -0
  80. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/templates/profiles/edit.html +0 -0
  81. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/templates/profiles/log_in.html +0 -0
  82. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/templates/profiles/log_out.html +0 -0
  83. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/tests.py +0 -0
  84. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/urls.py +0 -0
  85. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/profiles/views.py +0 -0
  86. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/static/css/bootstrap.min.css +0 -0
  87. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/static/css/fnschool.css +0 -0
  88. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/static/images/favicon.ico +0 -0
  89. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/static/js/bootstrap.bundle.min.js +0 -0
  90. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/static/js/bootstrap.min.js +0 -0
  91. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/static/js/jquery.min.js +0 -0
  92. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/static/js/jquery.slim.min.js +0 -0
  93. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/static/js/popper.min.js +0 -0
  94. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/base/_content.html +0 -0
  95. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/base/_css.html +0 -0
  96. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/base/_js.html +0 -0
  97. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/base/content.html +0 -0
  98. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/base/header_content_footer.html +0 -0
  99. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/close.html +0 -0
  100. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/home.html +0 -0
  101. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/includes/_footer.html +0 -0
  102. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/includes/_header.html +0 -0
  103. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/includes/_navigation.html +0 -0
  104. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/includes/_paginator.html +0 -0
  105. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/registration/logged_out.html +0 -0
  106. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschoo1/templates/registration/login.html +0 -0
  107. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/SOURCES.txt +0 -0
  108. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/SOURCES.txt.py +0 -0
  109. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/dependency_links.txt +0 -0
  110. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/dependency_links.txt.py +0 -0
  111. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/entry_points.txt +0 -0
  112. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/entry_points.txt.py +0 -0
  113. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/requires.txt +0 -0
  114. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/requires.txt.py +0 -0
  115. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/src/fnschool.egg-info/top_level.txt +0 -0
  116. {fnschool-20251020.82239.858 → fnschool-20251021.80056.821}/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: 20251020.82239.858
3
+ Version: 20251021.80056.821
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__ = "20251020.82239.858"
9
+ __version__ = "20251021.80056.821"
@@ -97,6 +97,9 @@ quantity_header = (
97
97
  "To prevent the number of decimal places in the unit "
98
98
  + 'price from becoming too large, "quantity" is '
99
99
  + "only allowed to be an integer."
100
+ + " If your unit price is a decimal, please use a "
101
+ + "smaller quantity unit and then expand the "
102
+ + "quantity to an integer."
100
103
  ),
101
104
  )
102
105
 
@@ -396,25 +399,26 @@ def edit_ingredient(request, ingredient_id):
396
399
 
397
400
  if request.method == "POST":
398
401
 
399
- form = IngredientForm(request.POST, instance=ingredient)
400
-
401
- total_price = form.instance.total_price
402
- quantity = form.instance.quantity
402
+ total_price = request.POST.get("total_price")
403
+ quantity = request.POST.get("quantity")
403
404
 
404
405
  [total_price0, quantity0], [total_price1, quantity1] = split_price(
405
406
  total_price, quantity
406
407
  )
407
408
 
409
+ form = IngredientForm(request.POST, instance=ingredient)
408
410
  if total_price1:
409
411
  unit_price_error_msg = _(
410
- "The unit pricei ({unit_price}) has more than 3 decimal places and cannot be saved. Please modify it again."
412
+ "The unit pricei ({unit_price}) has more than {decimal_prec} decimal places and cannot be saved. Please modify it again."
411
413
  ).format(
412
414
  unit_price=(
413
415
  Decimal(str(total_price)) / Decimal(str(float(quantity)))
414
- ).normalize()
416
+ ).normalize(),
417
+ decimal_prec=decimal_prec,
415
418
  )
416
419
  form.add_error("total_price", unit_price_error_msg)
417
420
  form.add_error("quantity", unit_price_error_msg)
421
+ form.fields["total_price"].widget.attrs.update({"autofocus": ""})
418
422
  return render(
419
423
  request, "canteen/ingredient/update.html", {"form": form}
420
424
  )
@@ -578,7 +582,7 @@ def create_ingredients(request):
578
582
  created_at=datetime.now().date(),
579
583
  )
580
584
 
581
- storage_date = row[storage_date_header[0]]
585
+ storage_date = date_parser.parse(row[storage_date_header[0]])
582
586
  name = row[ingredient_name_header[0]]
583
587
  quantity_unit_name = row[quantity_unit_name_header[0]]
584
588
  is_ignorable = not row[is_ignorable_header[0]] is np.nan
@@ -591,19 +595,6 @@ def create_ingredients(request):
591
595
  )
592
596
 
593
597
  if total_price1:
594
-
595
- Ingredient.objects.create(
596
- user=request.user,
597
- storage_date=storage_date,
598
- name=name + _("(1)"),
599
- meal_type=meal_type,
600
- category=category,
601
- quantity=quantity0,
602
- total_price=total_price0,
603
- quantity_unit_name=quantity_unit_name,
604
- is_ignorable=is_ignorable,
605
- )
606
-
607
598
  Ingredient.objects.create(
608
599
  user=request.user,
609
600
  storage_date=storage_date,
@@ -615,19 +606,19 @@ def create_ingredients(request):
615
606
  quantity_unit_name=quantity_unit_name,
616
607
  is_ignorable=is_ignorable,
617
608
  )
618
-
619
- else:
620
- Ingredient.objects.create(
621
- user=request.user,
622
- storage_date=storage_date,
623
- name=name,
624
- meal_type=meal_type,
625
- category=category,
626
- quantity=quantity0,
627
- total_price=total_price0,
628
- quantity_unit_name=quantity_unit_name,
629
- is_ignorable=is_ignorable,
630
- )
609
+ name = name + _("(1)")
610
+
611
+ Ingredient.objects.create(
612
+ user=request.user,
613
+ storage_date=storage_date,
614
+ name=name,
615
+ meal_type=meal_type,
616
+ category=category,
617
+ quantity=quantity0,
618
+ total_price=total_price0,
619
+ quantity_unit_name=quantity_unit_name,
620
+ is_ignorable=is_ignorable,
621
+ )
631
622
 
632
623
  return redirect("canteen:close_window")
633
624
 
@@ -674,7 +665,7 @@ def get_template_workbook_of_purchased_ingredients(request):
674
665
  ws.column_dimensions[column_letter].width = len(h) + hans_len + 2
675
666
  if c:
676
667
  h_cell.comment = Comment(c, _("the FNSCHOOL Authors"))
677
-
668
+ ws.freeze_panes = "B2"
678
669
  buffer = io.BytesIO()
679
670
  wb.save(buffer)
680
671
  buffer.seek(0)
@@ -8,7 +8,17 @@ function make_highlight(query, time_data) {
8
8
  if (seconds_diff < 46) {
9
9
  highlight_elements_toggled.push(element)
10
10
  element.toggleClass('fn-highlight')
11
- $('html,body').animate({ scrollTop: element.offset().top }, 1)
11
+ var table_container = $(element.closest('.table-container'))
12
+ if (table_container.length) {
13
+ var container = table_container
14
+ var thead = $(element.closest('table').find('thead'))
15
+ var pos =
16
+ element.offset().top -
17
+ container.offset().top +
18
+ container.scrollTop() -
19
+ thead.height()
20
+ container.animate({ scrollTop: pos }, 1)
21
+ }
12
22
  }
13
23
  })
14
24
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fnschool
3
- Version: 20251020.82239.858
3
+ Version: 20251021.80056.821
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>