django-bom 1.240__py3-none-any.whl → 1.243__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.
@@ -0,0 +1,17 @@
1
+ # Generated by Django 5.2.8 on 2025-12-16 18:43
2
+
3
+ from django.db import migrations
4
+
5
+
6
+ class Migration(migrations.Migration):
7
+
8
+ dependencies = [
9
+ ('bom', '0049_alter_assembly_id_alter_assemblysubparts_id_and_more'),
10
+ ]
11
+
12
+ operations = [
13
+ migrations.AlterModelOptions(
14
+ name='organization',
15
+ options={'permissions': (('manage_members', 'Can manage organization members'),)},
16
+ ),
17
+ ]
bom/settings.py CHANGED
@@ -1,16 +1,12 @@
1
- import os
2
1
  import logging
2
+ import os
3
3
  from pathlib import Path
4
- from django.utils.log import DEFAULT_LOGGING
5
4
 
6
- # --------------------------------------------------------------------------
7
- # BASE CONFIGURATION & LOCAL SETTINGS
8
- # --------------------------------------------------------------------------
5
+ from django.utils.log import DEFAULT_LOGGING
9
6
 
10
7
  logger = logging.getLogger(__name__)
11
8
  BASE_DIR = Path(__file__).resolve().parent.parent
12
9
 
13
- # Attempt to load local settings (similar pattern to your original, but clean)
14
10
  try:
15
11
  from .local_settings import *
16
12
  except ImportError:
@@ -7,7 +7,7 @@
7
7
 
8
8
  {% block content %}
9
9
  <div class="row container-app">
10
- <div class="col s12">
10
+ <div class="col s8 offset-s2">
11
11
  <ul id="tabs" class="tabs tabs-fixed-width">
12
12
  <li class="tab"><a id="user-tab" href="#user">User</a></li>
13
13
  <li class="tab"><a id="indabom-tab" href="#indabom">IndaBOM</a></li>
@@ -15,7 +15,7 @@
15
15
  </ul>
16
16
  </div>
17
17
 
18
- <div id="user" class="col s12">
18
+ <div id="user" class="col l8 offset-l2 s12">
19
19
  <div class="section">
20
20
  <h4 class="section-title"><i class="material-icons teal-text text-darken-1">person</i>User</h4>
21
21
  <form name="seller" action="{% url 'bom:settings' tab_anchor=USER_TAB %}" method="post">
@@ -30,9 +30,9 @@
30
30
  </div>
31
31
  </div>
32
32
  <div class="row">
33
- {{ user_form.first_name|materializecss:'s12 m4' }}
34
- {{ user_form.last_name|materializecss:'s12 m4' }}
35
- {{ user_form.email|materializecss:'s12 m4' }}
33
+ {{ user_form.first_name|materializecss:'s12 l6' }}
34
+ {{ user_form.last_name|materializecss:'s12 l6' }}
35
+ {{ user_form.email|materializecss:'s12' }}
36
36
  </div>
37
37
  <div class="row">
38
38
  <div class="col s12 right-align">
@@ -57,18 +57,17 @@
57
57
  </div>
58
58
  </div>
59
59
 
60
- <div id="indabom" class="col s12">
60
+ <div id="indabom" class="col s12 l8 offset-l2">
61
61
  {% if profile.role == 'A' %}
62
62
  {% if organization.number_scheme == 'S' %}
63
63
  <div class="section">
64
64
  <h4 class="section-title"><i class="material-icons teal-text text-darken-1">category</i>Part
65
65
  Classes</h4>
66
- <p><a href="{% url 'bom:help' %}#part-numbering" target="_blank">What is a part class?</a></p>
67
66
  <form name="seller" action="{% url 'bom:settings' tab_anchor=INDABOM_TAB %}" method="post" enctype="multipart/form-data">
68
67
  {% csrf_token %}
69
68
  {% if part_classes.count > 0 %}
70
69
  <div class="row" style="margin-bottom: 0;">
71
- <div class="input-field col s8 m4">
70
+ <div class="input-field col s8 l4">
72
71
  <select name="part-class-action">
73
72
  <option value="" disabled selected>Choose your action</option>
74
73
  <option value="submit-part-class-enable-mouser">Enable Mouser</option>
@@ -77,13 +76,13 @@
77
76
  </select>
78
77
  <label>Action</label>
79
78
  </div>
