django-bom 1.237__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.
Files changed (183) hide show
  1. bom/__init__.py +1 -0
  2. bom/admin.py +161 -0
  3. bom/apps.py +8 -0
  4. bom/base_classes.py +31 -0
  5. bom/constants.py +210 -0
  6. bom/context_processors.py +9 -0
  7. bom/csv_headers.py +274 -0
  8. bom/decorators.py +32 -0
  9. bom/form_fields.py +59 -0
  10. bom/forms.py +1400 -0
  11. bom/helpers.py +292 -0
  12. bom/local_settings.py +35 -0
  13. bom/migrations/0001_initial.py +135 -0
  14. bom/migrations/0002_auto_20180908_2151.py +24 -0
  15. bom/migrations/0003_sellerpart_data_source.py +18 -0
  16. bom/migrations/0004_auto_20180911_0011.py +18 -0
  17. bom/migrations/0005_auto_20181007_1934.py +56 -0
  18. bom/migrations/0006_auto_20181007_1949.py +41 -0
  19. bom/migrations/0007_auto_20181009_0256.py +19 -0
  20. bom/migrations/0008_auto_20181030_0427.py +19 -0
  21. bom/migrations/0009_subpart_reference.py +18 -0
  22. bom/migrations/0010_auto_20181202_0733.py +23 -0
  23. bom/migrations/0011_auto_20181202_2113.py +22 -0
  24. bom/migrations/0012_partchangehistory.py +30 -0
  25. bom/migrations/0013_auto_20190222_1631.py +19 -0
  26. bom/migrations/0014_auto_20190223_2353.py +18 -0
  27. bom/migrations/0015_auto_20190303_1915.py +136 -0
  28. bom/migrations/0016_auto_20190405_2308.py +58 -0
  29. bom/migrations/0017_auto_20190616_1912.py +19 -0
  30. bom/migrations/0018_auto_20190616_2143.py +24 -0
  31. bom/migrations/0019_auto_20190624_1246.py +45 -0
  32. bom/migrations/0020_auto_20190627_0207.py +38 -0
  33. bom/migrations/0021_auto_20190627_0428.py +23 -0
  34. bom/migrations/0022_auto_20190811_2140.py +35 -0
  35. bom/migrations/0023_auto_20191205_2351.py +255 -0
  36. bom/migrations/0024_auto_20191214_1342.py +89 -0
  37. bom/migrations/0025_auto_20191221_1907.py +38 -0
  38. bom/migrations/0026_auto_20191222_2258.py +22 -0
  39. bom/migrations/0027_auto_20191222_2347.py +17 -0
  40. bom/migrations/0028_partrevision_displayable_synopsis.py +74 -0
  41. bom/migrations/0029_auto_20191231_1630.py +23 -0
  42. bom/migrations/0030_auto_20200101_2253.py +22 -0
  43. bom/migrations/0031_auto_20200104_1352.py +38 -0
  44. bom/migrations/0032_auto_20200126_1806.py +27 -0
  45. bom/migrations/0033_auto_20200203_0618.py +29 -0
  46. bom/migrations/0034_auto_20200222_0359.py +30 -0
  47. bom/migrations/0035_auto_20200303_0111.py +34 -0
  48. bom/migrations/0036_auto_20200303_0538.py +17 -0
  49. bom/migrations/0037_auto_20200405_1642.py +44 -0
  50. bom/migrations/0038_auto_20200422_0504.py +19 -0
  51. bom/migrations/0039_auto_20200929_2315.py +41 -0
  52. bom/migrations/0040_alter_organization_currency.py +19 -0
  53. bom/migrations/0041_organization_subscription_quantity.py +18 -0
  54. bom/migrations/0042_auto_20210720_2137.py +23 -0
  55. bom/migrations/0043_auto_20211123_0157.py +24 -0
  56. bom/migrations/0044_auto_20220831_1241.py +23 -0
  57. bom/migrations/0045_sellerpart_link.py +18 -0
  58. bom/migrations/0046_alter_sellerpart_unique_together.py +17 -0
  59. bom/migrations/0047_sellerpart_seller_part_number.py +18 -0
  60. bom/migrations/0048_rename_part_organization_number_class_bom_part_organiz_b333d6_idx_and_more.py +1017 -0
  61. bom/migrations/0049_alter_assembly_id_alter_assemblysubparts_id_and_more.py +99 -0
  62. bom/migrations/__init__.py +0 -0
  63. bom/models.py +757 -0
  64. bom/part_bom.py +192 -0
  65. bom/settings.py +264 -0
  66. bom/static/bom/css/dashboard.css +17 -0
  67. bom/static/bom/css/jquery.treetable.css +28 -0
  68. bom/static/bom/css/materialize.min.css +13 -0
  69. bom/static/bom/css/part-info.css +15 -0
  70. bom/static/bom/css/style.css +319 -0
  71. bom/static/bom/css/tablesorter-theme.materialize.css +176 -0
  72. bom/static/bom/css/treetable-theme.css +42 -0
  73. bom/static/bom/doc/sample_part_classes.csv +38 -0
  74. bom/static/bom/doc/test_bom.csv +6 -0
  75. bom/static/bom/doc/test_bom_5_intelligent.csv +4 -0
  76. bom/static/bom/doc/test_full_bom.csv +37 -0
  77. bom/static/bom/doc/test_new_parts.csv +5 -0
  78. bom/static/bom/doc/test_new_parts_5_intelligent.csv +5 -0
  79. bom/static/bom/img/_ionicons_svg_md-arrow-dropdown.svg +1 -0
  80. bom/static/bom/img/_ionicons_svg_md-arrow-dropright.svg +1 -0
  81. bom/static/bom/img/favicon.ico +0 -0
  82. bom/static/bom/img/google/web/1x/btn_google_signin_dark_disabled_web.png +0 -0
  83. bom/static/bom/img/google/web/1x/btn_google_signin_dark_focus_web.png +0 -0
  84. bom/static/bom/img/google/web/1x/btn_google_signin_dark_normal_web.png +0 -0
  85. bom/static/bom/img/google/web/1x/btn_google_signin_dark_pressed_web.png +0 -0
  86. bom/static/bom/img/google/web/1x/btn_google_signin_light_disabled_web.png +0 -0
  87. bom/static/bom/img/google/web/1x/btn_google_signin_light_focus_web.png +0 -0
  88. bom/static/bom/img/google/web/1x/btn_google_signin_light_normal_web.png +0 -0
  89. bom/static/bom/img/google/web/1x/btn_google_signin_light_pressed_web.png +0 -0
  90. bom/static/bom/img/google/web/2x/btn_google_signin_dark_disabled_web@2x.png +0 -0
  91. bom/static/bom/img/google/web/2x/btn_google_signin_dark_focus_web@2x.png +0 -0
  92. bom/static/bom/img/google/web/2x/btn_google_signin_dark_normal_web@2x.png +0 -0
  93. bom/static/bom/img/google/web/2x/btn_google_signin_dark_pressed_web@2x.png +0 -0
  94. bom/static/bom/img/google/web/2x/btn_google_signin_light_disabled_web@2x.png +0 -0
  95. bom/static/bom/img/google/web/2x/btn_google_signin_light_focus_web@2x.png +0 -0
  96. bom/static/bom/img/google/web/2x/btn_google_signin_light_normal_web@2x.png +0 -0
  97. bom/static/bom/img/google/web/2x/btn_google_signin_light_pressed_web@2x.png +0 -0
  98. bom/static/bom/img/google/web/vector/btn_google_dark_disabled_ios.eps +814 -0
  99. bom/static/bom/img/google/web/vector/btn_google_dark_disabled_ios.svg +24 -0
  100. bom/static/bom/img/google/web/vector/btn_google_dark_focus_ios.eps +1866 -0
  101. bom/static/bom/img/google/web/vector/btn_google_dark_focus_ios.svg +51 -0
  102. bom/static/bom/img/google/web/vector/btn_google_dark_normal_ios.eps +1031 -0
  103. bom/static/bom/img/google/web/vector/btn_google_dark_normal_ios.svg +50 -0
  104. bom/static/bom/img/google/web/vector/btn_google_dark_pressed_ios.eps +1031 -0
  105. bom/static/bom/img/google/web/vector/btn_google_dark_pressed_ios.svg +50 -0
  106. bom/static/bom/img/google/web/vector/btn_google_light_disabled_ios.eps +814 -0
  107. bom/static/bom/img/google/web/vector/btn_google_light_disabled_ios.svg +24 -0
  108. bom/static/bom/img/google/web/vector/btn_google_light_focus_ios.eps +1837 -0
  109. bom/static/bom/img/google/web/vector/btn_google_light_focus_ios.svg +44 -0
  110. bom/static/bom/img/google/web/vector/btn_google_light_normal_ios.eps +1002 -0
  111. bom/static/bom/img/google/web/vector/btn_google_light_normal_ios.svg +43 -0
  112. bom/static/bom/img/google/web/vector/btn_google_light_pressed_ios.eps +1002 -0
  113. bom/static/bom/img/google/web/vector/btn_google_light_pressed_ios.svg +43 -0
  114. bom/static/bom/img/google_drive_logo.svg +1 -0
  115. bom/static/bom/img/indabom.png +0 -0
  116. bom/static/bom/img/mouser.png +0 -0
  117. bom/static/bom/img/octopart_blue.svg +19 -0
  118. bom/static/bom/js/jquery-3.4.1.min.js +2 -0
  119. bom/static/bom/js/jquery.ba-floatingscrollbar.min.js +10 -0
  120. bom/static/bom/js/jquery.treetable.js +629 -0
  121. bom/static/bom/js/materialize.min.js +6 -0
  122. bom/templates/bom/account-delete.html +23 -0
  123. bom/templates/bom/add-manufacturer-part.html +66 -0
  124. bom/templates/bom/add-sellerpart.html +93 -0
  125. bom/templates/bom/base-menu.html +16 -0
  126. bom/templates/bom/base.html +129 -0
  127. bom/templates/bom/bom-action-btn.html +23 -0
  128. bom/templates/bom/bom-action-table.html +57 -0
  129. bom/templates/bom/bom-base-menu.html +6 -0
  130. bom/templates/bom/bom-base.html +24 -0
  131. bom/templates/bom/bom-form-modal.html +36 -0
  132. bom/templates/bom/bom-form.html +30 -0
  133. bom/templates/bom/bom-signup.html +12 -0
  134. bom/templates/bom/components/bom-flat.html +131 -0
  135. bom/templates/bom/components/bom-indented.html +237 -0
  136. bom/templates/bom/components/manufacturer-part-list.html +270 -0
  137. bom/templates/bom/components/seller-part-list.html +62 -0
  138. bom/templates/bom/create-part.html +65 -0
  139. bom/templates/bom/dashboard-menu.html +15 -0
  140. bom/templates/bom/dashboard.html +303 -0
  141. bom/templates/bom/edit-manufacturer-part.html +72 -0
  142. bom/templates/bom/edit-part-class.html +33 -0
  143. bom/templates/bom/edit-part.html +67 -0
  144. bom/templates/bom/edit-user-meta.html +38 -0
  145. bom/templates/bom/help.html +1356 -0
  146. bom/templates/bom/manufacturer-info.html +82 -0
  147. bom/templates/bom/manufacturers.html +97 -0
  148. bom/templates/bom/nothing-to-see.html +15 -0
  149. bom/templates/bom/organization-create.html +132 -0
  150. bom/templates/bom/part-info.html +439 -0
  151. bom/templates/bom/part-revision-display.html +184 -0
  152. bom/templates/bom/part-revision-edit.html +39 -0
  153. bom/templates/bom/part-revision-manage-bom.html +115 -0
  154. bom/templates/bom/part-revision-new.html +57 -0
  155. bom/templates/bom/part-revision-release.html +41 -0
  156. bom/templates/bom/search-help.html +101 -0
  157. bom/templates/bom/seller-info.html +82 -0
  158. bom/templates/bom/sellers.html +97 -0
  159. bom/templates/bom/settings.html +408 -0
  160. bom/templates/bom/signup.html +28 -0
  161. bom/templates/bom/table_of_contents.html +47 -0
  162. bom/templates/bom/upload-bom.html +111 -0
  163. bom/templates/bom/upload-parts-help.html +103 -0
  164. bom/templates/bom/upload-parts.html +50 -0
  165. bom/templates/registration/login.html +39 -0
  166. bom/tests.py +1506 -0
  167. bom/third_party_apis/__init__.py +0 -0
  168. bom/third_party_apis/base_api.py +51 -0
  169. bom/third_party_apis/google_drive.py +166 -0
  170. bom/third_party_apis/mouser.py +132 -0
  171. bom/third_party_apis/test_apis.py +24 -0
  172. bom/urls.py +94 -0
  173. bom/utils.py +228 -0
  174. bom/validators.py +23 -0
  175. bom/views/__init__.py +0 -0
  176. bom/views/json_views.py +55 -0
  177. bom/views/views.py +1620 -0
  178. bom/wsgi.py +16 -0
  179. django_bom-1.237.dist-info/METADATA +206 -0
  180. django_bom-1.237.dist-info/RECORD +183 -0
  181. django_bom-1.237.dist-info/WHEEL +5 -0
  182. django_bom-1.237.dist-info/licenses/LICENSE +674 -0
  183. django_bom-1.237.dist-info/top_level.txt +1 -0
