Skip to content

Commit d33bd5f

Browse files
Homepage update
1 parent cedbecb commit d33bd5f

File tree

11 files changed

+652
-58
lines changed

11 files changed

+652
-58
lines changed

backend/components/admin.py

+18
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ class ComponentAdmin(BaseAdmin):
7575
),
7676
},
7777
),
78+
(
79+
"Potentiometer Specific Fields",
80+
{
81+
"classes": ("collapse",),
82+
"fields": (
83+
"pot_taper",
84+
"pot_mounting_type",
85+
"pot_angle_type",
86+
"pot_gangs",
87+
"pot_shaft_type",
88+
"pot_shaft_material",
89+
"pot_split_shaft",
90+
"pot_shaft_diameter",
91+
"pot_shaft_length",
92+
"pot_base_width",
93+
),
94+
},
95+
),
7896
(
7997
"Ratings",
8098
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Generated by Django 5.0 on 2025-02-16 15:03
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("components", "0032_remove_component_unit_price_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="component",
15+
name="pot_angle_type",
16+
field=models.CharField(
17+
blank=True,
18+
choices=[
19+
("Straight", "Straight"),
20+
("Right-Angle", "Right-Angle"),
21+
("Right-Angle-Long", "Right-Angle-Long"),
22+
],
23+
max_length=20,
24+
null=True,
25+
),
26+
),
27+
migrations.AddField(
28+
model_name="component",
29+
name="pot_base_width",
30+
field=models.CharField(
31+
blank=True,
32+
help_text="Potentiometer base width (e.g., '9mm', '16mm', '24mm').",
33+
max_length=10,
34+
null=True,
35+
),
36+
),
37+
migrations.AddField(
38+
model_name="component",
39+
name="pot_gangs",
40+
field=models.PositiveIntegerField(
41+
default=1, help_text="Number of gangs (e.g., Single, Dual)"
42+
),
43+
),
44+
migrations.AddField(
45+
model_name="component",
46+
name="pot_mounting_type",
47+
field=models.CharField(
48+
blank=True,
49+
choices=[
50+
("PCB Mount", "PCB Mount"),
51+
("Panel Mount", "Panel Mount"),
52+
("Solder Lug", "Solder Lug"),
53+
],
54+
max_length=20,
55+
null=True,
56+
),
57+
),
58+
migrations.AddField(
59+
model_name="component",
60+
name="pot_shaft_diameter",
61+
field=models.CharField(
62+
blank=True,
63+
help_text="Shaft diameter (e.g., '6mm' or '1/4in.')",
64+
max_length=10,
65+
null=True,
66+
),
67+
),
68+
migrations.AddField(
69+
model_name="component",
70+
name="pot_shaft_length",
71+
field=models.CharField(
72+
blank=True,
73+
help_text="Shaft length (e.g., '15mm' or '0.75in.')",
74+
max_length=10,
75+
null=True,
76+
),
77+
),
78+
migrations.AddField(
79+
model_name="component",
80+
name="pot_shaft_material",
81+
field=models.CharField(
82+
blank=True,
83+
choices=[("Plastic", "Plastic"), ("Metal", "Metal")],
84+
help_text="Material of the shaft (Plastic or Metal).",
85+
max_length=10,
86+
null=True,
87+
),
88+
),
89+
migrations.AddField(
90+
model_name="component",
91+
name="pot_shaft_type",
92+
field=models.CharField(
93+
blank=True,
94+
choices=[
95+
("Smooth", "Smooth"),
96+
("Knurled", "Knurled"),
97+
("D-Shaft", "D-Shaft"),
98+
],
99+
max_length=20,
100+
null=True,
101+
),
102+
),
103+
migrations.AddField(
104+
model_name="component",
105+
name="pot_split_shaft",
106+
field=models.BooleanField(
107+
default=False,
108+
help_text="Indicates whether the shaft is split (adjustable width).",
109+
),
110+
),
111+
migrations.AddField(
112+
model_name="component",
113+
name="pot_taper",
114+
field=models.CharField(
115+
blank=True,
116+
choices=[
117+
("Linear", "Linear (B)"),
118+
("Logarithmic", "Logarithmic (A)"),
119+
("Reverse Logarithmic", "Reverse Logarithmic (C)"),
120+
("Custom", "Custom (S, W, etc.)"),
121+
],
122+
max_length=25,
123+
null=True,
124+
),
125+
),
126+
]

0 commit comments

Comments
 (0)