django-bom 1.262__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 django-bom might be problematic. Click here for more details.

Files changed (191) hide show
  1. bom/__init__.py +1 -0
  2. bom/admin.py +207 -0
  3. bom/apps.py +8 -0
  4. bom/auth_backends.py +47 -0
  5. bom/base_classes.py +31 -0
  6. bom/constants.py +217 -0
  7. bom/context_processors.py +9 -0
  8. bom/csv_headers.py +252 -0
  9. bom/decorators.py +32 -0
  10. bom/form_fields.py +59 -0
  11. bom/forms.py +1328 -0
  12. bom/helpers.py +367 -0
  13. bom/local_settings.py +35 -0
  14. bom/migrations/0001_initial.py +135 -0
  15. bom/migrations/0002_auto_20180908_2151.py +24 -0
  16. bom/migrations/0003_sellerpart_data_source.py +18 -0
  17. bom/migrations/0004_auto_20180911_0011.py +18 -0
  18. bom/migrations/0005_auto_20181007_1934.py +56 -0
  19. bom/migrations/0006_auto_20181007_1949.py +41 -0
  20. bom/migrations/0007_auto_20181009_0256.py +19 -0
  21. bom/migrations/0008_auto_20181030_0427.py +19 -0
  22. bom/migrations/0009_subpart_reference.py +18 -0
  23. bom/migrations/0010_auto_20181202_0733.py +23 -0
  24. bom/migrations/0011_auto_20181202_2113.py +22 -0
  25. bom/migrations/0012_partchangehistory.py +30 -0
  26. bom/migrations/0013_auto_20190222_1631.py +19 -0
  27. bom/migrations/0014_auto_20190223_2353.py +18 -0
  28. bom/migrations/0015_auto_20190303_1915.py +136 -0
  29. bom/migrations/0016_auto_20190405_2308.py +58 -0
  30. bom/migrations/0017_auto_20190616_1912.py +19 -0
  31. bom/migrations/0018_auto_20190616_2143.py +24 -0
  32. bom/migrations/0019_auto_20190624_1246.py +45 -0
  33. bom/migrations/0020_auto_20190627_0207.py +38 -0
  34. bom/migrations/0021_auto_20190627_0428.py +23 -0
  35. bom/migrations/0022_auto_20190811_2140.py +35 -0
  36. bom/migrations/0023_auto_20191205_2351.py +255 -0
  37. bom/migrations/0024_auto_20191214_1342.py +89 -0
  38. bom/migrations/0025_auto_20191221_1907.py +38 -0
  39. bom/migrations/0026_auto_20191222_2258.py +22 -0
  40. bom/migrations/0027_auto_20191222_2347.py +17 -0
  41. bom/migrations/0028_partrevision_displayable_synopsis.py +74 -0
  42. bom/migrations/0029_auto_20191231_1630.py +23 -0
  43. bom/migrations/0030_auto_20200101_2253.py +22 -0
  44. bom/migrations/0031_auto_20200104_1352.py +38 -0
  45. bom/migrations/0032_auto_20200126_1806.py +27 -0
  46. bom/migrations/0033_auto_20200203_0618.py +29 -0
  47. bom/migrations/0034_auto_20200222_0359.py +30 -0
  48. bom/migrations/0035_auto_20200303_0111.py +34 -0
  49. bom/migrations/0036_auto_20200303_0538.py +17 -0
  50. bom/migrations/0037_auto_20200405_1642.py +44 -0
  51. bom/migrations/0038_auto_20200422_0504.py +19 -0
  52. bom/migrations/0039_auto_20200929_2315.py +41 -0
  53. bom/migrations/0040_alter_organization_currency.py +19 -0
  54. bom/migrations/0041_organization_subscription_quantity.py +18 -0
  55. bom/migrations/0042_auto_20210720_2137.py +23 -0
  56. bom/migrations/0043_auto_20211123_0157.py +24 -0
  57. bom/migrations/0044_auto_20220831_1241.py +23 -0
  58. bom/migrations/0045_sellerpart_link.py +18 -0
  59. bom/migrations/0046_alter_sellerpart_unique_together.py +17 -0
  60. bom/migrations/0047_sellerpart_seller_part_number.py +18 -0
  61. bom/migrations/0048_rename_part_organization_number_class_bom_part_organiz_b333d6_idx_and_more.py +1017 -0
  62. bom/migrations/0049_alter_assembly_id_alter_assemblysubparts_id_and_more.py +99 -0
  63. bom/migrations/0050_alter_organization_options.py +17 -0
  64. bom/migrations/0051_alter_manufacturer_organization_and_more.py +41 -0
  65. bom/migrations/0052_remove_partrevision_attribute_and_more.py +584 -0
  66. bom/migrations/__init__.py +0 -0
  67. bom/models.py +886 -0
  68. bom/part_bom.py +192 -0
  69. bom/settings.py +262 -0
  70. bom/static/bom/css/dashboard.css +17 -0
  71. bom/static/bom/css/jquery.treetable.css +28 -0
  72. bom/static/bom/css/materialize.min.css +13 -0
  73. bom/static/bom/css/part-info.css +15 -0
  74. bom/static/bom/css/style.css +482 -0
  75. bom/static/bom/css/tablesorter-theme.materialize.css +176 -0
  76. bom/static/bom/css/treetable-theme.css +42 -0
  77. bom/static/bom/doc/sample_part_classes.csv +38 -0
  78. bom/static/bom/doc/test_bom.csv +6 -0
  79. bom/static/bom/doc/test_bom_5_intelligent.csv +4 -0
  80. bom/static/bom/doc/test_full_bom.csv +37 -0
  81. bom/static/bom/doc/test_new_parts.csv +5 -0
  82. bom/static/bom/doc/test_new_parts_5_intelligent.csv +5 -0
  83. bom/static/bom/img/_ionicons_svg_md-arrow-dropdown.svg +1 -0
  84. bom/static/bom/img/_ionicons_svg_md-arrow-dropright.svg +1 -0
  85. bom/static/bom/img/favicon.ico +0 -0
  86. bom/static/bom/img/google/web/1x/btn_google_signin_dark_disabled_web.png +0 -0
  87. bom/static/bom/img/google/web/1x/btn_google_signin_dark_focus_web.png +0 -0
  88. bom/static/bom/img/google/web/1x/btn_google_signin_dark_normal_web.png +0 -0
  89. bom/static/bom/img/google/web/1x/btn_google_signin_dark_pressed_web.png +0 -0
  90. bom/static/bom/img/google/web/1x/btn_google_signin_light_disabled_web.png +0 -0
  91. bom/static/bom/img/google/web/1x/btn_google_signin_light_focus_web.png +0 -0
  92. bom/static/bom/img/google/web/1x/btn_google_signin_light_normal_web.png +0 -0
  93. bom/static/bom/img/google/web/1x/btn_google_signin_light_pressed_web.png +0 -0
  94. bom/static/bom/img/google/web/2x/btn_google_signin_dark_disabled_web@2x.png +0 -0
  95. bom/static/bom/img/google/web/2x/btn_google_signin_dark_focus_web@2x.png +0 -0
  96. bom/static/bom/img/google/web/2x/btn_google_signin_dark_normal_web@2x.png +0 -0
  97. bom/static/bom/img/google/web/2x/btn_google_signin_dark_pressed_web@2x.png +0 -0
  98. bom/static/bom/img/google/web/2x/btn_google_signin_light_disabled_web@2x.png +0 -0
  99. bom/static/bom/img/google/web/2x/btn_google_signin_light_focus_web@2x.png +0 -0
  100. bom/static/bom/img/google/web/2x/btn_google_signin_light_normal_web@2x.png +0 -0
  101. bom/static/bom/img/google/web/2x/btn_google_signin_light_pressed_web@2x.png +0 -0
  102. bom/static/bom/img/google/web/vector/btn_google_dark_disabled_ios.eps +814 -0
  103. bom/static/bom/img/google/web/vector/btn_google_dark_disabled_ios.svg +24 -0
  104. bom/static/bom/img/google/web/vector/btn_google_dark_focus_ios.eps +1866 -0
  105. bom/static/bom/img/google/web/vector/btn_google_dark_focus_ios.svg +51 -0
  106. bom/static/bom/img/google/web/vector/btn_google_dark_normal_ios.eps +1031 -0
  107. bom/static/bom/img/google/web/vector/btn_google_dark_normal_ios.svg +50 -0
  108. bom/static/bom/img/google/web/vector/btn_google_dark_pressed_ios.eps +1031 -0
  109. bom/static/bom/img/google/web/vector/btn_google_dark_pressed_ios.svg +50 -0
  110. bom/static/bom/img/google/web/vector/btn_google_light_disabled_ios.eps +814 -0
  111. bom/static/bom/img/google/web/vector/btn_google_light_disabled_ios.svg +24 -0
  112. bom/static/bom/img/google/web/vector/btn_google_light_focus_ios.eps +1837 -0
  113. bom/static/bom/img/google/web/vector/btn_google_light_focus_ios.svg +44 -0
  114. bom/static/bom/img/google/web/vector/btn_google_light_normal_ios.eps +1002 -0
  115. bom/static/bom/img/google/web/vector/btn_google_light_normal_ios.svg +43 -0
  116. bom/static/bom/img/google/web/vector/btn_google_light_pressed_ios.eps +1002 -0
  117. bom/static/bom/img/google/web/vector/btn_google_light_pressed_ios.svg +43 -0
  118. bom/static/bom/img/google_drive_logo.svg +1 -0
  119. bom/static/bom/img/indabom.png +0 -0
  120. bom/static/bom/img/mouser.png +0 -0
  121. bom/static/bom/img/octopart_blue.svg +19 -0
  122. bom/static/bom/js/formset-handler.js +65 -0
  123. bom/static/bom/js/jquery-3.4.1.min.js +2 -0
  124. bom/static/bom/js/jquery.ba-floatingscrollbar.min.js +10 -0
  125. bom/static/bom/js/jquery.treetable.js +629 -0
  126. bom/static/bom/js/materialize.min.js +6 -0
  127. bom/templates/bom/account-delete.html +23 -0
  128. bom/templates/bom/add-manufacturer-part.html +66 -0
  129. bom/templates/bom/add-sellerpart.html +93 -0
  130. bom/templates/bom/base-menu.html +16 -0
  131. bom/templates/bom/base.html +129 -0
  132. bom/templates/bom/bom-action-btn.html +23 -0
  133. bom/templates/bom/bom-action-table.html +57 -0
  134. bom/templates/bom/bom-base-menu.html +6 -0
  135. bom/templates/bom/bom-base.html +24 -0
  136. bom/templates/bom/bom-form-modal.html +36 -0
  137. bom/templates/bom/bom-form.html +30 -0
  138. bom/templates/bom/bom-modal-add-users.html +49 -0
  139. bom/templates/bom/bom-signup.html +12 -0
  140. bom/templates/bom/components/bom-flat.html +131 -0
  141. bom/templates/bom/components/bom-indented.html +237 -0
  142. bom/templates/bom/components/manufacturer-part-list.html +270 -0
  143. bom/templates/bom/components/seller-part-list.html +62 -0
  144. bom/templates/bom/create-part.html +65 -0
  145. bom/templates/bom/dashboard-menu.html +15 -0
  146. bom/templates/bom/dashboard.html +303 -0
  147. bom/templates/bom/edit-manufacturer-part.html +72 -0
  148. bom/templates/bom/edit-part-class.html +120 -0
  149. bom/templates/bom/edit-part.html +67 -0
  150. bom/templates/bom/edit-quantity-of-measure.html +119 -0
  151. bom/templates/bom/edit-user-meta.html +70 -0
  152. bom/templates/bom/help.html +1356 -0
  153. bom/templates/bom/manufacturer-info.html +82 -0
  154. bom/templates/bom/manufacturers.html +97 -0
  155. bom/templates/bom/nothing-to-see.html +15 -0
  156. bom/templates/bom/organization-create.html +135 -0
  157. bom/templates/bom/part-info.html +448 -0
  158. bom/templates/bom/part-revision-display.html +50 -0
  159. bom/templates/bom/part-revision-edit.html +39 -0
  160. bom/templates/bom/part-revision-manage-bom.html +115 -0
  161. bom/templates/bom/part-revision-new.html +57 -0
  162. bom/templates/bom/part-revision-release.html +41 -0
  163. bom/templates/bom/search-help.html +101 -0
  164. bom/templates/bom/seller-info.html +82 -0
  165. bom/templates/bom/sellers.html +97 -0
  166. bom/templates/bom/settings.html +734 -0
  167. bom/templates/bom/signup.html +28 -0
  168. bom/templates/bom/subscription_panel.html +16 -0
  169. bom/templates/bom/table_of_contents.html +47 -0
  170. bom/templates/bom/upload-bom.html +111 -0
  171. bom/templates/bom/upload-parts-help.html +103 -0
  172. bom/templates/bom/upload-parts.html +50 -0
  173. bom/templates/registration/login.html +39 -0
  174. bom/tests.py +1592 -0
  175. bom/third_party_apis/__init__.py +0 -0
  176. bom/third_party_apis/base_api.py +51 -0
  177. bom/third_party_apis/google_drive.py +166 -0
  178. bom/third_party_apis/mouser.py +132 -0
  179. bom/third_party_apis/test_apis.py +24 -0
  180. bom/urls.py +100 -0
  181. bom/utils.py +228 -0
  182. bom/validators.py +23 -0
  183. bom/views/__init__.py +0 -0
  184. bom/views/json_views.py +55 -0
  185. bom/views/views.py +1773 -0
  186. bom/wsgi.py +16 -0
  187. django_bom-1.262.dist-info/METADATA +206 -0
  188. django_bom-1.262.dist-info/RECORD +191 -0
  189. django_bom-1.262.dist-info/WHEEL +5 -0
  190. django_bom-1.262.dist-info/licenses/LICENSE +674 -0
  191. django_bom-1.262.dist-info/top_level.txt +1 -0