80
- <div class="col s2 m2">
79
+ <div class="col s2 l2">
81
80
  <div class="input-field">
82
81
  <button class="waves-effect waves-light btn btn-primary" type="submit">Go
83
82
  </button>
84
83
  </div>
85
84
  </div>
86
- <div class="col s2 m6 right-align">
85
+ <div class="col s2 l6 right-align">
87
86
  <div class="input-field">
88
87
  <button class="waves-effect btn-flat btn-icon-round tooltipped"
89
88
  type="submit" name="submit-part-class-export"
@@ -130,18 +129,15 @@
130
129
  </tbody>
131
130
  </table>
132
131
  {% else %}
133
- <p>No part classes have been defined yet.</p>
132
+ <p>No part classes have been defined yet. <a href="{% url 'bom:help' %}#part-numbering"
133
+ target="_blank">What is a part class?</a>
134
+ </p>
135
+ <p>To get started, add your first part class, or upload some here. To help, here is <a
136
+ href="{% static 'bom/doc/sample_part_classes.csv' %}">a sample
137
+ CSV file</a>.</p>
134
138
  {% endif %}
135
139
  </form>
136
- <div class="right-align" style="margin-top: 8px;">
137
- {% if part_classes.count == 0 %}
138
- <div class="left-align" style="margin-bottom: 8px;">
139
- <a href="{% url 'bom:help' %}#part-numbering" target="_blank">What is a part
140
- class?</a>
141
- <p>You may also use <a href="{% static 'bom/doc/sample_part_classes.csv' %}">this
142
- sample CSV file</a>.</p>
143
- </div>
144
- {% endif %}
140
+ <div class="right-align" style="margin-top: 16px;">
145
141
  {% include 'bom/bom-form-modal.html' with modal_title='Upload Part Classes' form=part_class_csv_form action=part_class_form_action name='submit-part-class-upload' modal_description='To batch add part classes, upload a csv that contains columns with the headers<b>`name`</b> and <b>`code`</b>. You may optionally specify a description or comment by including a column with the header <b>`description`</b> or <b>`comment`</b>.' %}
146
142
  {% include 'bom/bom-form-modal.html' with modal_title='Add Part Class' form=part_class_form action=part_class_form_action name='submit-part-class-create' %}
147
143
  </div>
@@ -161,8 +157,8 @@
161
157
  <b>{{ organization.number_cs }}-{{ organization.number_ns }}
162
158
  {% if organization.number_vs %}-{{ organization.number_vs }}{% endif %}</b></p>
163
159
  <div class="row">
164
- {{ organization_number_len_form|materializecss:'s4 m2' }}
165
- <div class="col s12 m6 input-field">
160
+ {{ organization_number_len_form|materializecss:'s4 l2' }}
161
+ <div class="col s12 l6 input-field right-align">
166
162
  <button class="waves-effect waves-light btn btn-primary" type="submit"
167
163
  name="submit-number-item-len"
168
164
  onclick="return confirm('Are you sure you want to change the number of digits?')">
@@ -223,7 +219,7 @@
223
219
  {% endif %}
224
220
  </div>
225
221
 
226
- <div id="organization" class="col s12">
222
+ <div id="organization" class="col s12 l8 offset-l2">
227
223
  {% if user.bom_profile.role == 'A' %}
228
224
  <div class="section">
229
225
  <h4 class="section-title"><i class="material-icons teal-text text-darken-1">business</i>Organization
@@ -232,7 +228,7 @@
232
228
  enctype="multipart/form-data">
233
229
  {% csrf_token %}
234
230
  <div class="row">
235
- {{ organization_form|materializecss:'s12 m4' }}
231
+ {{ organization_form|materializecss:'s12' }}
236
232
  </div>
237
233
  <div class="row">
238
234
  <div class="col s12 right-align">
@@ -311,54 +307,64 @@
311
307
  <div class="section">
312
308
  <h4 class="section-title"><i
313
309
  class="material-icons teal-text text-darken-1">integration_instructions</i>Integrations</h4>
