fnschool 20251020.82239.858__py3-none-any.whl → 20251021.80058.842__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,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.80058.842"
@@ -0,0 +1,23 @@
1
+ # Generated by Django 4.2.25 on 2025-10-20 16:57
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ (
10
+ "canteen",
11
+ "0017_ingredient_updated_at_alter_category_created_at_and_more",
12
+ ),
13
+ ]
14
+
15
+ operations = [
16
+ migrations.AlterField(
17
+ model_name="ingredient",
18
+ name="updated_at",
19
+ field=models.DateTimeField(
20
+ auto_now=True, null=True, verbose_name="更新时间"
21
+ ),
22
+ ),
23
+ ]
fnschoo1/canteen/views.py CHANGED
@@ -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.80058.842
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=rT-4fDJu76Ag8U4PoXAAd-4nAnLc2YFqPkwnObEVhqc,197
1
+ fnschoo1/__init__.py,sha256=dHNWiDkyBBmwkl32Zcrjb36MLvjsLRju0N81JXzqwI8,197
2
2
  fnschoo1/manage.py,sha256=VZIol9q_Dhg81_KJ9Jfq-L5O8ubQelShkA-cZVJ1S6E,1539
3
3
  fnschoo1/canteen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  fnschoo1/canteen/admin.py,sha256=suMo4x8I3JBxAFBVIdE-5qnqZ6JAZV0FESABHOSc-vg,63
@@ -7,7 +7,7 @@ fnschoo1/canteen/forms.py,sha256=JaN6SX9KIrJeUKRfTMf6bA0Op3mEGCc6xqUE6yWC8TU,259
7
7
  fnschoo1/canteen/models.py,sha256=44GtfJbp6kiQYdcBmSXqHiW6JLLcmiRydf7DC6EToWY,6331
8
8
  fnschoo1/canteen/tests.py,sha256=mrbGGRNg5jwbTJtWWa7zSKdDyeB4vmgZCRc2nk6VY-g,60
9
9
  fnschoo1/canteen/urls.py,sha256=4GtrqC9L59c8zopfjRgqhbcvA5iPnGcAUVuM6CrKWpk,2797
10
- fnschoo1/canteen/views.py,sha256=9qsNiCM4sUEUpV_8g874msSamrp-dqTb5mdUtyWvZmQ,29171
10
+ fnschoo1/canteen/views.py,sha256=4YYacxxa_regc56TqRQ_Bb-_wX3zuFIKyhGGp4QPh7M,28983
11
11
  fnschoo1/canteen/migrations/0001_initial.py,sha256=IHlyfT9sNc-kRQZy7NyjgWzp4EGus405QCAUw4oNdAQ,3943
12
12
  fnschoo1/canteen/migrations/0002_ingredient_is_disabled.py,sha256=j8oGWb2b99YwsEk-uwESLA_JRITEcz6b35ekoYOUGGc,444
13
13
  fnschoo1/canteen/migrations/0003_consumption_is_disabled_alter_ingredient_is_disabled.py,sha256=9RB5SHjINgrrqtDpcVIUXEBa3C_MTcR_keXLGG_PcOs,619
@@ -25,6 +25,7 @@ fnschoo1/canteen/migrations/0014_category_priority.py,sha256=AywjPQhwtwm8xttEEOG
25
25
  fnschoo1/canteen/migrations/0015_alter_category_options_alter_category_priority.py,sha256=l8WVVTaDDbB3-xBMdU402gsQo3mhfeUUEcIp_hYVEPk,720
26
26
  fnschoo1/canteen/migrations/0016_consumption_unique_ingredient_date_of_using.py,sha256=kiNr4ISVoy99U7LuJMItJYtNyE4BPYR_jSdnKoXxWt4,520
27
27
  fnschoo1/canteen/migrations/0017_ingredient_updated_at_alter_category_created_at_and_more.py,sha256=fvbJV9uf8lUrqASwPO2EsyW3ApXkFk4zBE1vlT2UV0o,872
28
+ fnschoo1/canteen/migrations/0018_alter_ingredient_updated_at.py,sha256=yzqmn9dORTvIbcmjOhtyon1eifY0pjExkRMD5UDgzBE,542
28
29
  fnschoo1/canteen/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
30
  fnschoo1/canteen/templates/canteen/close.html,sha256=pLYeJmGaOEJKMUJdZmYzz_n--l28IRDQ4fXvetP_Vsc,200
30
31
  fnschoo1/canteen/templates/canteen/category/create.html,sha256=T33zbHRYUrWlLYSLAYZ14Y03Gw2tGMoYzBWUVv-I8pk,609
@@ -55,7 +56,7 @@ fnschoo1/fnschool/wsgi.py,sha256=dQq4S0vZWCz8w5R9KooJeLYTVFXvEgJRYe7NFZwVxU8,393
55
56
  fnschoo1/fnschool/templatetags/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
56
57
  fnschoo1/fnschool/templatetags/fnschool_tags.py,sha256=l5Zov4VlQKpz-69SFftP4kXyMymz-a0D5F_ss_eiFc4,568
57
58
  fnschoo1/locale/en/LC_MESSAGES/django.mo,sha256=M8AB6fmjwlEd761iFlasNWdiEYfE-2nIwBoioGtEVUo,404
58
- fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=a70R8-JrOVyLEYOxZGLsqn7Q0DzKQkwi09-5p05Dlbc,22621
59
+ fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=FgGcCau9FuxB2G_Q2mjrNGjxhlndLTyyp-6aWarsHQw,23151
59
60
  fnschoo1/profiles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
61
  fnschoo1/profiles/admin.py,sha256=93UCvdODI63KzCDfFFnKmfvCMGCp6FCG9WErE91i79Y,522