@@ -0,0 +1,255 @@
1
+ # Generated by Django 2.2.5 on 2019-12-05 23:46
2
+
3
+ from django.db import migrations, models
4
+ import django.utils.timezone
5
+ import bom
6
+
7
+ def update_part_classes(apps, schema_editor):
8
+ Part = apps.get_model('bom', 'Part')
9
+ PartClass = apps.get_model('bom', 'PartClass')
10
+ Organization = apps.get_model('bom', 'Organization')
11
+
12
+ for o in Organization.objects.all():
13
+ for p in Part.objects.filter(organization=o):
14
+ pc = p.number_class
15
+ new_pc, _ = PartClass.objects.get_or_create(code=pc.code, name=pc.name, comment=pc.comment, organization=o)
16
+ p.number_class = new_pc
17
+ p.save()
18
+
19
+ class Migration(migrations.Migration):
20
+
21
+ dependencies = [
22
+ ('bom', '0022_auto_20190811_2140'),
23
+ ]
24
+
25
+ operations = [
26
+ migrations.AlterModelOptions(
27
+ name='partclass',
28
+ options={'ordering': ['code']},
29
+ ),
30
+ migrations.AlterModelOptions(
31
+ name='partrevision',
32
+ options={'ordering': ['part']},
33
+ ),
34
+ migrations.AddField(
35
+ model_name='organization',
36
+ name='number_item_len',
37
+ field=models.PositiveIntegerField(default=4, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10)]),
38
+ ),
39
+ migrations.AddField(
40
+ model_name='partclass',
41
+ name='organization',
42
+ field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='bom.Organization'),
43
+ preserve_default=False,
44
+ ),
45
+ migrations.AddField(
46
+ model_name='partrevision',
47
+ name='color',
48
+ field=models.CharField(blank=True, default=None, max_length=32, null=True),
49
+ ),
50
+ migrations.AddField(
51
+ model_name='partrevision',
52
+ name='current_rating',
53
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
54
+ ),
55
+ migrations.AddField(
56
+ model_name='partrevision',
57
+ name='current_rating_units',
58
+ field=models.CharField(blank=True, choices=[('', '-----'), ('A', 'A'), ('uA', 'μV'), ('mA', 'mA'), ('kA', 'kA'), ('MA', 'MA'), ('Other', 'Other')], default=None, max_length=2, null=True),
59
+ ),
60
+ migrations.AddField(
61
+ model_name='partrevision',
62
+ name='finish',
63
+ field=models.CharField(blank=True, default=None, max_length=32, null=True),
64
+ ),
65
+ migrations.AddField(
66
+ model_name='partrevision',
67
+ name='frequency',
68
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
69
+ ),
70
+ migrations.AddField(
71
+ model_name='partrevision',
72
+ name='frequency_units',
73
+ field=models.CharField(blank=True, choices=[('', '-----'), ('Hz', 'Hz'), ('kHz', 'kHz'), ('MHz', 'MHz'), ('GHz', 'GHz'), ('Other', 'Other')], default=None, max_length=5, null=True),
74
+ ),
75
+ migrations.AddField(
76
+ model_name='partrevision',
77
+ name='height',
78
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
79
+ ),
80
+ migrations.AddField(
81
+ model_name='partrevision',
82
+ name='height_units',
83
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mil', 'mil'), ('in', 'in'), ('ft', 'ft'), ('yd', 'yd'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('um', 'um'), ('nm', 'nm'), ('Other', 'Other')], default=None, max_length=5, null=True),
84
+ ),
85
+ migrations.AddField(
86
+ model_name='partrevision',
87
+ name='interface',
88
+ field=models.CharField(blank=True, choices=[('', '-----'), ('I2C', 'I2C'), ('SPI', 'SPI'), ('CAN', 'CAN'), ('One-Wire', '1-Wire'), ('RS485', 'RS-485'), ('RS232', 'RS-232'), ('WiFi', 'Wi-Fi'), ('4G', '4G'), ('BT', 'Bluetooth'), ('BTLE', 'Bluetooth LE'), ('Z_Wave', 'Z-Wave'), ('Zigbee', 'Zigbee'), ('LAN', 'LAN'), ('USB', 'USB'), ('HDMI', 'HDMI'), ('Other', 'Other')], default=None, max_length=12, null=True),
89
+ ),
90
+ migrations.AddField(
91
+ model_name='partrevision',
92
+ name='length',
93
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
94
+ ),
95
+ migrations.AddField(
96
+ model_name='partrevision',
97
+ name='length_units',
98
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mil', 'mil'), ('in', 'in'), ('ft', 'ft'), ('yd', 'yd'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('um', 'um'), ('nm', 'nm'), ('Other', 'Other')], default=None, max_length=5, null=True),
99
+ ),
100
+ migrations.AddField(
101
+ model_name='partrevision',
102
+ name='material',
103
+ field=models.CharField(blank=True, default=None, max_length=32, null=True),
104
+ ),
105
+ migrations.AddField(
106
+ model_name='partrevision',
107
+ name='memory',
108
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
109
+ ),
110
+ migrations.AddField(
111
+ model_name='partrevision',
112
+ name='memory_units',
113
+ field=models.CharField(blank=True, choices=[('', '-----'), ('KB', 'KB'), ('MB', 'MB'), ('GB', 'GB'), ('TB', 'TB'), ('Other', 'Other')], default=None, max_length=5, null=True),
114
+ ),
115
+ migrations.AddField(
116
+ model_name='partrevision',
117
+ name='package',
118
+ field=models.CharField(blank=True, choices=[('', '-----'), ('0201 smd', '0201 smd'), ('0402 smd', '0402 smd'), ('0603 smd', '0603 smd'), ('0805 smd', '0805 smd'), ('1206 smd', '1206 smd'), ('1210 smd', '1210 smd'), ('1812 smd', '1812 smd'), ('2010 smd', '2010 smd'), ('2512 smd', '2512 smd'), ('1/8 radial', '1/8 radial'), ('1/4 radial', '1/4 radial'), ('1/2 radial', '1/2 radial'), ('Size A', 'Size A'), ('Size B', 'Size B'), ('Size C', 'Size C'), ('Size D', 'Size D'), ('Size E', 'Size E'), ('SOT-23', 'SOT-23'), ('SOT-223', 'SOT-233'), ('DIL', 'DIL'), ('SOP', 'SOP'), ('SOIC', 'SOIC'), ('QFN', 'QFN'), ('QFP', 'QFP'), ('QFT', 'QFT'), ('PLCCP', 'PLCC'), ('VGA', 'VGA'), ('Other', 'Other')], default=None, max_length=16, null=True),
119
+ ),
120
+ migrations.AddField(
121
+ model_name='partrevision',
122
+ name='pin_count',
123
+ field=models.DecimalField(blank=True, decimal_places=0, default=None, max_digits=3, null=True),
124
+ ),
125
+ migrations.AddField(
126
+ model_name='partrevision',
127
+ name='power_rating',
128
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
129
+ ),
130
+ migrations.AddField(
131
+ model_name='partrevision',
132
+ name='power_rating_units',
133
+ field=models.CharField(blank=True, choices=[('', '-----'), ('W', 'W'), ('uW', 'μW'), ('mW', 'mW'), ('kW', 'kW'), ('MW', 'MW'), ('Other', 'Other')], default=None, max_length=5, null=True),
134
+ ),
135
+ migrations.AddField(
136
+ model_name='partrevision',
137
+ name='supply_voltage',
138
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
139
+ ),
140
+ migrations.AddField(
141
+ model_name='partrevision',
142
+ name='supply_voltage_units',
143
+ field=models.CharField(blank=True, choices=[('', '-----'), ('V', 'V'), ('uV', 'μV'), ('mV', 'mV'), ('kV', 'kV'), ('MV', 'MV'), ('Other', 'Other')], default=None, max_length=5, null=True),
144
+ ),
145
+ migrations.AddField(
146
+ model_name='partrevision',
147
+ name='temperature_rating',
148
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
149
+ ),
150
+ migrations.AddField(
151
+ model_name='partrevision',
152
+ name='temperature_rating_units',
153
+ field=models.CharField(blank=True, choices=[('', '-----'), ('C', '°C'), ('F', '°F'), ('Other', 'Other')], default=None, max_length=5, null=True),
154
+ ),
155
+ migrations.AddField(
156
+ model_name='partrevision',
157
+ name='tolerance',
158
+ field=models.CharField(blank=True, default=None, max_length=6, null=True, validators=[bom.validators.validate_pct]),
159
+ ),
160
+ migrations.AddField(
161
+ model_name='partrevision',
162
+ name='value_units',
163
+ field=models.CharField(blank=True, choices=[('', '-----'), ('Ohms', 'Ω'), ('mOhms', 'mΩ'), ('kOhms', 'kΩ'), ('F', 'F'), ('pF', 'pF'), ('nF', 'nF'), ('uF', 'μF'), ('V', 'V'), ('uV', 'μV'), ('mV', 'mV'), ('A', 'A'), ('uA', 'μA'), ('mA', 'mA'), ('C', '°C'), ('F', '°F'), ('Other', 'Other')], default=None, max_length=5, null=True),
164
+ ),
165
+ migrations.AddField(
166
+ model_name='partrevision',
167
+ name='voltage_rating',
168
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
169
+ ),
170
+ migrations.AddField(
171
+ model_name='partrevision',
172
+ name='voltage_rating_units',
173
+ field=models.CharField(blank=True, choices=[('', '-----'), ('V', 'V'), ('uV', 'μV'), ('mV', 'mV'), ('kV', 'kV'), ('MV', 'MV'), ('Other', 'Other')], default=None, max_length=2, null=True),
174
+ ),
175
+ migrations.AddField(
176
+ model_name='partrevision',
177
+ name='wavelength',
178
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
179
+ ),
180
+ migrations.AddField(
181
+ model_name='partrevision',
182
+ name='wavelength_units',
183
+ field=models.CharField(blank=True, choices=[('', '-----'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('um', 'μm'), ('nm', 'nm'), ('A', 'A'), ('Other', 'Other')], default=None, max_length=5, null=True),
184
+ ),
185
+ migrations.AddField(
186
+ model_name='partrevision',
187
+ name='weight',
188
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
189
+ ),
190
+ migrations.AddField(
191
+ model_name='partrevision',
192
+ name='weight_units',
193
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mg', 'mg'), ('g', 'g'), ('kg', 'kg'), ('oz', 'oz'), ('lb', 'lb'), ('Other', 'Other')], default=None, max_length=5, null=True),
194
+ ),
195
+ migrations.AddField(
196
+ model_name='partrevision',
197
+ name='width',
198
+ field=models.DecimalField(blank=True, decimal_places=3, default=None, max_digits=7, null=True),
199
+ ),
200
+ migrations.AddField(
201
+ model_name='partrevision',
202
+ name='width_units',
203
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mil', 'mil'), ('in', 'in'), ('ft', 'ft'), ('yd', 'yd'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('um', 'um'), ('nm', 'nm'), ('Other', 'Other')], default=None, max_length=5, null=True),
204
+ ),
205
+ migrations.AddField(
206
+ model_name='subpart',
207
+ name='do_not_load',
208
+ field=models.BooleanField(default=False, verbose_name='Do Not Load'),
209
+ ),
210
+ migrations.AlterField(
211
+ model_name='part',
212
+ name='number_item',
213
+ field=models.CharField(blank=True, default=None, max_length=10, validators=[django.core.validators.RegexValidator('^[0-9]*$', 'Only numeric characters are allowed.')]),
214
+ ),
215
+ migrations.AlterField(
216
+ model_name='partclass',
217
+ name='code',
218
+ field=models.CharField(max_length=3),
219
+ ),
220
+ migrations.AlterField(
221
+ model_name='partrevision',
222
+ name='description',
223
+ field=models.CharField(blank=True, default='', max_length=255, null=True),
224
+ ),
225
+ migrations.AlterField(
226
+ model_name='partrevision',
227
+ name='revision',
228
+ field=models.CharField(db_index=True, default='1', max_length=4),
229
+ ),
230
+ migrations.AlterField(
231
+ model_name='sellerpart',
232
+ name='lead_time_days',
233
+ field=models.PositiveIntegerField(blank=True, null=True),
234
+ ),
235
+ migrations.AlterField(
236
+ model_name='sellerpart',
237
+ name='minimum_order_quantity',
238
+ field=models.PositiveIntegerField(default=1),
239
+ ),
240
+ migrations.AlterField(
241
+ model_name='sellerpart',
242
+ name='minimum_pack_quantity',
243
+ field=models.PositiveIntegerField(default=1),
244
+ ),
245
+ migrations.AlterField(
246
+ model_name='subpart',
247
+ name='count',
248
+ field=models.PositiveIntegerField(default=1),
249
+ ),
250
+ migrations.AlterUniqueTogether(
251
+ name='partclass',
252
+ unique_together={('code', 'name', 'organization')},
253
+ ),
254
+ migrations.RunPython(update_part_classes)
255
+ ]
@@ -0,0 +1,89 @@
1
+ # Generated by Django 2.2.7 on 2019-12-14 13:42
2
+
3
+ from django.db import migrations, models
4
+ from bom.utils import strip_trailing_zeros
5
+ import django.utils.timezone
6
+
7
+
8
+ def synopsis(pr, make_searchable=False):
9
+ self = pr
10
+ def verbosify(val, units=None, pre=None, pre_whitespace=True, post=None, post_whitespace=True):
11
+ elaborated = ""
12
+
13
+ if val is not None and val != '':
14
+ try:
15
+ elaborated = strip_trailing_zeros(str(val))
16
+ if units is not None and units != '': elaborated += units
17
+ if pre is not None and pre != '':
18
+ elaborated = pre + (' ' if pre_whitespace else '') + elaborated
19
+ if post is not None and post != '': elaborated += (' ' if post_whitespace else '') + post
20
+ elaborated = elaborated + ' '
21
+ except ValueError:
22
+ pass
23
+ return elaborated
24
+
25
+ s = ""
26
+ s += verbosify(self.value, units=self.value_units if make_searchable else self.get_value_units_display())
27
+ s += verbosify(self.description)
28
+ tolerance = self.tolerance.replace('%', '') if self.tolerance else ''
29
+ s += verbosify(tolerance, post='%', post_whitespace=False)
30
+ s += verbosify(self.attribute)
31
+ s += verbosify(self.package if make_searchable else self.get_package_display())
32
+ s += verbosify(self.pin_count, post='pins')
33
+ s += verbosify(self.frequency, units=self.frequency_units if make_searchable else self.get_frequency_units_display())
34
+ s += verbosify(self.wavelength, units=self.wavelength_units if make_searchable else self.get_wavelength_units_display())
35
+ s += verbosify(self.memory, units=self.memory_units if make_searchable else self.get_memory_units_display())
36
+ s += verbosify(self.interface if make_searchable else self.get_interface_display())
37
+ s += verbosify(self.supply_voltage, units=self.supply_voltage_units if make_searchable else self.get_supply_voltage_units_display(), post='supply')
38
+ s += verbosify(self.temperature_rating, units=self.temperature_rating_units if make_searchable else self.get_temperature_rating_units_display(), post='rating')
39
+ s += verbosify(self.power_rating, units=self.power_rating_units if make_searchable else self.get_power_rating_units_display(), post='rating')
40
+ s += verbosify(self.voltage_rating, units=self.voltage_rating_units if make_searchable else self.get_voltage_rating_units_display(), post='rating')
41
+ s += verbosify(self.current_rating, units=self.current_rating_units if make_searchable else self.get_current_rating_units_display(), post='rating')
42
+ s += verbosify(self.material)
43
+ s += verbosify(self.color)
44
+ s += verbosify(self.finish)
45
+ s += verbosify(self.length, units=self.length_units if make_searchable else self.get_length_units_display(), pre='L')
46
+ s += verbosify(self.width, units=self.width_units if make_searchable else self.get_width_units_display(), pre='W')
47
+ s += verbosify(self.height, units=self.height_units if make_searchable else self.get_height_units_display(), pre='H')
48
+ s += verbosify(self.weight, units=self.weight_units if make_searchable else self.get_weight_units_display())
49
+ return s
50
+
51
+ def update_part_revisions(apps, schema_editor):
52
+ PartRevision = apps.get_model('bom', 'PartRevision')
53
+ for pr in PartRevision.objects.all():
54
+ try:
55
+ pr.searchable_synopsis = synopsis(pr, True)
56
+ pr.save()
57
+ except ValueError:
58
+ pr.searchable_synopsis = pr.description
59
+ pr.save()
60
+ pass
61
+
62
+
63
+ class Migration(migrations.Migration):
64
+ dependencies = [
65
+ ('bom', '0023_auto_20191205_2351'),
66
+ ]
67
+
68
+ operations = [
69
+ migrations.AddField(
70
+ model_name='partrevision',
71
+ name='searchable_synopsis',
72
+ field=models.TextField(blank=True, default='', null=True),
73
+ ),
74
+ migrations.AlterField(
75
+ model_name='organization',
76
+ name='number_item_len',
77
+ field=models.PositiveIntegerField(default=3, validators=[django.core.validators.MinValueValidator(3), django.core.validators.MaxValueValidator(10)]),
78
+ ),
79
+ migrations.AlterField(
80
+ model_name='partrevision',
81
+ name='package',
82
+ field=models.CharField(blank=True, choices=[('', '-----'), ('0201 smd', '0201 smd'), ('0402 smd', '0402 smd'), ('0603 smd', '0603 smd'), ('0805 smd', '0805 smd'), ('1206 smd', '1206 smd'),
83
+ ('1210 smd', '1210 smd'), ('1812 smd', '1812 smd'), ('2010 smd', '2010 smd'), ('2512 smd', '2512 smd'), ('1/8 radial', '1/8 radial'),
84
+ ('1/4 radial', '1/4 radial'), ('1/2 radial', '1/2 radial'), ('Size A', 'Size A'), ('Size B', 'Size B'), ('Size C', 'Size C'),
85
+ ('Size D', 'Size D'), ('Size E', 'Size E'), ('SOT-23', 'SOT-23'), ('SOT-223', 'SOT-233'), ('DIL', 'DIL'), ('SOP', 'SOP'), ('SOIC', 'SOIC'),
86
+ ('QFN', 'QFN'), ('QFP', 'QFP'), ('QFT', 'QFT'), ('PLCC', 'PLCC'), ('VGA', 'VGA'), ('Other', 'Other')], default=None, max_length=16, null=True),
87
+ ),
88
+ migrations.RunPython(update_part_revisions),
89
+ ]
@@ -0,0 +1,38 @@
1
+ # Generated by Django 2.2.9 on 2019-12-21 19:07
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('bom', '0024_auto_20191214_1342'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name='partrevision',
15
+ name='height_units',
16
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mil', 'mil'), ('in', 'in'), ('ft', 'ft'), ('yd', 'yd'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('um', 'μm'), ('nm', 'nm'), ('Other', 'Other')], default=None, max_length=5, null=True),
17
+ ),
18
+ migrations.AlterField(
19
+ model_name='partrevision',
20
+ name='length_units',
21
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mil', 'mil'), ('in', 'in'), ('ft', 'ft'), ('yd', 'yd'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('um', 'μm'), ('nm', 'nm'), ('Other', 'Other')], default=None, max_length=5, null=True),
22
+ ),
23
+ migrations.AlterField(
24
+ model_name='partrevision',
25
+ name='searchable_synopsis',
26
+ field=models.TextField(blank=True, default='', editable=False, null=True),
27
+ ),
28
+ migrations.AlterField(
29
+ model_name='partrevision',
30
+ name='wavelength_units',
31
+ field=models.CharField(blank=True, choices=[('', '-----'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('um', 'μm'), ('nm', 'nm'), ('A', 'Å'), ('Other', 'Other')], default=None, max_length=5, null=True),
32
+ ),
33
+ migrations.AlterField(
34
+ model_name='partrevision',
35
+ name='width_units',
36
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mil', 'mil'), ('in', 'in'), ('ft', 'ft'), ('yd', 'yd'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('um', 'μm'), ('nm', 'nm'), ('Other', 'Other')], default=None, max_length=5, null=True),
37
+ ),
38
+ ]
@@ -0,0 +1,22 @@
1
+ # Generated by Django 2.2.9 on 2019-12-22 22:58
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('bom', '0025_auto_20191221_1907'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name='partrevision',
15
+ name='searchable_synopsis',
16
+ field=models.CharField(blank=True, db_index=True, default='', editable=False, max_length=255, null=True),
17
+ ),
18
+ migrations.AlterIndexTogether(
19
+ name='part',
20
+ index_together={('organization', 'number_class')},
21
+ ),
22
+ ]
@@ -0,0 +1,17 @@
1
+ # Generated by Django 2.2.9 on 2019-12-22 23:47
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('bom', '0026_auto_20191222_2258'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterIndexTogether(
14
+ name='partclass',
15
+ index_together={('organization', 'code')},
16
+ ),
17
+ ]
@@ -0,0 +1,74 @@
1
+ # Generated by Django 2.2.8 on 2019-12-23 18:00
2
+
3
+ from django.db import migrations, models
4
+ from bom.utils import strip_trailing_zeros
5
+
6
+
7
+ def synopsis(pr, make_searchable=False):
8
+ self = pr
9
+
10
+ def verbosify(val, units=None, pre=None, pre_whitespace=True, post=None, post_whitespace=True):
11
+ elaborated = ""
12
+ if val is not None and val != '':
13
+ try:
14
+ elaborated = strip_trailing_zeros(str(val))
15
+ if units is not None and units != '': elaborated += units
16
+ if pre is not None and pre != '':
17
+ elaborated = pre + (' ' if pre_whitespace else '') + elaborated
18
+ if post is not None and post != '': elaborated += (' ' if post_whitespace else '') + post
19
+ elaborated = elaborated + ' '
20
+ except ValueError:
21
+ pass
22
+ return elaborated
23
+ s = ""
24
+ s += verbosify(self.value, units=self.value_units if make_searchable else self.get_value_units_display())
25
+ s += verbosify(self.description)
26
+ tolerance = self.tolerance.replace('%', '') if self.tolerance else ''
27
+ s += verbosify(tolerance, post='%', post_whitespace=False)
28
+ s += verbosify(self.attribute)
29
+ s += verbosify(self.package if make_searchable else self.get_package_display())
30
+ s += verbosify(self.pin_count, post='pins')
31
+ s += verbosify(self.frequency, units=self.frequency_units if make_searchable else self.get_frequency_units_display())
32
+ s += verbosify(self.wavelength, units=self.wavelength_units if make_searchable else self.get_wavelength_units_display())
33
+ s += verbosify(self.memory, units=self.memory_units if make_searchable else self.get_memory_units_display())
34
+ s += verbosify(self.interface if make_searchable else self.get_interface_display())
35
+ s += verbosify(self.supply_voltage, units=self.supply_voltage_units if make_searchable else self.get_supply_voltage_units_display(), post='supply')
36
+ s += verbosify(self.temperature_rating, units=self.temperature_rating_units if make_searchable else self.get_temperature_rating_units_display(), post='rating')
37
+ s += verbosify(self.power_rating, units=self.power_rating_units if make_searchable else self.get_power_rating_units_display(), post='rating')
38
+ s += verbosify(self.voltage_rating, units=self.voltage_rating_units if make_searchable else self.get_voltage_rating_units_display(), post='rating')
39
+ s += verbosify(self.current_rating, units=self.current_rating_units if make_searchable else self.get_current_rating_units_display(), post='rating')
40
+ s += verbosify(self.material)
41
+ s += verbosify(self.color)
42
+ s += verbosify(self.finish)
43
+ s += verbosify(self.length, units=self.length_units if make_searchable else self.get_length_units_display(), pre='L')
44
+ s += verbosify(self.width, units=self.width_units if make_searchable else self.get_width_units_display(), pre='W')
45
+ s += verbosify(self.height, units=self.height_units if make_searchable else self.get_height_units_display(), pre='H')
46
+ s += verbosify(self.weight, units=self.weight_units if make_searchable else self.get_weight_units_display())
47
+ return s
48
+
49
+
50
+ def update_part_revisions(apps, schema_editor):
51
+ PartRevision = apps.get_model('bom', 'PartRevision')
52
+ for pr in PartRevision.objects.all():
53
+ try:
54
+ pr.displayable_synopsis = synopsis(pr, False)
55
+ pr.save()
56
+ except ValueError:
57
+ pr.displayable_synopsis = pr.description
58
+ pr.save()
59
+ pass
60
+
61
+
62
+ class Migration(migrations.Migration):
63
+ dependencies = [
64
+ ('bom', '0027_auto_20191222_2347'),
65
+ ]
66
+
67
+ operations = [
68
+ migrations.AddField(
69
+ model_name='partrevision',
70
+ name='displayable_synopsis',
71
+ field=models.CharField(blank=True, db_index=True, default='', editable=False, max_length=255, null=True),
72
+ ),
73
+ migrations.RunPython(update_part_revisions),
74
+ ]
@@ -0,0 +1,23 @@
1
+ # Generated by Django 2.2.9 on 2019-12-31 16:30
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('bom', '0028_partrevision_displayable_synopsis'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name='partrevision',
15
+ name='current_rating_units',
16
+ field=models.CharField(blank=True, choices=[('', '-----'), ('A', 'A'), ('uA', 'μV'), ('mA', 'mA'), ('kA', 'kA'), ('MA', 'MA'), ('Other', 'Other')], default=None, max_length=5, null=True),
17
+ ),
18
+ migrations.AlterField(
19
+ model_name='partrevision',
20
+ name='voltage_rating_units',
21
+ field=models.CharField(blank=True, choices=[('', '-----'), ('V', 'V'), ('uV', 'μV'), ('mV', 'mV'), ('kV', 'kV'), ('MV', 'MV'), ('Other', 'Other')], default=None, max_length=5, null=True),
22
+ ),
23
+ ]
@@ -0,0 +1,22 @@
1
+ # Generated by Django 2.2.9 on 2020-01-01 22:53
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('bom', '0029_auto_20191231_1630'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AddField(
14
+ model_name='manufacturerpart',
15
+ name='source_mouser',
16
+ field=models.BooleanField(default=False),
17
+ ),
18
+ migrations.AlterIndexTogether(
19
+ name='manufacturerpart',
20
+ index_together={('part', 'source_mouser')},
21
+ ),
22
+ ]
@@ -0,0 +1,38 @@
1
+ # Generated by Django 2.2.8 on 2020-01-04 13:52
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('bom', '0030_auto_20200101_2253'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterField(
14
+ model_name='partrevision',
15
+ name='height_units',
16
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mil', 'mil'), ('in', 'in'), ('ft', 'ft'), ('yd', 'yd'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('mm', 'mm'), ('um', 'μm'), ('nm', 'nm'), ('Other', 'Other')], default=None, max_length=5, null=True),
17
+ ),
18
+ migrations.AlterField(
19
+ model_name='partrevision',
20
+ name='length_units',
21
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mil', 'mil'), ('in', 'in'), ('ft', 'ft'), ('yd', 'yd'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('mm', 'mm'), ('um', 'μm'), ('nm', 'nm'), ('Other', 'Other')], default=None, max_length=5, null=True),
22
+ ),
23
+ migrations.AlterField(
24
+ model_name='partrevision',
25
+ name='value_units',
26
+ field=models.CharField(blank=True, choices=[('', '-----'), ('Ohms', 'Ω'), ('mOhms', 'mΩ'), ('kOhms', 'kΩ'), ('F', 'F'), ('pF', 'pF'), ('nF', 'nF'), ('uF', 'μF'), ('V', 'V'), ('uV', 'μV'), ('mV', 'mV'), ('A', 'A'), ('uA', 'μA'), ('mA', 'mA'), ('C', '°C'), ('F', '°F'), ('H', 'H'), ('mH', 'mH'), ('uH', 'μH'), ('Hz', 'Hz'), ('kHz', 'kHz'), ('MHz', 'MHz'), ('GHz', 'GHz'), ('Other', 'Other')], default=None, max_length=5, null=True),
27
+ ),
28
+ migrations.AlterField(
29
+ model_name='partrevision',
30
+ name='wavelength_units',
31
+ field=models.CharField(blank=True, choices=[('', '-----'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('mm', 'mm'), ('um', 'μm'), ('nm', 'nm'), ('A', 'Å'), ('Other', 'Other')], default=None, max_length=5, null=True),
32
+ ),
33
+ migrations.AlterField(
34
+ model_name='partrevision',
35
+ name='width_units',
36
+ field=models.CharField(blank=True, choices=[('', '-----'), ('mil', 'mil'), ('in', 'in'), ('ft', 'ft'), ('yd', 'yd'), ('km', 'km'), ('m', 'm'), ('cm', 'cm'), ('mm', 'mm'), ('um', 'μm'), ('nm', 'nm'), ('Other', 'Other')], default=None, max_length=5, null=True),
37
+ ),
38
+ ]
@@ -0,0 +1,27 @@
1
+ # Generated by Django 2.2.9 on 2020-01-26 18:06
2
+
3
+ from django.db import migrations, models
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('bom', '0031_auto_20200104_1352'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.RenameField(
14
+ model_name='manufacturerpart',
15
+ old_name='source_mouser',
16
+ new_name='mouser_disable',
17
+ ),
18
+ migrations.AddField(
19
+ model_name='partclass',
20
+ name='mouser_enabled',
21
+ field=models.BooleanField(default=False),
22
+ ),
23
+ migrations.AlterIndexTogether(
24
+ name='manufacturerpart',
25
+ index_together=set(),
26
+ ),
27
+ ]
@@ -0,0 +1,29 @@
1
+ # Generated by Django 2.2.9 on 2020-02-03 06:18
2
+
3
+ import django.core.validators
4
+ from django.db import migrations, models
5
+
6
+
7
+ class Migration(migrations.Migration):
8
+
9
+ dependencies = [
10
+ ('bom', '0032_auto_20200126_1806'),
11
+ ]
12
+
13
+ operations = [
14
+ migrations.AddField(
15
+ model_name='organization',
16
+ name='number_scheme',
17
+ field=models.CharField(choices=[('I', 'Intelligent'), ('S', 'Semi-Intelligent')], default='S', max_length=1),
18
+ ),
19
+ migrations.AlterField(
20
+ model_name='organization',
21
+ name='number_item_len',
22
+ field=models.PositiveIntegerField(default=3, validators=[django.core.validators.MinValueValidator(3), django.core.validators.MaxValueValidator(128)]),
23
+ ),
24
+ migrations.AlterField(
25
+ model_name='part',
26
+ name='number_item',
27
+ field=models.CharField(blank=True, default=None, max_length=128, validators=[django.core.validators.RegexValidator('^[0-9]*$', 'Only numeric characters are allowed.')]),
28
+ ),
29
+ ]