added CSV upload to enable fast creation of similar components #14

Merged
mhu merged 3 commits from feature/csv-import into develop 2024-11-17 21:55:44 +01:00
4 changed files with 21 additions and 0 deletions
Showing only changes of commit 3d63357534 - Show all commits

View File

1 name manufacturer component_type pref_distri description datasheet_link package image_url storage_uuid substorage_path amount lot watermark param:Resistance param:Temperature coefficient param:Tolerance distri:Mouser
2 1K41 Phycomp Resistor KVG - expired R0603 https://t3.ftcdn.net/jpg/02/95/44/22/360_F_295442295_OXsXOmLmqBUfZreTnGo9PREuAPSLQhff.jpg a4909bb4-4d69-4e58-8fbd-fba4fa62d9fb bew 1111 4000 0 1330 100 1 gggg

View File

@ -78,6 +78,11 @@
<script type="text/javascript" src="{% static 'js/kenyusho-api-v1.js' %}"></script>
<script type="text/javascript" src="{% static 'js/autocomplete.js' %}"></script>
<script type="text/javascript" src="{% static 'js/autocomplete-foreign-key-field.js' %}"></script>
<!-- Initialize bootstrap popovers -->
<script type="text/javascript">
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))
</script>
{% block custom_scripts %}
{% endblock custom_scripts %}

View File

@ -6,6 +6,22 @@
<div class="modal-content">
<div class="modal-header">
<h2>Import Component CSV</h2>
<button type="button"
class="btn"
data-bs-toggle="popover"
data-bs-title="Import Component CSV"
data-bs-html="true"
data-bs-content="The shimatta kenkyusho can import components from a CSV file uploaded to the website.<br>
All parameters are passed as names (e.g. package, manufacturer etc.).<br><br>
Component parameters can be set using a prefix <code>param:</code> followed by the
parameter name. The value is then parsed bysed on the parameter type.<br><br>
Distributor part numbers can be set similarly by prepending <code>distri:</code>.<br><br>
It is also possible to create initial stocks to one storage by passing the
storage uuid and/or the path to the storage (as printed in the breadcrumbs) or
a combination of a storage uuid and the path from this storage.<br><br>
See <a href='{% static 'example/import_csv/import_csv.csv' %}'>example</a> for details.">
<i class="bi bi-info-circle"></i>
</button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form method="post" enctype="multipart/form-data">