61
62
  fnschoo1/profiles/apps.py,sha256=WDu6eceFnDkBFMqquAolMZMo7XPb0ah6l2q2AruTrl4,215
@@ -81,7 +82,7 @@ fnschoo1/static/css/fnschool.css,sha256=k71DBJi4EwUQSOPyXX6G-15m8HN_z4_Ac72Du0Zf
81
82
  fnschoo1/static/images/favicon.ico,sha256=S8Tf0NsUdHnoYO0SEn-sig6YjB0atIpEtSlm7p1HxjY,5014
82
83
  fnschoo1/static/js/bootstrap.bundle.min.js,sha256=6kw84LCFc4QJzifgkle0FsvQrpt2NVRNPNjSSc9caiM,125881
83
84
  fnschoo1/static/js/bootstrap.min.js,sha256=0SHpZTHghUOz_BNedMzuH00z5lgwOSRKP_KI9G5Ogbk,88597
84
- fnschoo1/static/js/fnschool.js,sha256=M2hdpT_g6f77bDLzN3zWxjPybcfrWHRSpo6deNSxkH4,3684
85
+ fnschoo1/static/js/fnschool.js,sha256=O4WdKFHViJVY1Z2SIHaQWuUokajBsciK-IRR8bpUyNg,4022
85
86
  fnschoo1/static/js/jquery.min.js,sha256=np_WnfpAmUmEO_iheFAJKf6mbm0_laW3Ns4x7kjSlt4,162505
86
87
  fnschoo1/static/js/jquery.slim.min.js,sha256=p5YkbOjgHxX3hTadKlGuDW58NvJ1ldjjokDuDQ_5yXs,129962
87
88
  fnschoo1/static/js/popper.min.js,sha256=O2xdmtEow7gq3I7-0lKjshvxHkBe0hTWrMkbX2fy0XQ,36887
@@ -98,14 +99,14 @@ fnschoo1/templates/includes/_navigation.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
98
99
  fnschoo1/templates/includes/_paginator.html,sha256=Q-FRCODFNlETjn2yX18IfhctRWfqEgEnIc5LcdHzKSo,1262
99
100
  fnschoo1/templates/registration/logged_out.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
101
  fnschoo1/templates/registration/login.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
101
- fnschool-20251020.82239.858.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
102
- fnschool-20251020.82239.858.dist-info/METADATA,sha256=_e8pXoy9CHrKNnLPpki1a7kt3BWuBlOO5ZSwhX7HVZo,4752
103
- fnschool-20251020.82239.858.dist-info/SOURCES.txt.py,sha256=2LY2mshgNtxI3ICB-oBjyMYgJk2bQqeGFM5J5ay5TQs,4954
104
- fnschool-20251020.82239.858.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
105
- fnschool-20251020.82239.858.dist-info/dependency_links.txt.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
106
- fnschool-20251020.82239.858.dist-info/entry_points.txt,sha256=Ow5nChVFJY3O4TJAIE1ZydMev1MUtgRsT1b8eFP6728,54
107
- fnschool-20251020.82239.858.dist-info/entry_points.txt.py,sha256=7iOwIx_m9Y6xJt___BZHWJh27LV5hqWnUjmj77MoRys,47
108
- fnschool-20251020.82239.858.dist-info/requires.txt.py,sha256=PqRcHIQSMPUb271hacYrlSDHwB1WDZmlWUkh6RnBz_g,113
109
- fnschool-20251020.82239.858.dist-info/top_level.txt,sha256=s6ZKnNm94Q0-247a50eI7jDK98uPF6P2kC9Ovd3LUlM,9
110
- fnschool-20251020.82239.858.dist-info/top_level.txt.py,sha256=_7CbrSihm0dzBn_tTy2ass_Y2VlkVNT2eylE8mcfwHY,9
111
- fnschool-20251020.82239.858.dist-info/RECORD,,
102
+ fnschool-20251021.80058.842.dist-info/licenses/LICENSE,sha256=2n6rt7r999OuXp8iOqW9we7ORaxWncIbOwN1ILRGR2g,7651
103
+ fnschool-20251021.80058.842.dist-info/METADATA,sha256=mw0snxiR0XlK6FNlfs71jrp42sS-xqZQQqugQIhAfog,4752
104
+ fnschool-20251021.80058.842.dist-info/SOURCES.txt.py,sha256=2LY2mshgNtxI3ICB-oBjyMYgJk2bQqeGFM5J5ay5TQs,4954
105
+ fnschool-20251021.80058.842.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
106
+ fnschool-20251021.80058.842.dist-info/dependency_links.txt.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
107
+ fnschool-20251021.80058.842.dist-info/entry_points.txt,sha256=Ow5nChVFJY3O4TJAIE1ZydMev1MUtgRsT1b8eFP6728,54
108
+ fnschool-20251021.80058.842.dist-info/entry_points.txt.py,sha256=7iOwIx_m9Y6xJt___BZHWJh27LV5hqWnUjmj77MoRys,47
109
+ fnschool-20251021.80058.842.dist-info/requires.txt.py,sha256=PqRcHIQSMPUb271hacYrlSDHwB1WDZmlWUkh6RnBz_g,113
110
+ fnschool-20251021.80058.842.dist-info/top_level.txt,sha256=s6ZKnNm94Q0-247a50eI7jDK98uPF6P2kC9Ovd3LUlM,9
111
+ fnschool-20251021.80058.842.dist-info/top_level.txt.py,sha256=_7CbrSihm0dzBn_tTy2ass_Y2VlkVNT2eylE8mcfwHY,9
112
+ fnschool-20251021.80058.842.dist-info/RECORD,,