diff --git a/TODO b/TODO index 3bde066..e0e4394 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,3 @@ -[ ] Add support for UAC Type column in OData Query as well as attachment point inference [ ] Drop 'id' from UI tables, add 'date added / updated' [ ] Adapter Rings should get two attachment points [ ] Add 'on_website' boolean to augmented part diff --git a/alembic/versions/2b3c4d5e6f7a_imported_parts_uac_diameter_range.py b/alembic/versions/2b3c4d5e6f7a_imported_parts_uac_diameter_range.py new file mode 100644 index 0000000..b10081a --- /dev/null +++ b/alembic/versions/2b3c4d5e6f7a_imported_parts_uac_diameter_range.py @@ -0,0 +1,28 @@ +"""imported_parts_uac_diameter_range + +Revision ID: 2b3c4d5e6f7a +Revises: 1c2d3e4f5a6b +Create Date: 2026-09-21 00:00:00.000000 +""" + +from collections.abc import Sequence + +import sqlalchemy as sa + +from alembic import op + +# revision identifiers, used by Alembic. +revision: str = "2b3c4d5e6f7a" +down_revision: str | None = "1c2d3e4f5a6b" +branch_labels: str | Sequence[str] | None = None +depends_on: str | Sequence[str] | None = None + + +def upgrade() -> None: + with op.batch_alter_table("imported_parts", schema=None) as batch_op: + batch_op.add_column(sa.Column("UACDiameterRangemm", sa.String(), nullable=True)) + + +def downgrade() -> None: + with op.batch_alter_table("imported_parts", schema=None) as batch_op: + batch_op.drop_column("UACDiameterRangemm") diff --git a/app/crud/imported_part.py b/app/crud/imported_part.py index 93721e7..9b60300 100644 --- a/app/crud/imported_part.py +++ b/app/crud/imported_part.py @@ -13,6 +13,7 @@ _FIELDS = frozenset( "ProductODmm", "ProductODin", "TBXThreadAttribute", + "UACDiameterRangemm", } ) @@ -26,6 +27,7 @@ SORT_COLUMNS = { "ProductODmm": ImportedPart.ProductODmm, "ProductODin": ImportedPart.ProductODin, "TBXThreadAttribute": ImportedPart.TBXThreadAttribute, + "UACDiameterRangemm": ImportedPart.UACDiameterRangemm, } diff --git a/app/models/imported_part.py b/app/models/imported_part.py index 97cd726..99dc2c8 100644 --- a/app/models/imported_part.py +++ b/app/models/imported_part.py @@ -19,3 +19,4 @@ class ImportedPart(Base): ProductODmm: Mapped[str | None] = mapped_column(nullable=True, default=None) ProductODin: Mapped[str | None] = mapped_column(nullable=True, default=None) TBXThreadAttribute: Mapped[str | None] = mapped_column(nullable=True, default=None) + UACDiameterRangemm: Mapped[str | None] = mapped_column(nullable=True, default=None) diff --git a/app/schemas/imported_part.py b/app/schemas/imported_part.py index 47530d0..2f34cb1 100644 --- a/app/schemas/imported_part.py +++ b/app/schemas/imported_part.py @@ -12,6 +12,7 @@ class ImportedPartRead(BaseModel): ProductODmm: str | None ProductODin: str | None TBXThreadAttribute: str | None + UACDiameterRangemm: str | None class ImportedPartConfigRead(BaseModel): diff --git a/app/templates/admin/_imported_parts_table_card.html b/app/templates/admin/_imported_parts_table_card.html index 3d0c256..3f3f575 100644 --- a/app/templates/admin/_imported_parts_table_card.html +++ b/app/templates/admin/_imported_parts_table_card.html @@ -12,6 +12,7 @@ {{ sort_th("ProductODmm", "OD (mm)", sort_headers) }} {{ sort_th("ProductODin", "OD (in)", sort_headers) }} {{ sort_th("TBXThreadAttribute", "Thread Attribute", sort_headers) }} + {{ sort_th("UACDiameterRangemm", "UAC Diameter Range (mm)", sort_headers) }} @@ -25,9 +26,10 @@ {{ p.ProductODmm or '—' }} {{ p.ProductODin or '—' }} {{ p.TBXThreadAttribute or '—' }} + {{ p.UACDiameterRangemm or '—' }} {% else %} - No imported parts. Use Refresh to sync from OData. + No imported parts. Use Refresh to sync from OData. {% endfor %} diff --git a/app/web/admin.py b/app/web/admin.py index 5020eeb..97a7b91 100644 --- a/app/web/admin.py +++ b/app/web/admin.py @@ -1233,6 +1233,7 @@ _IMPORTED_PARTS_SORT_COLUMNS = [ "ProductODmm", "ProductODin", "TBXThreadAttribute", + "UACDiameterRangemm", ]