InvenTree/InvenTree/templates
Oliver 9e77b9fc56
Parameter filtering (#4823)
* adds new field 'parameter type' to PartParameterTemplate model

* Move part parameter settings onto their own page

* Add "choices" and "regex" template types

* Adds validation for PartParameter based on template type

* javascript cleanup

* Fix for serializers.py

* Add unit testing for parameter validation

* Add filters

* Rename "type" field to "param_type"

- Should have seen that one coming

* Coerce 'boolean' value to True/False

* table update

* js linting

* Add requirement for "pint" package

* Add validator for physical unit types

- Revert a previous migration which adds "parameter type" and "validator" fields
- These will get implemented later, too much scope creep for this PR
- Add unit test for validation of "units" field

* Update PartParameter model

- Add data_numeric field (will be used later)
- Add MinLengthValidator to data field

* Run validation for part parameter data

- Ensure it can be converted to internal units

* Update admin interface to display partparameter values inline for a part

* Adds validation of part parameter data value

- Also converts to base units, and stores as "numeric" value
- Display "numeric" value in tables
- Create new file conversion.py for data conversion

* Update unit tests and fix some bugs

* Update docstring

* Add units to parameter columns in parameteric part table

* Allow part list to be ordered by a particular parameter value

- Annotate queryset with new "order_by_parameter" method
- Skeleton method for future work

* Bump API version

* Adds unit testing for sorting parts by parameter value

* Update historical data migrations

- Turns out RunPython.noop is a thing?

* Cache the unit registry

- Creating the unit registry takes a significant amount of time
- Construct when first called, and then cache for subsequent hits
- Massive improvement in performance

* Throw error on empty values when converting between units

* Data migration for converting existing part parameter values

* Handle more error cases

* Show parameteric table on top-level part page too

* Unit test for data migration

* Update credits in docs

* Improved error checking

* WIP docs updates

* Fix parameteric table filtering

* remove zoom property

* Fix for import path

* Update parameter docs

* Run background task to rebuild parameters when template changes

* Make "data_numeric" field nullable

- Defaulting to zero is not appropriate, as the actual value may be zero
- Sorting still seems to work just fine

* Fixes for unit test

* More unit test fixes

* Further fixes for unit tests

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2023-05-19 13:24:55 +10:00
..
account Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
allauth_2fa Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
email Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
InvenTree Parameter filtering (#4823) 2023-05-19 13:24:55 +10:00
js Parameter filtering (#4823) 2023-05-19 13:24:55 +10:00
patterns/wizard Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
plugin fix endline 2022-05-20 13:35:07 +02:00
registration Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
sample Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
socialaccount Bug fix for improperly configured SSO provider (#4822) 2023-05-15 15:09:14 +10:00
403_csrf.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
403.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
404.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
500.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
503.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
about.html Link to API documentation in "about" window (#3871) 2022-10-28 18:16:44 +11:00
admin_button.html Builtin plugins (#3889) 2022-11-05 01:05:54 +11:00
attachment_button.html fix endline 2022-05-20 13:35:07 +02:00
attachment_table.html Fix API endpoint permission for the "AttachmentMixin" class (#3218) 2022-06-18 14:48:09 +10:00
barcode_data.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
base.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
clip_link.html Link changes and in-table clipboards (#4697) 2023-05-02 08:13:50 +10:00
clip.html fix endline 2022-05-20 13:35:07 +02:00
currency_data.html Specify order currency (#4698) 2023-04-26 17:35:15 +10:00
filter_list.html Adds ability to partially scrap build outputs (#4846) 2023-05-18 14:04:57 +10:00
hover_image.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
mail.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
modal_csrf.html fix endline 2022-05-20 13:35:07 +02:00
modal_delete_form.html Add a generic DeleteForm and update AjaxDeleteView 2019-05-13 22:46:47 +10:00
modal_form.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
modals.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
navbar.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
notes_buttons.html Support image uploads in the "notes" markdown fields (#4615) 2023-04-19 13:08:26 +10:00
notifications.html Small visual tweaks for notifications tab (#4819) 2023-05-15 12:15:01 +10:00
page_base.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
panel.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
price.html fix endline 2022-05-20 13:35:07 +02:00
project_code_data.html Project code support (#4636) 2023-04-20 00:47:07 +10:00
qr_button.html fix endline 2022-05-20 13:35:07 +02:00
qr_code.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
search_form.html Search button fix 2021-11-15 23:06:15 +11:00
search.html Search refactor (#4505) 2023-03-20 07:21:27 +11:00
sidebar_header.html fix endline 2022-05-20 13:35:07 +02:00
sidebar_item.html fix tags 2022-01-21 02:11:34 +01:00
sidebar_link.html fix tags 2022-01-21 02:11:34 +01:00
sidebar_toggle.html fix tags 2022-01-21 02:11:34 +01:00
skeleton.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
spacer.html fix endline 2022-05-20 13:35:07 +02:00
stats.html fix docs link for "email settings not configured" warning (#3209) 2022-06-17 08:14:40 +10:00
status_codes.html Implement a generic API endpoint for enumeration of status codes (#4543) 2023-03-31 07:27:24 +11:00
stock_table.html Adds ability to partially scrap build outputs (#4846) 2023-05-18 14:04:57 +10:00
tel.html Replace mklint with djlint (#4746) 2023-05-02 20:03:52 +10:00
third_party_js.html Client side QR Codes (#4357) 2023-02-17 13:33:36 +11:00
url.html fix endline 2022-05-20 13:35:07 +02:00
version.html [FR] Add plugin keys, state and version to version info (#3496) 2022-08-08 07:55:55 +10:00
yesnolabel.html fix endline 2022-05-20 13:35:07 +02:00