314
- </div>
315
-
316
- <div class="section">
317
- <h5 class="section-title"><img title="Via Google Drive"
318
- src="{% static 'bom/img/google_drive_logo.svg' %}">Part File Storage
319
- with Google Drive</h5>
320
- {% if not google_authentication %}
321
- <p>Connect your Google account to access Google Drive features.
322
- {% if not organization.google_drive_parent %}Organization owners can enable file storage
323
- using Google Drive. {% if organization.owner == user %}Since you are the owner, you are
324
- able to enable file storage!{% else %}Contact your organization owner to enable.
325
- {% endif %}{% endif %}</p>
326
- <p>When you connect, we will create a folder called <b>IndaBOM Part Files</b> in your root of
327
- Google Drive (and it can be moved anywhere in your drive). To add files to a part, navigate
328
- to the part in IndaBOM, and on the part's <b>Specifications</b> tab, click the <img
329
- title="Via Google Drive" style="width: 16px; vertical-align: middle;"
330
- src="{% static 'bom/img/google_drive_logo.svg' %}"> Google Drive link. This will
331
- create a folder for your part in your root IndaBOM directory, or take you there if it
332
- already exists.</p>
333
- <p>You'll be able to access the files directly through Google Drive, and through IndaBOM.</p>
334
- {% else %}
335
- <p>You're connected with Google and can access Google Drive features.</p>
336
- {% endif %}
337
- <div>
338
- {% if google_authentication %}
339
- <p>Logged in to Google as: {{ google_authentication.uid }}</p>
340
- <form action="{% url 'social:disconnect' 'google-oauth2' %}" method="post">
341
- {% csrf_token %}
342
- <button class="waves-effect waves-light btn btn-primary" type="submit">Disconnect
343
- </button>
344
- </form>
310
+ <div class="section">
311
+ <h5 class="section-title"><img title="Via Google Drive"
312
+ src="{% static 'bom/img/google_drive_logo.svg' %}">Part File
313
+ Storage
314
+ with Google Drive</h5>
315
+ {% if not google_authentication %}
316
+ <p>Connect your Google account to access Google Drive features.
317
+ {% if not organization.google_drive_parent %}Organization owners can enable file storage
318
+ using Google Drive. {% if organization.owner == user %}Since you are the owner, you
319
+ are
320
+ able to enable file storage!{% else %}Contact your organization owner to enable.
321
+ {% endif %}{% endif %}</p>
322
+ <p>When you connect, we will create a folder called <b>IndaBOM Part Files</b> in your root
323
+ of
324
+ Google Drive (and it can be moved anywhere in your drive). To add files to a part,
325
+ navigate
326
+ to the part in IndaBOM, and on the part's <b>Specifications</b> tab, click the <img
327
+ title="Via Google Drive" style="width: 16px; vertical-align: middle;"
328
+ src="{% static 'bom/img/google_drive_logo.svg' %}"> Google Drive link. This will
329
+ create a folder for your part in your root IndaBOM directory, or take you there if it
330
+ already exists.</p>
331
+ <p>You'll be able to access the files directly through Google Drive, and through
332
+ IndaBOM.</p>
345
333
  {% else %}
346
- <p>To get started, sign in with Google:</p>
347
- <a href="{% url "social:begin" "google-oauth2" %}">
348
- <img title="Google sign-in."
349
- src="{% static 'bom/img/google/web/1x/btn_google_signin_dark_normal_web.png' %}">
350
- </a>
334
+ <p>You're connected with Google and can access Google Drive features.</p>
351
335
  {% endif %}
336
+ <div>
337
+ {% if google_authentication %}
338
+ <p>Logged in to Google as: {{ google_authentication.uid }}</p>
339
+ <div class="right-align">
340
+ <form action="{% url 'social:disconnect' 'google-oauth2' %}" method="post">
341
+ {% csrf_token %}
342
+ <button class="waves-effect waves-light btn btn-primary" type="submit">
343
+ Disconnect
344
+ </button>
345
+ </form>
346
+ </div>
347
+ {% else %}
348
+ <p>To get started, sign in with Google:</p>
349
+ <div class="right-align">
350
+ <a href="{% url "social:begin" "google-oauth2" %}">
351
+ <img title="Google sign-in."
352
+ src="{% static 'bom/img/google/web/1x/btn_google_signin_dark_normal_web.png' %}">
353
+ </a>
354
+ </div>
355
+ {% endif %}
356
+ </div>
357
+ </div>
358
+ <div class="section">
359
+ <h5 class="section-title"><img title="Sourcing via Mouser.com"
360
+ src="{% static 'bom/img/mouser.png' %}">Automagic Sourcing via
361
+ Mouser
362
+ </h5>
363
+ <!--<p>No connection required. To enable sourcing via Mouser, select which part classes you'd like
364
+ enabled on the Settings IndaBOM tab. Once enabled, sourcing information will appear on part
365
+ detail pages in which there are parts sourced via Mouser.</p>-->
366
+ <p>Currently under construction.</p>
352
367
  </div>