bom/__init__.py ADDED
@@ -0,0 +1 @@
1
+ default_app_config = 'bom.apps.BomConfig'
bom/admin.py ADDED
@@ -0,0 +1,161 @@
1
+ from django.contrib import admin
2
+ from django.contrib.auth import get_user_model
3
+ from django.contrib.auth.admin import UserAdmin
4
+
5
+ from .models import (
6
+ Assembly,
7
+ Manufacturer,
8
+ ManufacturerPart,
9
+ Organization,
10
+ Part,
11
+ PartClass,
12
+ PartRevision,
13
+ Seller,
14
+ SellerPart,
15
+ Subpart,
16
+ UserMeta,
17
+ )
18
+
19
+
20
+ User = get_user_model()
21
+
22
+ class UserMetaInline(admin.TabularInline):
23
+ model = UserMeta
24
+ raw_id_fields = ('organization',)
25
+ can_delete = False
26
+
27
+
28
+ class UserAdmin(UserAdmin):
29
+ inlines = (UserMetaInline,)
30
+
31
+
32
+ class OrganizationAdmin(admin.ModelAdmin):
33
+ list_display = ('name',)
34
+
35
+
36
+ class SubpartInline(admin.TabularInline):
37
+ model = Subpart
38
+ fk_name = 'part_revision'
39
+ raw_id_fields = ('part_revision',)
40
+ # readonly_fields = ('get_full_part_number', )
41
+ #
42
+ # def get_full_part_number(self, obj):
43
+ # return obj.assembly_subpart.part.full_part_number()
44
+ # get_full_part_number.short_description = 'PartNumber'
45
+
46
+
47
+ class SellerAdmin(admin.ModelAdmin):
48
+ list_display = ('name',)
49
+
50
+
51
+ class SellerPartAdmin(admin.ModelAdmin):
52
+ list_display = (
53
+ 'manufacturer_part',
54
+ 'seller',
55
+ 'seller_part_number',
56
+ 'minimum_order_quantity',
57
+ 'minimum_pack_quantity',
58
+ 'unit_cost',
59
+ 'lead_time_days',
60
+ 'nre_cost',
61
+ 'ncnr')
62
+
63
+
64
+ class SellerPartAdminInline(admin.TabularInline):
65
+ model = SellerPart
66
+ raw_id_fields = ('seller', 'manufacturer_part',)
67
+
68
+
69
+ class ManufacturerPartAdmin(admin.ModelAdmin):
70
+ list_display = (
71
+ 'manufacturer_part_number',
72
+ 'manufacturer',
73
+ 'part',)
74
+ raw_id_fields = ('manufacturer', 'part',)
75
+ inlines = [
76
+ SellerPartAdminInline,
77
+ ]
78
+
79
+
80
+ class ManufacturerPartAdminInline(admin.TabularInline):
81
+ model = ManufacturerPart
82
+ raw_id_fields = ('part', 'manufacturer',)
83
+
84
+
85
+ class PartClassAdmin(admin.ModelAdmin):
86
+ list_display = ('code', 'name', 'comment',)
87
+
88
+
89
+ class PartRevisionAdminInline(admin.TabularInline):
90
+ model = PartRevision
91
+ raw_id_fields = ('assembly',)
92
+
93
+
94
+ class PartAdmin(admin.ModelAdmin):
95
+ ordering = ('organization', 'number_class__code', 'number_item', 'number_variation')
96
+ readonly_fields = ('get_full_part_number',)
97
+ list_display = (
98
+ 'organization',
99
+ 'get_full_part_number',
100
+ )
101
+ raw_id_fields = ('number_class', 'primary_manufacturer_part',)
102
+ inlines = [
103
+ ManufacturerPartAdminInline,
104
+ ]
105
+
106
+ def get_full_part_number(self, obj):
107
+ return obj.full_part_number()
108
+
109
+ get_full_part_number.short_description = 'PartNumber'
110
+ get_full_part_number.admin_order_field = 'number_class__part_number'
111
+
112
+
113
+ class PartRevisionAdmin(admin.ModelAdmin):
114
+ list_display = ('part', 'revision', 'description', 'get_assembly_size', 'timestamp',)
115
+ raw_id_fields = ('assembly',)
116
+ readonly_fields = ('timestamp',)
117
+
118
+ def get_assembly_size(self, obj):
119
+ return None if obj.assembly is None else obj.assembly.subparts.count()
120
+
121
+ get_assembly_size.short_description = 'AssemblySize'
122
+
123
+
124
+ class ManufacturerAdmin(admin.ModelAdmin):
125
+ list_display = ('name', 'organization',)
126
+
127
+
128
+ class SubpartAdmin(admin.ModelAdmin):
129
+ list_display = ('part_revision', 'count', 'reference',)
130
+
131
+
132
+ class SubpartsInline(admin.TabularInline):
133
+ model = Assembly.subparts.through
134
+ raw_id_fields = ('subpart',)
135
+
136
+
137
+ class AssemblyAdmin(admin.ModelAdmin):
138
+ list_display = ('id',)
139
+ exclude = ('subparts',)
140
+ inlines = [
141
+ SubpartsInline,
142
+ ]
143
+
144
+
145
+ # Try to unregister User model
146
+ try:
147
+ admin.site.unregister(User)
148
+ except admin.sites.NotRegistered:
149
+ pass
150
+
151
+ admin.site.register(User, UserAdmin)
152
+ admin.site.register(Organization, OrganizationAdmin)
153
+ admin.site.register(Seller, SellerAdmin)
154
+ admin.site.register(SellerPart, SellerPartAdmin)
155
+ admin.site.register(ManufacturerPart, ManufacturerPartAdmin)
156
+ admin.site.register(PartClass, PartClassAdmin)
157
+ admin.site.register(Part, PartAdmin)
158
+ admin.site.register(PartRevision, PartRevisionAdmin)
159
+ admin.site.register(Manufacturer, ManufacturerAdmin)
160
+ admin.site.register(Assembly, AssemblyAdmin)
161
+ admin.site.register(Subpart, SubpartAdmin)
bom/apps.py ADDED
@@ -0,0 +1,8 @@
1
+ from __future__ import unicode_literals
2
+
3
+ from django.apps import AppConfig
4
+
5
+
6
+ class BomConfig(AppConfig):
7
+ name = 'bom'
8
+ mouser_api_key = None
bom/base_classes.py ADDED
@@ -0,0 +1,31 @@
1
+ from collections import OrderedDict
2
+ from django.forms.models import model_to_dict
3
+
4
+
5
+ class AsDictModel:
6
+ def as_dict(self):
7
+ try:
8
+ return model_to_dict(self)
9
+ except (TypeError, AttributeError):
10
+ return dict(self)
11
+
12
+ def __iter__(self):
13
+ for key in dir(self):
14
+ if not key.startswith("_") and not key == "objects":
15
+ value = getattr(self, key)
16
+ if not callable(value):
17
+ if isinstance(value, (dict, OrderedDict)):
18
+ for subkey, subvalue in value.items():
19
+ try:
20
+ value[subkey] = subvalue.as_dict()
21
+ except AttributeError:
22
+ pass
23
+ yield key, value
24
+ else:
25
+ try:
26
+ yield key, value.as_dict()
27
+ except AttributeError:
28
+ if isinstance(value, (int, float, complex, bool)):
29
+ yield key, value
30
+ else:
31
+ yield key, str(value)
bom/constants.py ADDED
@@ -0,0 +1,210 @@
1
+ NO_CHOICE = ('', '-----')
2
+
3
+ SUBSCRIPTION_TYPE_FREE = 'F'
4
+ SUBSCRIPTION_TYPE_PRO = 'P'
5
+ SUBSCRIPTION_TYPES = ((SUBSCRIPTION_TYPE_FREE, 'Free'), (SUBSCRIPTION_TYPE_PRO, 'Pro'),)
6
+
7
+ ROLE_TYPE_ADMIN = 'A'
8
+ ROLE_TYPE_VIEWER = 'V'
9
+ ROLE_TYPES = ((ROLE_TYPE_ADMIN, 'Admin'), (ROLE_TYPE_VIEWER, 'Viewer'),)
10
+
11
+ CONFIGURATION_TYPE_RELEASED = 'R'
12
+ CONFIGURATION_TYPE_WORKING = 'W'
13
+ CONFIGURATION_TYPES = ((CONFIGURATION_TYPE_RELEASED, 'Released'), (CONFIGURATION_TYPE_WORKING, 'Working'),)
14
+
15
+ NUMBER_SCHEME_INTELLIGENT = 'I'
16
+ NUMBER_SCHEME_SEMI_INTELLIGENT = 'S'
17
+ NUMBER_SCHEMES = ((NUMBER_SCHEME_INTELLIGENT, 'Intelligent'), (NUMBER_SCHEME_SEMI_INTELLIGENT, 'Semi-Intelligent'),)
18
+
19
+ NUMBER_CLASS_CODE_LEN_MIN = 2
20
+ NUMBER_CLASS_CODE_LEN_MAX = 16
21
+ NUMBER_CLASS_CODE_LEN_DEFAULT = 3
22
+ NUMBER_ITEM_LEN_MIN = 3
23
+ NUMBER_ITEM_LEN_MAX = 128
24
+ NUMBER_ITEM_LEN_DEFAULT = 4
25
+ NUMBER_VARIATION_LEN_MIN = 0
26
+ NUMBER_VARIATION_LEN_MAX = 16
27
+ NUMBER_VARIATION_LEN_DEFAULT = 2
28
+
29
+ DATA_SOURCE_OCTOPART = 'octopart'
30
+ DATA_SOURCE_MOUSER = 'mouser'
31
+ DATA_SOURCES = (
32
+ NO_CHOICE,
33
+ (DATA_SOURCE_OCTOPART, 'octopart'),
34
+ (DATA_SOURCE_MOUSER, 'mouser'),
35
+ )
36
+
37
+ VALUE_UNITS = (
38
+ NO_CHOICE,
39
+ ('Ohms', '\u03A9'),
40
+ ('mOhms', 'm\u03A9'),
41
+ ('kOhms', 'k\u03A9'),
42
+ ('MOhms', 'M\u03A9'),
43
+ ('F', 'F'),
44
+ ('pF', 'pF'),
45
+ ('nF', 'nF'),
46
+ ('uF', '\u03BCF'),
47
+ ('V', 'V'),
48
+ ('uV', '\u03BCV'),
49
+ ('mV', 'mV'),
50
+ ('A', 'A'),
51
+ ('uA', '\u03BCA'),
52
+ ('mA', 'mA'),
53
+ ('C', '\u00B0C'),
54
+ ('F', '\u00B0F'),
55
+ ('H', 'H'),
56
+ ('nH', 'nH'),
57
+ ('mH', 'mH'),
58
+ ('uH', '\u03BCH'),
59
+ ('Hz', 'Hz'),
60
+ ('kHz', 'kHz'),
61
+ ('MHz', 'MHz'),
62
+ ('GHz', 'GHz'),
63
+ ('Other', 'Other'),
64
+ )
65
+
66
+ PACKAGE_TYPES = (
67
+ NO_CHOICE,
68
+ ('0201 smd', '0201 smd'),
69
+ ('0402 smd', '0402 smd'),
70
+ ('0603 smd', '0603 smd'),
71
+ ('0805 smd', '0805 smd'),
72
+ ('1206 smd', '1206 smd'),
73
+ ('1210 smd', '1210 smd'),
74
+ ('1812 smd', '1812 smd'),
75
+ ('2010 smd', '2010 smd'),
76
+ ('2512 smd', '2512 smd'),
77
+ ('1/8 radial', '1/8 radial'),
78
+ ('1/4 radial', '1/4 radial'),
79
+ ('1/2 radial', '1/2 radial'),
80
+ ('Size A', 'Size A'),
81
+ ('Size B', 'Size B'),
82
+ ('Size C', 'Size C'),
83
+ ('Size D', 'Size D'),
84
+ ('Size E', 'Size E'),
85
+ ('SOT-23', 'SOT-23'),
86
+ ('SOT-223', 'SOT-233'),
87
+ ('DIL', 'DIL'),
88
+ ('SOP', 'SOP'),
89
+ ('SOIC', 'SOIC'),
90
+ ('QFN', 'QFN'),
91
+ ('QFP', 'QFP'),
92
+ ('QFT', 'QFT'),
93
+ ('PLCC', 'PLCC'),
94
+ ('VGA', 'VGA'),
95
+ ('BGA', 'BGA'),
96
+ ('CSP', 'CSP'),
97
+ ('Other', 'Other'),
98
+ )
99
+
100
+ DISTANCE_UNITS = (
101
+ NO_CHOICE,
102
+ ('mil', 'mil'),
103
+ ('in', 'in'),
104
+ ('ft', 'ft'),
105
+ ('yd', 'yd'),
106
+ ('km', 'km'),
107
+ ('m', 'm'),
108
+ ('cm', 'cm'),
109
+ ('mm', 'mm'),
110
+ ('um', '\u03BCm'),
111
+ ('nm', 'nm'),
112
+ ('Other', 'Other'),
113
+ )
114
+
115
+ WEIGHT_UNITS = (
116
+ NO_CHOICE,
117
+ ('mg', 'mg'),
118
+ ('g', 'g'),
119
+ ('kg', 'kg'),
120
+ ('oz', 'oz'),
121
+ ('lb', 'lb'),
122
+ ('Other', 'Other'),
123
+ )
124
+
125
+ TEMPERATURE_UNITS = (
126
+ NO_CHOICE,
127
+ ('C', '\u00B0C'),
128
+ ('F', '\u00B0F'),
129
+ ('Other', 'Other'),
130
+ )
131
+
132
+ WAVELENGTH_UNITS = (
133
+ NO_CHOICE,
134
+ ('km', 'km'),
135
+ ('m', 'm'),
136
+ ('cm', 'cm'),
137
+ ('mm', 'mm'),
138
+ ('um', '\u03BCm'),
139
+ ('nm', 'nm'),
140
+ ('A', '\u212B'),
141
+ ('Other', 'Other'),
142
+ )
143
+
144
+ FREQUENCY_UNITS = (
145
+ NO_CHOICE,
146
+ ('Hz', 'Hz'),
147
+ ('kHz', 'kHz'),
148
+ ('MHz', 'MHz'),
149
+ ('GHz', 'GHz'),
150
+ ('Other', 'Other'),
151
+ )
152
+
153
+ MEMORY_UNITS = (
154
+ NO_CHOICE,
155
+ ('KB', 'KB'),
156
+ ('MB', 'MB'),
157
+ ('GB', 'GB'),
158
+ ('TB', 'TB'),
159
+ ('Other', 'Other'),
160
+ )
161
+
162
+ INTERFACE_TYPES = (
163
+ NO_CHOICE,
164
+ ('I2C', 'I2C'),
165
+ ('SPI', 'SPI'),
166
+ ('CAN', 'CAN'),
167
+ ('One-Wire', '1-Wire'),
168
+ ('RS485', 'RS-485'),
169
+ ('RS232', 'RS-232'),
170
+ ('WiFi', 'Wi-Fi'),
171
+ ('4G', '4G'),
172
+ ('BT', 'Bluetooth'),
173
+ ('BTLE', 'Bluetooth LE'),
174
+ ('Z_Wave', 'Z-Wave'),
175
+ ('Zigbee', 'Zigbee'),
176
+ ('LAN', 'LAN'),
177
+ ('USB', 'USB'),
178
+ ('HDMI', 'HDMI'),
179
+ ('Other', 'Other'),
180
+ )
181
+
182
+ POWER_UNITS = (
183
+ NO_CHOICE,
184
+ ('W', 'W'),
185
+ ('uW', '\u03BCW'),
186
+ ('mW', 'mW'),
187
+ ('kW', 'kW'),
188
+ ('MW', 'MW'),
189
+ ('Other', 'Other'),
190
+ )
191
+
192
+ VOLTAGE_UNITS = (
193
+ NO_CHOICE,
194
+ ('V', 'V'),
195
+ ('uV', '\u03BCV'),
196
+ ('mV', 'mV'),
197
+ ('kV', 'kV'),
198
+ ('MV', 'MV'),
199
+ ('Other', 'Other'),
200
+ )
201
+
202
+ CURRENT_UNITS = (
203
+ NO_CHOICE,
204
+ ('A', 'A'),
205
+ ('uA', '\u03BCV'),
206
+ ('mA', 'mA'),
207
+ ('kA', 'kA'),
208
+ ('MA', 'MA'),
209
+ ('Other', 'Other'),
210
+ )
@@ -0,0 +1,9 @@
1
+ from django.conf import settings # import the settings file
2
+
3
+
4
+ def bom_config(request):
5
+ base_template = 'bom/base.html'
6
+ if settings.BOM_CONFIG:
7
+ if 'base_template' in settings.BOM_CONFIG:
8
+ base_template = settings.BOM_CONFIG['base_template']
9
+ return {'BASE_TEMPLATE': base_template}