353
- </div>
354
- <div class="section">
355
- <h5 class="section-title"><img title="Sourcing via Mouser.com"
356
- src="{% static 'bom/img/mouser.png' %}">Automagic Sourcing via Mouser
357
- </h5>
358
- <!--<p>No connection required. To enable sourcing via Mouser, select which part classes you'd like
359
- enabled on the Settings IndaBOM tab. Once enabled, sourcing information will appear on part
360
- detail pages in which there are parts sourced via Mouser.</p>-->
361
- <p>Currently under construction.</p>
362
368
  </div>
363
369
  {% endif %}
364
370
 
bom/views/views.py CHANGED
@@ -357,7 +357,7 @@ def bom_settings(request, tab_anchor=None):
357
357
  part_classes = PartClass.objects.all().filter(organization=organization)
358
358
 
359
359
  users_in_organization = User.objects.filter(
360
- id__in=UserMeta.objects.filter(organization=organization).values_list('user', flat=True)).exclude(id__in=[organization.owner.id]).order_by(
360
+ id__in=UserMeta.objects.filter(organization=organization).values_list('user', flat=True)).order_by(
361
361
  'first_name', 'last_name', 'email')
362
362
  users_in_organization_count = users_in_organization.count()
363
363
  has_member_capacity = users_in_organization_count < organization.subscription_quantity
@@ -462,8 +462,7 @@ def bom_settings(request, tab_anchor=None):
462
462
  tab_anchor = INDABOM_TAB
463
463
  part_class_csv_form = PartClassCSVForm(request.POST, request.FILES, organization=organization)
464
464
  if part_class_csv_form.is_valid():
465
- for success in part_class_csv_form.successes:
466
- messages.info(request, success)
465
+ messages.info(request, f'Successfully uploaded {len(part_class_csv_form.successes)} part classes.')
467
466
  for warning in part_class_csv_form.warnings:
468
467
  messages.warning(request, warning)
469
468
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-bom
3
- Version: 1.240
3
+ Version: 1.243
4
4
  Summary: A simple Django app to manage a bill of materials.
5
5
  Author-email: Mike Kasparian <mpkasp@gmail.com>
6
6
  License: GPL-3.0-only
@@ -13,7 +13,7 @@ bom/helpers.py,sha256=ONsDM0agG9sKJWMjN4IRNlWx2HNF7T0CXM-ts0GRiAY,15031
13
13
  bom/local_settings.py,sha256=yE4aupIquCWsFms44qoCrRrlIyM3sqpOkiwyj1WLxI8,820
14
14
  bom/models.py,sha256=poZoct60kAULCs8RlqC3MFtOl84l2ZfZzjb_d3t9z2g,36537
15
15
  bom/part_bom.py,sha256=30HYAKAEhtadiM9tk6vgCQnn7gNJeuXbzF5gXvMvKG4,8720
16
- bom/settings.py,sha256=jUuy7cKuz9gbZ301L0skMFrnU6qKaBpRUf-rHsTTYJM,8387
16
+ bom/settings.py,sha256=t3jamLeW4yJWIfB0aa5lbyz9xBCi-wcxTPEZxv5hswQ,8116
17
17
  bom/tests.py,sha256=ZqcTUYVXeWjAqzKAV6hp6SKTU0_IOTwIEboTujl7N_M,69905
18
18
  bom/urls.py,sha256=sGNKO8BsTO_TDPsqB-c_fqRozaNHOf9WYRaOy-7OLAE,6841
19
19
  bom/utils.py,sha256=z_2jACSkRc0hsc0mdR8tOK10KiSDeM0a6rXIpztPDuA,7302
@@ -68,6 +68,7 @@ bom/migrations/0046_alter_sellerpart_unique_together.py,sha256=KcOwhf5Vh02wDq_Z3
68
68
  bom/migrations/0047_sellerpart_seller_part_number.py,sha256=QdjdWMNlSyLHB7uSTq_8xhPxnYAXR8yht-d_AsMvJBw,446
69
69
  bom/migrations/0048_rename_part_organization_number_class_bom_part_organiz_b333d6_idx_and_more.py,sha256=rZ_mfd_xFu4BglhYxkNuQVqwThZ721kjrlCAn9LkNRo,50969
70
70
  bom/migrations/0049_alter_assembly_id_alter_assemblysubparts_id_and_more.py,sha256=l1q5BCNVYWD6Ngf9pGzYq1hQMvvshmdFlm33On63YNc,3247
71
+ bom/migrations/0050_alter_organization_options.py,sha256=n-YGAoUdUxYdh5NY0Zpz2T4CWEOR7tDjSFFk-KZD_tw,432
71
72
  bom/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
73
  bom/static/bom/css/dashboard.css,sha256=saLXUpnVRjsV9HNdsmQD4Eq-zBlm8R2YePhvoc1uifk,245
73
74
  bom/static/bom/css/jquery.treetable.css,sha256=H37aGBAAFP3R6v08nui9gKSdLE2VGsGsmlttrIImzfE,652
@@ -159,7 +160,7 @@ bom/templates/bom/part-revision-release.html,sha256=voG7wmYc1Cm3e_H1IasvQcPuyqnn
159
160
  bom/templates/bom/search-help.html,sha256=Wh_tXBJtz0bznk0F1C7OSdRhMe2qpOs9NMCBb2i0CFI,4398
160
161
  bom/templates/bom/seller-info.html,sha256=MACsHMYQXMWfRslXuvh9hD2z28VXzVi0DSy4yg7WQMk,3595
161
162
  bom/templates/bom/sellers.html,sha256=6ut7LwRMGUKYB4BRjiSpDBP9BGgqT7nxpNQpUVWDvkw,5412
162
- bom/templates/bom/settings.html,sha256=9uEAG_IpcVgGZT_lGQyKnc83qpoNjoN3qNs_PtBAj0s,27749
163
+ bom/templates/bom/settings.html,sha256=et6ct7SxA8hJK8GyLcfEgmYb6esS2zvDoUJb432dfd0,28237
163
164
  bom/templates/bom/signup.html,sha256=tB_x7q3IufSNXsd9Dfh8fdWpkiWSGH2_Zgw749B1PaU,884
164
165
  bom/templates/bom/subscription_panel.html,sha256=Ute49APwiXONQW2z0AApJRaSwnwtsYt3_opn0bW5BX8,843
165
166
  bom/templates/bom/table_of_contents.html,sha256=7wXWOfmVkk5Itjax5x1PE-g5QjxqmYBr7RW8NgtGRng,1763
@@ -178,9 +179,9 @@ bom/third_party_apis/mouser.py,sha256=q2-p0k2n-LNel_QRlfak0kAXT-9hh59k_Pt51PTG09
178
179
  bom/third_party_apis/test_apis.py,sha256=2W0jtTisGTmktC7l556pn9-pZYseTQmmQfo6_4uP4Dc,679
179
180
  bom/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
180
181
  bom/views/json_views.py,sha256=CaDMxHGnp2182ZV9QZfNkgM7tc_rNmokkelav9rF2dE,2462
181
- bom/views/views.py,sha256=SvD7Yku9rPwLFmrWC0c15g_a0nC-YkCOnIqEVC32DfU,72267
182
- django_bom-1.240.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
183
- django_bom-1.240.dist-info/METADATA,sha256=yhPn8NcuAiVTvnEPvwxwH6j-N_jI8qDjyELM4Mv-6K4,7558
184
- django_bom-1.240.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
185
- django_bom-1.240.dist-info/top_level.txt,sha256=6zytg4lnnobI96dO-ZEadPOCslrrFmf4t2Pnv-y8x0Y,4
186
- django_bom-1.240.dist-info/RECORD,,
182
+ bom/views/views.py,sha256=uTxpDDB-Bt4y125JnqnxCe--kluIu1fk0Pfg4Abg8yc,72229
183
+ django_bom-1.243.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
184
+ django_bom-1.243.dist-info/METADATA,sha256=aeEnhLXxjc9KEpcghiDDpelDtmYHpwRXnZ9_ww19-ow,7558
185
+ django_bom-1.243.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
186
+ django_bom-1.243.dist-info/top_level.txt,sha256=6zytg4lnnobI96dO-ZEadPOCslrrFmf4t2Pnv-y8x0Y,4
187
+ django_bom-1.243.dist-info/RECORD,,