Change everything to use tags
This commit is contained in:
parent
e8863a0071
commit
6ddfdddd00
24 changed files with 639 additions and 709 deletions
|
@ -52,6 +52,7 @@ class DocumentationInlineAdmin(NestedTabularInline):
|
||||||
class ItemInlineAdmin(NestedStackedInline):
|
class ItemInlineAdmin(NestedStackedInline):
|
||||||
model = Item
|
model = Item
|
||||||
extra = 1
|
extra = 1
|
||||||
|
filter_horizontal = ('tags', 'documentation')
|
||||||
#inlines = [DocumentationInlineAdmin]
|
#inlines = [DocumentationInlineAdmin]
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,6 +62,7 @@ class BoxAdmin(NestedModelAdmin):
|
||||||
list_filter = ['container']
|
list_filter = ['container']
|
||||||
search_fields = ['name', 'description']
|
search_fields = ['name', 'description']
|
||||||
inlines = [BoxInlineAdmin, ItemInlineAdmin]
|
inlines = [BoxInlineAdmin, ItemInlineAdmin]
|
||||||
|
filter_horizontal = ('tags',)
|
||||||
|
|
||||||
def view_on_site(self, obj):
|
def view_on_site(self, obj):
|
||||||
url = reverse('box-detail', kwargs={'pk': obj.id})
|
url = reverse('box-detail', kwargs={'pk': obj.id})
|
||||||
|
|
|
@ -8,6 +8,7 @@ from inventory.models import Distributor
|
||||||
class DistributorAdmin(admin.ModelAdmin):
|
class DistributorAdmin(admin.ModelAdmin):
|
||||||
readonly_fields = ['created_at', 'changed_at']
|
readonly_fields = ['created_at', 'changed_at']
|
||||||
search_fields = ['name', 'description']
|
search_fields = ['name', 'description']
|
||||||
|
filter_horizontal = ('tags',)
|
||||||
|
|
||||||
def view_on_site(self, obj):
|
def view_on_site(self, obj):
|
||||||
url = reverse('distributor-detail', kwargs={'pk': obj.id})
|
url = reverse('distributor-detail', kwargs={'pk': obj.id})
|
||||||
|
|
|
@ -7,6 +7,7 @@ class FormFactorAdmin(admin.ModelAdmin):
|
||||||
readonly_fields = ['created_at', 'changed_at']
|
readonly_fields = ['created_at', 'changed_at']
|
||||||
search_fields = ['name', 'description']
|
search_fields = ['name', 'description']
|
||||||
list_display = ['name', 'description']
|
list_display = ['name', 'description']
|
||||||
|
filter_horizontal = ('tags',)
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(FormFactor, FormFactorAdmin)
|
admin.site.register(FormFactor, FormFactorAdmin)
|
||||||
|
|
|
@ -16,6 +16,7 @@ class ItemAdmin(admin.ModelAdmin):
|
||||||
list_filter = ['container']
|
list_filter = ['container']
|
||||||
search_fields = ['name', 'description']
|
search_fields = ['name', 'description']
|
||||||
readonly_fields = ['created_at', 'changed_at']
|
readonly_fields = ['created_at', 'changed_at']
|
||||||
|
filter_horizontal = ('tags', 'documentation')
|
||||||
|
|
||||||
def view_on_site(self, obj):
|
def view_on_site(self, obj):
|
||||||
url = reverse('item-detail', kwargs={'pk': obj.id})
|
url = reverse('item-detail', kwargs={'pk': obj.id})
|
||||||
|
|
|
@ -8,6 +8,7 @@ from inventory.models import Manufacturer
|
||||||
class ManufacturerAdmin(admin.ModelAdmin):
|
class ManufacturerAdmin(admin.ModelAdmin):
|
||||||
readonly_fields = ['created_at', 'changed_at']
|
readonly_fields = ['created_at', 'changed_at']
|
||||||
search_fields = ['name', 'description']
|
search_fields = ['name', 'description']
|
||||||
|
filter_horizontal = ('tags',)
|
||||||
|
|
||||||
def view_on_site(self, obj):
|
def view_on_site(self, obj):
|
||||||
url = reverse('manufacturer-detail', kwargs={'pk': obj.id})
|
url = reverse('manufacturer-detail', kwargs={'pk': obj.id})
|
||||||
|
|
|
@ -6,6 +6,7 @@ from inventory.models import Tag
|
||||||
class TagAdmin(admin.ModelAdmin):
|
class TagAdmin(admin.ModelAdmin):
|
||||||
readonly_fields = ['created_at', 'changed_at']
|
readonly_fields = ['created_at', 'changed_at']
|
||||||
search_fields = ['name', 'description']
|
search_fields = ['name', 'description']
|
||||||
|
list_display = ['name', 'description']
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(Tag, TagAdmin)
|
admin.site.register(Tag, TagAdmin)
|
||||||
|
|
|
@ -1,164 +1,190 @@
|
||||||
# Generated by Django 3.1.4 on 2020-12-16 00:13
|
# Generated by Django 3.1.4 on 2020-12-22 22:09
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Container',
|
name='Container',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Distributor',
|
name='Distributor',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('name', models.CharField(max_length=255, unique=True)),
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
('description', models.CharField(max_length=4096)),
|
('description', models.CharField(max_length=4096)),
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
('web_link', models.URLField(blank=True, null=True)),
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
('search_link', models.URLField(blank=True, help_text='Use {} for search placeholder', null=True)),
|
||||||
('web_link', models.URLField(blank=True, null=True)),
|
('phone', models.CharField(blank=True, max_length=128, null=True)),
|
||||||
('search_link', models.URLField(blank=True, help_text='Use {} for search placeholder', null=True)),
|
('email', models.EmailField(blank=True, default=None, max_length=254, null=True)),
|
||||||
('phone', models.CharField(blank=True, max_length=128, null=True)),
|
('icon', models.ImageField(blank=True, null=True, upload_to='')),
|
||||||
('email', models.EmailField(blank=True, default=None, max_length=254, null=True)),
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
('icon', models.ImageField(blank=True, null=True, upload_to='')),
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Documentation',
|
name='Documentation',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('name', models.CharField(max_length=255, unique=True)),
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
('file', models.FileField(upload_to='')),
|
('file', models.FileField(upload_to='')),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='FormFactor',
|
name='FormFactor',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('name', models.CharField(max_length=255, unique=True)),
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
('description', models.CharField(max_length=4096)),
|
('description', models.CharField(max_length=4096)),
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
('icon', models.ImageField(blank=True, null=True, upload_to='')),
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
('datasheet', models.FileField(blank=True, null=True, upload_to='')),
|
||||||
('icon', models.ImageField(blank=True, null=True, upload_to='')),
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
('datasheet', models.FileField(blank=True, null=True, upload_to='')),
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Layout',
|
name='Layout',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('name', models.CharField(max_length=255, unique=True)),
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
('description', models.CharField(max_length=4096)),
|
('description', models.CharField(max_length=4096)),
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
('data', models.JSONField()),
|
('data', models.JSONField()),
|
||||||
('template_name', models.CharField(blank=True, max_length=255, null=True)),
|
('template_name', models.CharField(blank=True, max_length=255, null=True)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Manufacturer',
|
name='Tag',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('name', models.CharField(max_length=255, unique=True)),
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
('description', models.CharField(blank=True, max_length=4096)),
|
('description', models.CharField(max_length=4096)),
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
('web_link', models.URLField(blank=True, null=True)),
|
],
|
||||||
('icon', models.ImageField(blank=True, null=True, upload_to='')),
|
),
|
||||||
],
|
migrations.CreateModel(
|
||||||
),
|
name='Settings',
|
||||||
migrations.CreateModel(
|
fields=[
|
||||||
name='Tag',
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
fields=[
|
('default_container', models.ForeignKey(blank=True, default=None, help_text='Default container to display when calling the index page', null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.container')),
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
],
|
||||||
('name', models.CharField(max_length=255, unique=True)),
|
options={
|
||||||
('description', models.CharField(max_length=4096)),
|
'verbose_name_plural': 'Settings',
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
},
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
),
|
||||||
],
|
migrations.CreateModel(
|
||||||
),
|
name='Manufacturer',
|
||||||
migrations.CreateModel(
|
fields=[
|
||||||
name='Workshop',
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
fields=[
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
('container_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='inventory.container')),
|
('description', models.CharField(blank=True, max_length=4096)),
|
||||||
('name', models.CharField(max_length=255, unique=True)),
|
('web_link', models.URLField(blank=True, null=True)),
|
||||||
('description', models.CharField(max_length=4096)),
|
('icon', models.ImageField(blank=True, null=True, upload_to='')),
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
],
|
('tags', models.ManyToManyField(blank=True, to='inventory.Tag')),
|
||||||
bases=('inventory.container',),
|
],
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Item',
|
name='Item',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
('index', models.PositiveIntegerField(verbose_name='Index of compartment in layout')),
|
('index', models.PositiveIntegerField(verbose_name='Index of compartment in layout')),
|
||||||
('name', models.TextField(max_length=255)),
|
('name', models.TextField(max_length=255)),
|
||||||
('description', models.CharField(max_length=4096)),
|
('description', models.CharField(max_length=4096)),
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
('size', models.PositiveIntegerField(default=1, help_text='Number of sub-compartments this item takes up')),
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
('distributor_item_no', models.CharField(blank=True, max_length=255, null=True)),
|
||||||
('metadata', models.JSONField(blank=True, null=True, verbose_name='Custom metadata, used by templates')),
|
('price', models.DecimalField(blank=True, decimal_places=3, max_digits=7, null=True)),
|
||||||
('distributor_item_no', models.CharField(blank=True, max_length=255, null=True)),
|
('last_ordered_on', models.DateField(blank=True, null=True)),
|
||||||
('price', models.DecimalField(blank=True, decimal_places=3, max_digits=7, null=True)),
|
('metadata', models.JSONField(blank=True, null=True, verbose_name='Custom metadata, used by templates')),
|
||||||
('last_ordered_on', models.DateField(blank=True, null=True)),
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='item_related', to='inventory.container')),
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
('distributor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.distributor')),
|
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='item_related', to='inventory.container')),
|
||||||
('documentation', models.ManyToManyField(blank=True, related_name='items', to='inventory.Documentation')),
|
('distributor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.distributor')),
|
||||||
('form_factor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.formfactor')),
|
('documentation', models.ManyToManyField(blank=True, related_name='items', to='inventory.Documentation')),
|
||||||
('manufacturer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.manufacturer')),
|
('form_factor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.formfactor')),
|
||||||
('tags', models.ManyToManyField(blank=True, to='inventory.Tag')),
|
('manufacturer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.manufacturer')),
|
||||||
],
|
('tags', models.ManyToManyField(blank=True, to='inventory.Tag')),
|
||||||
options={
|
],
|
||||||
'abstract': False,
|
options={
|
||||||
},
|
'abstract': False,
|
||||||
),
|
},
|
||||||
migrations.AddField(
|
),
|
||||||
model_name='container',
|
migrations.AddField(
|
||||||
name='layout',
|
model_name='formfactor',
|
||||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.layout'),
|
name='tags',
|
||||||
),
|
field=models.ManyToManyField(blank=True, to='inventory.Tag'),
|
||||||
migrations.CreateModel(
|
),
|
||||||
name='Box',
|
migrations.AddField(
|
||||||
fields=[
|
model_name='distributor',
|
||||||
('container_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='inventory.container')),
|
name='tags',
|
||||||
('index', models.PositiveIntegerField(verbose_name='Index of compartment in layout')),
|
field=models.ManyToManyField(blank=True, to='inventory.Tag'),
|
||||||
('name', models.CharField(max_length=255, unique=True)),
|
),
|
||||||
('description', models.CharField(max_length=4096)),
|
migrations.AddField(
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
model_name='container',
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
name='layout',
|
||||||
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='box_related', to='inventory.container')),
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.layout'),
|
||||||
],
|
),
|
||||||
options={
|
migrations.CreateModel(
|
||||||
'verbose_name_plural': 'Boxes',
|
name='Workshop',
|
||||||
},
|
fields=[
|
||||||
bases=('inventory.container', models.Model),
|
('container_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='inventory.container')),
|
||||||
),
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
migrations.CreateModel(
|
('description', models.CharField(max_length=4096)),
|
||||||
name='Area',
|
('show_boxes', models.BooleanField(default=True, help_text='Allow boxes to be defined directly in this workshop')),
|
||||||
fields=[
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
('container_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='inventory.container')),
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
('index', models.PositiveIntegerField(verbose_name='Index of compartment in layout')),
|
('tags', models.ManyToManyField(blank=True, to='inventory.Tag')),
|
||||||
('name', models.CharField(max_length=255, unique=True)),
|
],
|
||||||
('description', models.CharField(max_length=4096)),
|
bases=('inventory.container',),
|
||||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
),
|
||||||
('changed_at', models.DateTimeField(auto_now=True)),
|
migrations.CreateModel(
|
||||||
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='area_related', to='inventory.container')),
|
name='Box',
|
||||||
],
|
fields=[
|
||||||
options={
|
('container_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='inventory.container')),
|
||||||
'abstract': False,
|
('index', models.PositiveIntegerField(verbose_name='Index of compartment in layout')),
|
||||||
},
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
bases=('inventory.container', models.Model),
|
('description', models.CharField(max_length=4096)),
|
||||||
),
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
]
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
|
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='box_related', to='inventory.container')),
|
||||||
|
('tags', models.ManyToManyField(blank=True, to='inventory.Tag')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'verbose_name_plural': 'Boxes',
|
||||||
|
},
|
||||||
|
bases=('inventory.container', models.Model),
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Area',
|
||||||
|
fields=[
|
||||||
|
('container_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='inventory.container')),
|
||||||
|
('index', models.PositiveIntegerField(verbose_name='Index of compartment in layout')),
|
||||||
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
|
('description', models.CharField(max_length=4096)),
|
||||||
|
('show_sub_area', models.BooleanField(default=True, help_text='Allow sub-areas to be defined in this area')),
|
||||||
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
|
('changed_at', models.DateTimeField(auto_now=True)),
|
||||||
|
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='area_related', to='inventory.container')),
|
||||||
|
],
|
||||||
|
options={
|
||||||
|
'abstract': False,
|
||||||
|
},
|
||||||
|
bases=('inventory.container', models.Model),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
|
@ -11,6 +11,58 @@ def default_data(apps, schema_editor):
|
||||||
Layout = apps.get_model('inventory', 'Layout')
|
Layout = apps.get_model('inventory', 'Layout')
|
||||||
FormFactor = apps.get_model('inventory', 'FormFactor')
|
FormFactor = apps.get_model('inventory', 'FormFactor')
|
||||||
Distributor = apps.get_model('inventory', 'Distributor')
|
Distributor = apps.get_model('inventory', 'Distributor')
|
||||||
|
Settings = apps.get_model('inventory', 'Settings')
|
||||||
|
Tag = apps.get_model('inventory', 'Tag')
|
||||||
|
|
||||||
|
Settings.objects.create(default_container=None)
|
||||||
|
|
||||||
|
tag_smd = Tag.objects.create(name='SMD', description='SMD')
|
||||||
|
tag_tht = Tag.objects.create(name='THT', description='Through hole')
|
||||||
|
tag_imperial = Tag.objects.create(name='Imperial', description='Imperial measurements')
|
||||||
|
tag_metric = Tag.objects.create(name='Metric', description='Metric measurements')
|
||||||
|
tag_passive = Tag.objects.create(name='Passive', description='Passive part')
|
||||||
|
tag_capacitor = Tag.objects.create(name='Capacitor', description='Capacitor')
|
||||||
|
tag_electrolytic = Tag.objects.create(name='Electrolytic', description='Electrolytic capacitor')
|
||||||
|
tag_tantalum = Tag.objects.create(name='Tantalum', description='Tantalum capacitor')
|
||||||
|
tag_diode = Tag.objects.create(name='Diode', description='Diode')
|
||||||
|
tag_resistor = Tag.objects.create(name='Resistor', description='Resistor')
|
||||||
|
tag_chip = Tag.objects.create(name='Chip', description='Chip')
|
||||||
|
tag_polarized = Tag.objects.create(name='Polarized', description='Polarized part')
|
||||||
|
tag_terminals = {}
|
||||||
|
for i in range(2, 65):
|
||||||
|
if i > 10 and i % 2 != 0:
|
||||||
|
continue
|
||||||
|
tag_terminals[i] = Tag.objects.create(
|
||||||
|
name="Terminals:{}".format(i),
|
||||||
|
description='{} terminals'.format(i)
|
||||||
|
)
|
||||||
|
tag_terminals[128] = Tag.objects.create(name='Terminals:128', description='128 terminals')
|
||||||
|
|
||||||
|
pin_spacing = [
|
||||||
|
'0.4', '0.5', '0.635', '0.65', '0.8', '1.27', '1.0',
|
||||||
|
'1.78', '2.0',
|
||||||
|
'2.5', '2.29', '2.54', '3.5',
|
||||||
|
'5.0', '5.08', '7.5'
|
||||||
|
]
|
||||||
|
tag_pin_spacing = {}
|
||||||
|
for i in pin_spacing:
|
||||||
|
tag_pin_spacing[i] = Tag.objects.create(
|
||||||
|
name='PinSpacing:{}'.format(i),
|
||||||
|
description='Pin spacing {}mm'.format(i)
|
||||||
|
)
|
||||||
|
|
||||||
|
tag_row_spacing_7_62 = Tag.objects.create(name='RowSpacing:7.62', description='Row spacing 7.62mm')
|
||||||
|
tag_row_spacing_15_24 = Tag.objects.create(name='RowSpacing:15.24', description='Row spacing 15.24mm')
|
||||||
|
|
||||||
|
tag_metal_can = Tag.objects.create(name='MetalCan', description='Metal can')
|
||||||
|
tag_plastic_package = Tag.objects.create(name='PlasticPackage', description='Plastic package')
|
||||||
|
tag_panel_mount = Tag.objects.create(name='PanelMount', description='Panel mount')
|
||||||
|
tag_power_package = Tag.objects.create(name='PowerPackage', description='Power package')
|
||||||
|
|
||||||
|
tag_germany = Tag.objects.create(name='Germany', description='Germany specific')
|
||||||
|
tag_uk = Tag.objects.create(name='UK', description='United Kingdom specific')
|
||||||
|
tag_usa = Tag.objects.create(name='US', description='United States of America specific')
|
||||||
|
|
||||||
|
|
||||||
single_item_layout = Layout.objects.create(
|
single_item_layout = Layout.objects.create(
|
||||||
name='Single item',
|
name='Single item',
|
||||||
|
@ -32,481 +84,357 @@ def default_data(apps, schema_editor):
|
||||||
index=0
|
index=0
|
||||||
)
|
)
|
||||||
|
|
||||||
FormFactor.objects.bulk_create([
|
tags_passive = [tag_smd, tag_passive, tag_imperial, tag_terminals[2]]
|
||||||
# Passive SMD
|
tags_tantalum = [tag_smd, tag_capacitor, tag_tantalum, tag_metric, tag_terminals[2]]
|
||||||
FormFactor(name="2920", description="SMD, passives, imperial, 7.4×5.1mm"),
|
tags_electrolytic = [tag_smd, tag_capacitor, tag_electrolytic, tag_polarized, tag_metric, tag_terminals[2]]
|
||||||
FormFactor(name="2725", description="SMD, passives, imperial, 6.9×6.3mm"),
|
tags_diode = [tag_smd, tag_polarized, tag_terminals[2]]
|
||||||
FormFactor(name="2512", description="SMD, passives, imperial, 6.3×3.2mm"),
|
smd_2_terminal = [tag_smd, tag_terminals[2]]
|
||||||
FormFactor(name="2010", description="SMD, passives, imperial, 5.0×2.5mm"),
|
|
||||||
FormFactor(name="1812", description="SMD, passives, imperial, 4.5×6.4mm"),
|
|
||||||
FormFactor(name="1806", description="SMD, passives, imperial, 4.5×2.6mm"),
|
|
||||||
FormFactor(name="1210", description="SMD, passives, imperial, 3.2×2.5mm"),
|
|
||||||
FormFactor(name="1206", description="SMD, passives, imperial, 3.2×1.6mm"),
|
|
||||||
FormFactor(name="1008", description="SMD, passives, imperial, 2.5×2.0mm"),
|
|
||||||
FormFactor(name="0805", description="SMD, passives, imperial, 2.0×1.25mm"),
|
|
||||||
FormFactor(name="0603", description="SMD, passives, imperial, 1.6×0.8mm"),
|
|
||||||
FormFactor(name="0402", description="SMD, passives, imperial, 1.0×0.5mm"),
|
|
||||||
FormFactor(name="0201", description="SMD, passives, imperial, 0.6×0.3mm"),
|
|
||||||
|
|
||||||
# Tantalum SMD
|
def create_ff(name, description, tags):
|
||||||
FormFactor(name="EIA 2012-12", description="SMD, Tantalum, Kemet R, AVX R, 2.0×1.3×1.2mm"),
|
ff = FormFactor.objects.create(
|
||||||
FormFactor(name="EIA 3216-10", description="SMD, Tantalum, Kemet I, AVX K, 3.2×1.6×1.0mm"),
|
name=name,
|
||||||
FormFactor(name="EIA 3216-12", description="SMD, Tantalum, Kemet S, AVX S, 3.2×1.6×1.0mm"),
|
description=description
|
||||||
FormFactor(name="EIA 3216-18", description="SMD, Tantalum, Kemet A, AVX A, 3.2×1.8×1.8mm"),
|
)
|
||||||
FormFactor(name="EIA 3528-12", description="SMD, Tantalum, Kemet T, AVX T, 3.5×1.2×1.2mm"),
|
ff.tags.set(tags)
|
||||||
FormFactor(name="EIA 3528-21", description="SMD, Tantalum, Kemet B, AVX B, 3.5×2.1×2.1mm"),
|
|
||||||
FormFactor(name="EIA 6032-15", description="SMD, Tantalum, Kemet U, AVX W, 6.0×1.5×1.5mm"),
|
|
||||||
FormFactor(name="EIA 6032-28", description="SMD, Tantalum, Kemet C, AVX C, 6.0×2.8×2.8mm"),
|
|
||||||
FormFactor(name="EIA 7260-38", description="SMD, Tantalum, Kemet E, AVX V, 7.2×3.8×3.8mm"),
|
|
||||||
FormFactor(name="EIA 7343-20", description="SMD, Tantalum, Kemet V, AVX Y, 7.3×4.3×2.0mm"),
|
|
||||||
FormFactor(name="EIA 7343-31", description="SMD, Tantalum, Kemet D, AVX D, 7.3×4.3×3.1mm"),
|
|
||||||
FormFactor(name="EIA 7343-43", description="SMD, Tantalum, Kemet X, AVX E, 7.3×4.3×4.3mm"),
|
|
||||||
|
|
||||||
# Electrolyte SMD
|
def create_chip(name, min_pin, max_pin, sides=2, tags=None, aka=None):
|
||||||
FormFactor(name="Cornell A", description="SMD, Electrolyte, 3.3×3.3×5.5mm"),
|
FormFactor = apps.get_model('inventory', 'FormFactor')
|
||||||
FormFactor(name="Panasonic B", description="SMD, Electrolyte, 4.3×4.3×6.1mm"),
|
if tags is None:
|
||||||
FormFactor(name="Chemi-Con D", description="SMD, Electrolyte, 4.3×4.3×5.7mm"),
|
tags = [tag_chip]
|
||||||
FormFactor(name="Panasonic C", description="SMD, Electrolyte, 5.3×5.3×6.1mm"),
|
else:
|
||||||
FormFactor(name="Chemi-Con E", description="SMD, Electrolyte, 5.3×5.3×5.7mm"),
|
tags.append(tag_chip)
|
||||||
FormFactor(name="Panasonic D", description="SMD, Electrolyte, 6.6×6.6×6.1mm"),
|
|
||||||
FormFactor(name="Chemi-Con F", description="SMD, Electrolyte, 6.6×6.6×5.7mm"),
|
|
||||||
FormFactor(name="Panasonic E/F", description="SMD, Electrolyte, 8.3×8.3×6.5mm"),
|
|
||||||
FormFactor(name="Chemi-Con H", description="SMD, Electrolyte, 8.3×8.3×6.5mm"),
|
|
||||||
FormFactor(name="Panasonic G", description="SMD, Electrolyte, 10.3×10.3×10.5mm"),
|
|
||||||
FormFactor(name="Chemi-Con J", description="SMD, Electrolyte, 10.3×10.3×10.5mm"),
|
|
||||||
FormFactor(name="Chemi-Con K", description="SMD, Electrolyte, 13.0×13.0×14.0mm"),
|
|
||||||
FormFactor(name="Panasonic H", description="SMD, Electrolyte, 13.5×13.5×14.0mm"),
|
|
||||||
FormFactor(name="Panasonic J", description="SMD, Electrolyte, 17×17×17mm"),
|
|
||||||
FormFactor(name="Chemi-Con L", description="SMD, Electrolyte, 17×17×17mm"),
|
|
||||||
FormFactor(name="Panasonic K", description="SMD, Electrolyte, 19×19×17mm"),
|
|
||||||
FormFactor(name="Chemi-Con M", description="SMD, Electrolyte, 19×19×17mm"),
|
|
||||||
|
|
||||||
# Diodes
|
for pins in range(min_pin, max_pin + 1, sides):
|
||||||
FormFactor(name="SOD-80C", description="SMD, Diode, 3.5×⌀1.5mm"),
|
if pins > 20 and pins % 4 != 0:
|
||||||
FormFactor(name="SOD-123", description="SMD, Diode, 2.65×1.6×1.35mm"),
|
continue
|
||||||
FormFactor(name="SOD-128", description="SMD, Diode, 3.8×2.5×1.1mm"),
|
ff = FormFactor.objects.create(
|
||||||
FormFactor(name="SOD-323", description="SMD, Diode, 1.7×1.25×1.1mm"),
|
name=name.format(pins),
|
||||||
FormFactor(name="SOD-523", description="SMD, Diode, 1.2×0.8×0.65mm"),
|
description="aka. {}".format(aka.format(pins)) if aka is not None else ""
|
||||||
FormFactor(name="SOD-723", description="SMD, Diode, 1.4×0.6×0.65mm"),
|
)
|
||||||
FormFactor(name="SOD-923", description="SMD, Diode, 0.8×0.6×0.4mm"),
|
t = list(tags)
|
||||||
|
t.append(tag_terminals[pins])
|
||||||
|
ff.tags.set(t)
|
||||||
|
|
||||||
FormFactor(name="MicroMELF", description="SMD, Diode or Resistor, 2.2x⌀1.1mm"),
|
# Passive SMD
|
||||||
FormFactor(name="MiniMELF", description="SMD, aka. SOD-80 or DO-213AA, Diode or Resistor, 3.6x⌀1.4mm"),
|
create_ff("2920", "7.4×5.1mm", tags_passive)
|
||||||
FormFactor(name="MELF", description="SMD, aka. SOD-106 or DO-213AB, Diode or Resistor, 5.8x⌀2.2mm"),
|
create_ff("2725", "6.9×6.3mm", tags_passive)
|
||||||
|
create_ff("2512", "6.3×3.2mm", tags_passive)
|
||||||
|
create_ff("2010", "5.0×2.5mm", tags_passive)
|
||||||
|
create_ff("1812", "4.5×6.4mm", tags_passive)
|
||||||
|
create_ff("1806", "4.5×2.6mm", tags_passive)
|
||||||
|
create_ff("1210", "3.2×2.5mm", tags_passive)
|
||||||
|
create_ff("1206", "3.2×1.6mm", tags_passive)
|
||||||
|
create_ff("1008", "2.5×2.0mm", tags_passive)
|
||||||
|
create_ff("0805", "2.0×1.25mm",tags_passive)
|
||||||
|
create_ff("0603", "1.6×0.8mm", tags_passive)
|
||||||
|
create_ff("0402", "1.0×0.5mm", tags_passive)
|
||||||
|
create_ff("0201", "0.6×0.3mm", tags_passive)
|
||||||
|
|
||||||
FormFactor(name="DO-214AA", description="SMD, Diode, 5.4×3.6×2.65mm"),
|
# Tantalum SMD
|
||||||
FormFactor(name="DO-214AB", description="SMD, Diode, 7.95×5.9×2.25mm"),
|
create_ff("EIA 2012-12", "Kemet R, AVX R, 2.0×1.3×1.2mm", tags_tantalum)
|
||||||
FormFactor(name="DO-214AC", description="SMD, Diode, 5.2×2.6×2.15mm"),
|
create_ff("EIA 3216-10", "Kemet I, AVX K, 3.2×1.6×1.0mm", tags_tantalum)
|
||||||
|
create_ff("EIA 3216-12", "Kemet S, AVX S, 3.2×1.6×1.0mm", tags_tantalum)
|
||||||
|
create_ff("EIA 3216-18", "Kemet A, AVX A, 3.2×1.8×1.8mm", tags_tantalum)
|
||||||
|
create_ff("EIA 3528-12", "Kemet T, AVX T, 3.5×1.2×1.2mm", tags_tantalum)
|
||||||
|
create_ff("EIA 3528-21", "Kemet B, AVX B, 3.5×2.1×2.1mm", tags_tantalum)
|
||||||
|
create_ff("EIA 6032-15", "Kemet U, AVX W, 6.0×1.5×1.5mm", tags_tantalum)
|
||||||
|
create_ff("EIA 6032-28", "Kemet C, AVX C, 6.0×2.8×2.8mm", tags_tantalum)
|
||||||
|
create_ff("EIA 7260-38", "Kemet E, AVX V, 7.2×3.8×3.8mm", tags_tantalum)
|
||||||
|
create_ff("EIA 7343-20", "Kemet V, AVX Y, 7.3×4.3×2.0mm", tags_tantalum)
|
||||||
|
create_ff("EIA 7343-31", "Kemet D, AVX D, 7.3×4.3×3.1mm", tags_tantalum)
|
||||||
|
create_ff("EIA 7343-43", "Kemet X, AVX E, 7.3×4.3×4.3mm", tags_tantalum)
|
||||||
|
|
||||||
# SOT 3 terminals
|
# Electrolyte SMD
|
||||||
FormFactor(name="SOT-23-3", description="SMD, 3 terminals, 2.92×1.3×1.12mm"),
|
create_ff("Cornell A", "3.3×3.3×5.5mm", tags_electrolytic)
|
||||||
FormFactor(name="SOT-223-3", description="SMD, 3 terminals"),
|
create_ff("Panasonic B", "4.3×4.3×6.1mm", tags_electrolytic)
|
||||||
FormFactor(name="SOT-323", description="SMD, 3 terminals, 2.0×1.25×1.1mm"),
|
create_ff("Chemi-Con D", "4.3×4.3×5.7mm", tags_electrolytic)
|
||||||
FormFactor(name="SOT-416", description="SMD, 3 terminals, 1.6×0.8×0.9mm"),
|
create_ff("Panasonic C", "5.3×5.3×6.1mm", tags_electrolytic)
|
||||||
FormFactor(name="SOT-663", description="SMD, 3 terminals, 2.6×1.2×0.6mm"),
|
create_ff("Chemi-Con E", "5.3×5.3×5.7mm", tags_electrolytic)
|
||||||
FormFactor(name="SOT-723", description="SMD, 3 terminals, 1.2×0.8×0.55mm"),
|
create_ff("Panasonic D", "6.6×6.6×6.1mm", tags_electrolytic)
|
||||||
FormFactor(name="SOT-883", description="SMD, 3 terminals, 1.0×0.6×0.5mm"),
|
create_ff("Chemi-Con F", "6.6×6.6×5.7mm", tags_electrolytic)
|
||||||
|
create_ff("Panasonic E/F", "8.3×8.3×6.5mm", tags_electrolytic)
|
||||||
|
create_ff("Chemi-Con H", "8.3×8.3×6.5mm", tags_electrolytic)
|
||||||
|
create_ff("Panasonic G", "10.3×10.3×10.5mm", tags_electrolytic)
|
||||||
|
create_ff("Chemi-Con J", "10.3×10.3×10.5mm", tags_electrolytic)
|
||||||
|
create_ff("Chemi-Con K", "13.0×13.0×14.0mm", tags_electrolytic)
|
||||||
|
create_ff("Panasonic H", "13.5×13.5×14.0mm", tags_electrolytic)
|
||||||
|
create_ff("Panasonic J", "17×17×17mm", tags_electrolytic)
|
||||||
|
create_ff("Chemi-Con L", "17×17×17mm", tags_electrolytic)
|
||||||
|
create_ff("Panasonic K", "19×19×17mm", tags_electrolytic)
|
||||||
|
create_ff("Chemi-Con M", "19×19×17mm", tags_electrolytic)
|
||||||
|
|
||||||
# SOT 4 terminals
|
# Diodes
|
||||||
FormFactor(name="SOT-89", description="SMD, 4 terminals, 4.5×2.5×1.5mm"),
|
create_ff("SOD-80C", "3.5×⌀1.5mm", tags_diode)
|
||||||
FormFactor(name="SOT-143", description="SMD, 4 terminals, 2.9×1.3×1.22mm"),
|
create_ff("SOD-123", "2.65×1.6×1.35mm", tags_diode)
|
||||||
FormFactor(name="SOT-223", description="SMD, 4 terminals, 6.5×3.5×1.8mm"),
|
create_ff("SOD-128", "3.8×2.5×1.1mm", tags_diode)
|
||||||
|
create_ff("SOD-323", "1.7×1.25×1.1mm", tags_diode)
|
||||||
|
create_ff("SOD-523", "1.2×0.8×0.65mm", tags_diode)
|
||||||
|
create_ff("SOD-723", "1.4×0.6×0.65mm", tags_diode)
|
||||||
|
create_ff("SOD-923", "0.8×0.6×0.4mm", tags_diode)
|
||||||
|
|
||||||
# Power transistors/mosfets
|
create_ff("MicroMELF", "2.2x⌀1.1mm", smd_2_terminal)
|
||||||
FormFactor(name="TO-252", description="SMD, aka. DPAK, SOT-428, 3 or 5 terminals, 6.5×10.0×2.2mm"),
|
create_ff("MiniMELF", "aka. SOD-80 or DO-213AA, 3.6x⌀1.4mm", smd_2_terminal)
|
||||||
FormFactor(name="TO-263", description="SMD, aka. D2PAK, SOT-404, 3, 5, 6, 7, 8 or 9 terminals"),
|
create_ff("MELF", "aka. SOD-106 or DO-213AB, 5.8x⌀2.2mm", smd_2_terminal)
|
||||||
FormFactor(name="TO-268", description="SMD, aka. D3PAK"),
|
|
||||||
|
|
||||||
# SOT 5 terminals
|
create_ff("DO-214AA", "SMD, Diode, 5.4×3.6×2.65mm", tags_diode)
|
||||||
FormFactor(name="SOT-23-5", description="SMD, 5 terminals, 2.92×1.3×1.12mm"),
|
create_ff("DO-214AB", "SMD, Diode, 7.95×5.9×2.25mm", tags_diode)
|
||||||
FormFactor(name="SOT-353", description="SMD, 5 terminals, 2.0×1.25×0.95mm"),
|
create_ff("DO-214AC", "SMD, Diode, 5.2×2.6×2.15mm", tags_diode)
|
||||||
FormFactor(name="SOT-665", description="SMD, 5 terminals, 1.6×1.6×0.55mm"),
|
|
||||||
FormFactor(name="SOT-891", description="SMD, 5 terminals, 1.0×1.0×0.5mm"),
|
|
||||||
FormFactor(name="SOT-953", description="SMD, 5 terminals, 1.0×0.8×0.5mm"),
|
|
||||||
|
|
||||||
# 6 terminals
|
# SOT 3 terminals
|
||||||
FormFactor(name="SOT-23-6", description="SMD, 6 terminals, 2.92×1.3×1.12mm"),
|
create_ff("SOT-23-3", "2.92×1.3×1.12mm", [tag_smd, tag_chip, tag_terminals[3]])
|
||||||
FormFactor(name="SOT-363", description="SMD, 6 terminals, 2.0×1.25×0.95mm"),
|
create_ff("SOT-223-3", "", [tag_smd, tag_chip, tag_terminals[3]])
|
||||||
FormFactor(name="SOT-563", description="SMD, 6 terminals, 1.6×1.2×0.6mm"),
|
create_ff("SOT-323", "2.0×1.25×1.1mm", [tag_smd, tag_chip, tag_terminals[3]])
|
||||||
FormFactor(name="SOT-666", description="SMD, 6 terminals, 1.6×1.2×0.6mm"),
|
create_ff("SOT-416", "1.6×0.8×0.9mm", [tag_smd, tag_chip, tag_terminals[3]])
|
||||||
FormFactor(name="SOT-886", description="SMD, 6 terminals, 1.45×1.0×0.5mm"),
|
create_ff("SOT-663", "2.6×1.2×0.6mm", [tag_smd, tag_chip, tag_terminals[3]])
|
||||||
FormFactor(name="SOT-963", description="SMD, 6 terminals, 1.0×1.0×0.5mm"),
|
create_ff("SOT-723", "1.2×0.8×0.55mm", [tag_smd, tag_chip, tag_terminals[3]])
|
||||||
FormFactor(name="SOT-1115", description="SMD, 6 terminals, 1.0×0.9×0.35mm"),
|
create_ff("SOT-883", "1.0×0.6×0.5mm", [tag_smd, tag_chip, tag_terminals[3]])
|
||||||
FormFactor(name="SOT-1202", description="SMD, 6 terminals, 1.0×1.0×0.35mm"),
|
|
||||||
FormFactor(name="TSOP-6", description="SMD, 6 terminals"),
|
|
||||||
|
|
||||||
# More than 6 terminals
|
# SOT 4 terminals
|
||||||
FormFactor(name="SOIC-8", description="SMD, aka. SO-8, 8 terminals, pin spacing 1.27mm"),
|
create_ff("SOT-89", "4.5×2.5×1.5mm", [tag_smd, tag_chip, tag_terminals[4]])
|
||||||
FormFactor(name="SOIC-10", description="SMD, aka. SO-10, 10 terminals, pin spacing 1.27mm"),
|
create_ff("SOT-143", "2.9×1.3×1.22mm", [tag_smd, tag_chip, tag_terminals[4]])
|
||||||
FormFactor(name="SOIC-12", description="SMD, aka. SO-12, 12 terminals, pin spacing 1.27mm"),
|
create_ff("SOT-223", "6.5×3.5×1.8mm", [tag_smd, tag_chip, tag_terminals[4]])
|
||||||
FormFactor(name="SOIC-14", description="SMD, aka. SO-14, 14 terminals, pin spacing 1.27mm"),
|
|
||||||
FormFactor(name="SOIC-16", description="SMD, aka. SO-16, 16 terminals, pin spacing 1.27mm"),
|
|
||||||
FormFactor(name="SOIC-18", description="SMD, aka. SO-18, 18 terminals, pin spacing 1.27mm"),
|
|
||||||
FormFactor(name="SOIC-20", description="SMD, aka. SO-20, 20 terminals, pin spacing 1.27mm"),
|
|
||||||
FormFactor(name="SOIC-24", description="SMD, aka. SO-24, 24 terminals, pin spacing 1.27mm"),
|
|
||||||
FormFactor(name="SOIC-32", description="SMD, aka. SO-32, 32 terminals, pin spacing 1.27mm"),
|
|
||||||
|
|
||||||
FormFactor(name="TSOP-8", description="SMD, 8 terminals, pin spacing 0.5mm"),
|
# Power transistors/mosfets
|
||||||
FormFactor(name="TSOP-10", description="SMD, 10 terminals, pin spacing 0.5mm"),
|
create_ff("TO-252", "aka. DPAK, SOT-428, 6.5×10.0×2.2mm", [tag_smd, tag_chip, tag_power_package, tag_terminals[3], tag_terminals[5]])
|
||||||
FormFactor(name="TSOP-12", description="SMD, 12 terminals, pin spacing 0.5mm"),
|
create_ff("TO-263", "aka. D2PAK, SOT-404", [tag_smd, tag_chip, tag_power_package, tag_terminals[3], tag_terminals[5], tag_terminals[6], tag_terminals[7], tag_terminals[8], tag_terminals[9]])
|
||||||
FormFactor(name="TSOP-14", description="SMD, 14 terminals, pin spacing 0.5mm"),
|
create_ff("TO-268", "aka. D3PAK", [tag_smd, tag_chip, tag_power_package, tag_terminals[3]])
|
||||||
FormFactor(name="TSOP-16", description="SMD, 16 terminals, pin spacing 0.5mm"),
|
|
||||||
FormFactor(name="TSOP-18", description="SMD, 18 terminals, pin spacing 0.5mm"),
|
|
||||||
FormFactor(name="TSOP-20", description="SMD, 20 terminals, pin spacing 0.5mm"),
|
|
||||||
FormFactor(name="TSOP-24", description="SMD, 24 terminals, pin spacing 0.5mm"),
|
|
||||||
FormFactor(name="TSOP-32", description="SMD, 32 terminals, pin spacing 0.5mm"),
|
|
||||||
|
|
||||||
FormFactor(name="MSOP-8", description="SMD, 8 terminals, pin spacing 0.65mm, 3.0×3.0mm"),
|
# SOT 5 terminals
|
||||||
FormFactor(name="MSOP-10", description="SMD, 10 terminals, pin spacing 0.5mm, 3.0×3.0mm"),
|
create_ff("SOT-23-5", "2.92×1.3×1.12mm", [tag_smd, tag_chip, tag_terminals[5]])
|
||||||
FormFactor(name="MSOP-12", description="SMD, 12 terminals, pin spacing 0.65mm, 3.0×4.0mm"),
|
create_ff("SOT-353", "2.0×1.25×0.95mm", [tag_smd, tag_chip, tag_terminals[5]])
|
||||||
FormFactor(name="MSOP-16", description="SMD, 16 terminals, pin spacing 0.5mm, 3.0×4.0mm"),
|
create_ff("SOT-665", "1.6×1.6×0.55mm", [tag_smd, tag_chip, tag_terminals[5]])
|
||||||
|
create_ff("SOT-891", "1.0×1.0×0.5mm", [tag_smd, tag_chip, tag_terminals[5]])
|
||||||
|
create_ff("SOT-953", "1.0×0.8×0.5mm", [tag_smd, tag_chip, tag_terminals[5]])
|
||||||
|
|
||||||
FormFactor(name="SSOP-8-0.635", description="SMD, 8 terminals, pin spacing 0.635mm"),
|
# 6 terminals
|
||||||
FormFactor(name="SSOP-10-0.635", description="SMD, 10 terminals, pin spacing 0.635mm"),
|
create_ff("SOT-23-6", "2.92×1.3×1.12mm", [tag_smd, tag_chip, tag_terminals[6]])
|
||||||
FormFactor(name="SSOP-12-0.635", description="SMD, 12 terminals, pin spacing 0.635mm"),
|
create_ff("SOT-363", "2.0×1.25×0.95mm", [tag_smd, tag_chip, tag_terminals[6]])
|
||||||
FormFactor(name="SSOP-14-0.635", description="SMD, 14 terminals, pin spacing 0.635mm"),
|
create_ff("SOT-563", "1.6×1.2×0.6mm", [tag_smd, tag_chip, tag_terminals[6]])
|
||||||
FormFactor(name="SSOP-16-0.635", description="SMD, 16 terminals, pin spacing 0.635mm"),
|
create_ff("SOT-666", "1.6×1.2×0.6mm", [tag_smd, tag_chip, tag_terminals[6]])
|
||||||
FormFactor(name="SSOP-18-0.635", description="SMD, 18 terminals, pin spacing 0.635mm"),
|
create_ff("SOT-886", "1.45×1.0×0.5mm", [tag_smd, tag_chip, tag_terminals[6]])
|
||||||
FormFactor(name="SSOP-20-0.635", description="SMD, 20 terminals, pin spacing 0.635mm"),
|
create_ff("SOT-963", "1.0×1.0×0.5mm", [tag_smd, tag_chip, tag_terminals[6]])
|
||||||
FormFactor(name="SSOP-24-0.635", description="SMD, 24 terminals, pin spacing 0.635mm"),
|
create_ff("SOT-1115", "1.0×0.9×0.35mm", [tag_smd, tag_chip, tag_terminals[6]])
|
||||||
FormFactor(name="SSOP-32-0.635", description="SMD, 32 terminals, pin spacing 0.635mm"),
|
create_ff("SOT-1202", "1.0×1.0×0.35mm", [tag_smd, tag_chip, tag_terminals[6]])
|
||||||
|
create_ff("TSOP-6", "", [tag_smd, tag_chip, tag_terminals[6]])
|
||||||
|
|
||||||
FormFactor(name="SSOP-8-0.65", description="SMD, 8 terminals, pin spacing 0.65mm"),
|
# More than 6 terminals
|
||||||
FormFactor(name="SSOP-10-0.65", description="SMD, 10 terminals, pin spacing 0.65mm"),
|
create_ff("MSOP-8", "3.0×3.0mm", [tag_smd, tag_chip, tag_terminals[8], tag_pin_spacing['0.65']])
|
||||||
FormFactor(name="SSOP-12-0.65", description="SMD, 12 terminals, pin spacing 0.65mm"),
|
create_ff("MSOP-10", "3.0×3.0mm", [tag_smd, tag_chip, tag_terminals[10], tag_pin_spacing['0.5']])
|
||||||
FormFactor(name="SSOP-14-0.65", description="SMD, 14 terminals, pin spacing 0.65mm"),
|
create_ff("MSOP-12", "3.0×4.0mm", [tag_smd, tag_chip, tag_terminals[12], tag_pin_spacing['0.65']])
|
||||||
FormFactor(name="SSOP-16-0.65", description="SMD, 16 terminals, pin spacing 0.65mm"),
|
create_ff("MSOP-16", "3.0×4.0mm", [tag_smd, tag_chip, tag_terminals[16], tag_pin_spacing['0.5']])
|
||||||
FormFactor(name="SSOP-18-0.65", description="SMD, 18 terminals, pin spacing 0.65mm"),
|
|
||||||
FormFactor(name="SSOP-20-0.65", description="SMD, 20 terminals, pin spacing 0.65mm"),
|
|
||||||
FormFactor(name="SSOP-24-0.65", description="SMD, 24 terminals, pin spacing 0.65mm"),
|
|
||||||
FormFactor(name="SSOP-32-0.65", description="SMD, 32 terminals, pin spacing 0.65mm"),
|
|
||||||
|
|
||||||
FormFactor(name="SSOP-8-0.8", description="SMD, 8 terminals, pin spacing 0.8mm"),
|
create_ff("DFN-8", "", [tag_smd, tag_chip, tag_terminals[8], tag_pin_spacing['1.27']])
|
||||||
FormFactor(name="SSOP-10-0.8", description="SMD, 10 terminals, pin spacing 0.8mm"),
|
create_ff("LGA-24", "", [tag_smd, tag_chip, tag_terminals[24]])
|
||||||
FormFactor(name="SSOP-12-0.8", description="SMD, 12 terminals, pin spacing 0.8mm"),
|
|
||||||
FormFactor(name="SSOP-14-0.8", description="SMD, 14 terminals, pin spacing 0.8mm"),
|
|
||||||
FormFactor(name="SSOP-16-0.8", description="SMD, 16 terminals, pin spacing 0.8mm"),
|
|
||||||
FormFactor(name="SSOP-18-0.8", description="SMD, 18 terminals, pin spacing 0.8mm"),
|
|
||||||
FormFactor(name="SSOP-20-0.8", description="SMD, 20 terminals, pin spacing 0.8mm"),
|
|
||||||
FormFactor(name="SSOP-24-0.8", description="SMD, 24 terminals, pin spacing 0.8mm"),
|
|
||||||
FormFactor(name="SSOP-32-0.8", description="SMD, 32 terminals, pin spacing 0.8mm"),
|
|
||||||
|
|
||||||
FormFactor(name="TSSOP-8-0.5", description="SMD, 8 terminals, pin spacing 0.5mm"),
|
create_chip("SOIC-{}", 8, 40, aka="SO-{}", tags=[tag_smd, tag_pin_spacing['1.27']])
|
||||||
FormFactor(name="TSSOP-10-0.5", description="SMD, 10 terminals, pin spacing 0.5mm"),
|
create_chip("TSOP-{}", 8, 40, tags=[tag_smd, tag_pin_spacing['0.5']])
|
||||||
FormFactor(name="TSSOP-12-0.5", description="SMD, 12 terminals, pin spacing 0.5mm"),
|
create_chip("SSOP-{}-0.635", 8, 40, tags=[tag_smd, tag_pin_spacing['0.635']])
|
||||||
FormFactor(name="TSSOP-14-0.5", description="SMD, 14 terminals, pin spacing 0.5mm"),
|
create_chip("SSOP-{}-0.65", 8, 40, tags=[tag_smd, tag_pin_spacing['0.65']])
|
||||||
FormFactor(name="TSSOP-16-0.5", description="SMD, 16 terminals, pin spacing 0.5mm"),
|
create_chip("SSOP-{}-0.8", 8, 40, tags=[tag_smd, tag_pin_spacing['0.8']])
|
||||||
FormFactor(name="TSSOP-18-0.5", description="SMD, 18 terminals, pin spacing 0.5mm"),
|
create_chip("TSSOP-{}-0.5", 8, 40, tags=[tag_smd, tag_pin_spacing['0.5']])
|
||||||
FormFactor(name="TSSOP-20-0.5", description="SMD, 20 terminals, pin spacing 0.5mm"),
|
create_chip("TSSOP-{}-0.65", 8, 40, tags=[tag_smd, tag_pin_spacing['0.65']])
|
||||||
FormFactor(name="TSSOP-24-0.5", description="SMD, 24 terminals, pin spacing 0.5mm"),
|
create_chip("QSOP-{}", 8, 40, tags=[tag_smd, tag_pin_spacing['0.635']])
|
||||||
FormFactor(name="TSSOP-32-0.5", description="SMD, 32 terminals, pin spacing 0.5mm"),
|
create_chip("VSOP-{}-0.4", 8, 40, tags=[tag_smd, tag_pin_spacing['0.4']])
|
||||||
|
create_chip("VSOP-{}-0.5", 8, 40, tags=[tag_smd, tag_pin_spacing['0.5']])
|
||||||
|
create_chip("VSOP-{}-0.65", 8, 40, tags=[tag_smd, tag_pin_spacing['0.65']])
|
||||||
|
create_chip("QFP-{}", 32, 64, tags=[tag_smd], sides=4)
|
||||||
|
create_ff("QFP-128", "", [tag_smd, tag_chip, tag_terminals[128]])
|
||||||
|
create_chip("LQFP-{}", 32, 64, tags=[tag_smd], sides=4)
|
||||||
|
create_ff("LQFP-128", "", [tag_smd, tag_chip, tag_terminals[128]])
|
||||||
|
create_chip("TQFP-{}", 32, 64, tags=[tag_smd], sides=4)
|
||||||
|
create_ff("TQFP-128", "", [tag_smd, tag_chip, tag_terminals[128]])
|
||||||
|
create_chip("QFN-{}", 32, 64, tags=[tag_smd], sides=4)
|
||||||
|
create_ff("QFN-128", "", [tag_smd, tag_chip, tag_terminals[128]])
|
||||||
|
|
||||||
FormFactor(name="TSSOP-8-0.65", description="SMD, 8 terminals, pin spacing 0.65mm"),
|
# THT
|
||||||
FormFactor(name="TSSOP-10-0.65", description="SMD, 10 terminals, pin spacing 0.65mm"),
|
create_chip("DIP-{}-0.3", 8, 40, tags=[tag_smd, tag_imperial, tag_pin_spacing['2.54'], tag_row_spacing_7_62])
|
||||||
FormFactor(name="TSSOP-12-0.65", description="SMD, 12 terminals, pin spacing 0.65mm"),
|
create_chip("DIP-{}-0.6", 8, 40, tags=[tag_smd, tag_imperial, tag_pin_spacing['2.54'], tag_row_spacing_15_24])
|
||||||
FormFactor(name="TSSOP-14-0.65", description="SMD, 14 terminals, pin spacing 0.65mm"),
|
create_chip("SDIP-{}-0.3", 8, 40, tags=[tag_smd, tag_imperial, tag_pin_spacing['1.78'], tag_row_spacing_7_62])
|
||||||
FormFactor(name="TSSOP-16-0.65", description="SMD, 16 terminals, pin spacing 0.65mm"),
|
create_chip("SDIP-{}-0.6", 8, 40, tags=[tag_smd, tag_imperial, tag_pin_spacing['1.78'], tag_row_spacing_15_24])
|
||||||
FormFactor(name="TSSOP-18-0.65", description="SMD, 18 terminals, pin spacing 0.65mm"),
|
|
||||||
FormFactor(name="TSSOP-20-0.65", description="SMD, 20 terminals, pin spacing 0.65mm"),
|
|
||||||
FormFactor(name="TSSOP-24-0.65", description="SMD, 24 terminals, pin spacing 0.65mm"),
|
|
||||||
FormFactor(name="TSSOP-32-0.65", description="SMD, 32 terminals, pin spacing 0.65mm"),
|
|
||||||
|
|
||||||
FormFactor(name="QSOP-8", description="SMD, 8 terminals, pin spacing 0.635mm"),
|
# THT, Small pin counts
|
||||||
FormFactor(name="QSOP-10", description="SMD, 10 terminals, pin spacing 0.635mm"),
|
create_ff("TO-3", "mostly power transistors", [tag_tht, tag_terminals[3], tag_panel_mount, tag_metal_can])
|
||||||
FormFactor(name="QSOP-12", description="SMD, 12 terminals, pin spacing 0.635mm"),
|
create_ff("TO-5", "mostly transistors, 6.3×⌀8.9mm", [tag_tht, tag_terminals[3], tag_metal_can])
|
||||||
FormFactor(name="QSOP-14", description="SMD, 14 terminals, pin spacing 0.635mm"),
|
create_ff("TO-18", "small signal transistors, metal version of TO-92", [tag_tht, tag_terminals[3], tag_metal_can])
|
||||||
FormFactor(name="QSOP-16", description="SMD, 16 terminals, pin spacing 0.635mm"),
|
create_ff("TO-66", "mostly power transistors, smaller version of TO-3", [tag_tht, tag_terminals[3], tag_panel_mount, tag_metal_can])
|
||||||
FormFactor(name="QSOP-18", description="SMD, 18 terminals, pin spacing 0.635mm"),
|
create_ff("TO-92", "", [tag_tht, tag_terminals[3], tag_plastic_package, tag_pin_spacing['1.27']])
|
||||||
FormFactor(name="QSOP-20", description="SMD, 20 terminals, pin spacing 0.635mm"),
|
create_ff("SOD-70", "2 terminal version of TO-92, used in 5mm LED", [tag_tht, tag_polarized, tag_terminals[2], tag_plastic_package, tag_pin_spacing['2.54']])
|
||||||
FormFactor(name="QSOP-24", description="SMD, 24 terminals, pin spacing 0.635mm"),
|
create_ff("TO-126", "aka. SOT-32, with mounting hole for heatsink", [tag_tht, tag_terminals[3], tag_plastic_package, tag_power_package, tag_pin_spacing['2.54']])
|
||||||
FormFactor(name="QSOP-32", description="SMD, 32 terminals, pin spacing 0.635mm"),
|
create_ff("TO-220", "with metal backing, mounting hole in tab", [tag_tht, tag_terminals[3], tag_plastic_package, tag_power_package, tag_pin_spacing['2.54']])
|
||||||
|
create_ff("I-PAK", "mostly power mosfets", [tag_tht, tag_terminals[3], tag_plastic_package, tag_power_package, tag_pin_spacing['2.29']])
|
||||||
|
|
||||||
FormFactor(name="VSOP-8-0.4", description="SMD, 8 terminals, pin spacing 0.4mm"),
|
# THT, diodes
|
||||||
FormFactor(name="VSOP-10-0.4", description="SMD, 10 terminals, pin spacing 0.4mm"),
|
create_ff("DO-7", "mostly germanium", [tag_tht, tag_polarized, tag_terminals[2], tag_diode])
|
||||||
FormFactor(name="VSOP-12-0.4", description="SMD, 12 terminals, pin spacing 0.4mm"),
|
create_ff("DO-35", "aka. SOD-27, signal diode, 3.05 to 5.08 × ⌀1.53 to ⌀2.28 mm", [tag_tht, tag_terminals[2], tag_polarized, tag_diode])
|
||||||
FormFactor(name="VSOP-14-0.4", description="SMD, 14 terminals, pin spacing 0.4mm"),
|
create_ff("DO-41", "aka. SOD-66, rectifier diode, 4.07 to 5.20 × ⌀2.04 to ⌀2.71 mm", [tag_tht, tag_terminals[2], tag_polarized, tag_diode])
|
||||||
FormFactor(name="VSOP-16-0.4", description="SMD, 16 terminals, pin spacing 0.4mm"),
|
|
||||||
FormFactor(name="VSOP-18-0.4", description="SMD, 18 terminals, pin spacing 0.4mm"),
|
|
||||||
FormFactor(name="VSOP-20-0.4", description="SMD, 20 terminals, pin spacing 0.4mm"),
|
|
||||||
FormFactor(name="VSOP-24-0.4", description="SMD, 24 terminals, pin spacing 0.4mm"),
|
|
||||||
FormFactor(name="VSOP-32-0.4", description="SMD, 32 terminals, pin spacing 0.4mm"),
|
|
||||||
|
|
||||||
FormFactor(name="VSOP-8-0.5", description="SMD, 8 terminals, pin spacing 0.5mm"),
|
# THT, misc
|
||||||
FormFactor(name="VSOP-10-0.5", description="SMD, 10 terminals, pin spacing 0.5mm"),
|
create_ff("HC49", "HC49 quartz crystal package, comes in 2 heights", [tag_tht, tag_terminals[2]])
|
||||||
FormFactor(name="VSOP-12-0.5", description="SMD, 12 terminals, pin spacing 0.5mm"),
|
create_ff("PG-SSO-3-2", "Infineon hall effect sensors", [tag_tht, tag_terminals[3], tag_pin_spacing['1.27']])
|
||||||
FormFactor(name="VSOP-14-0.5", description="SMD, 14 terminals, pin spacing 0.5mm"),
|
create_ff("LED 5", "5mm LED", [tag_tht, tag_polarized, tag_terminals[2], tag_pin_spacing['2.54']])
|
||||||
FormFactor(name="VSOP-16-0.5", description="SMD, 16 terminals, pin spacing 0.5mm"),
|
create_ff("LED 3", "3mm LED", [tag_tht, tag_polarized, tag_terminals[2], tag_pin_spacing['1.27']])
|
||||||
FormFactor(name="VSOP-18-0.5", description="SMD, 18 terminals, pin spacing 0.5mm"),
|
|
||||||
FormFactor(name="VSOP-20-0.5", description="SMD, 20 terminals, pin spacing 0.5mm"),
|
|
||||||
FormFactor(name="VSOP-24-0.5", description="SMD, 24 terminals, pin spacing 0.5mm"),
|
|
||||||
FormFactor(name="VSOP-32-0.5", description="SMD, 32 terminals, pin spacing 0.5mm"),
|
|
||||||
|
|
||||||
FormFactor(name="VSOP-8-0.65", description="SMD, 8 terminals, pin spacing 0.65mm"),
|
# THT Raster
|
||||||
FormFactor(name="VSOP-10-0.65", description="SMD, 12 terminals, pin spacing 0.65mm"),
|
create_ff("RM 1.27", "", [tag_tht, tag_pin_spacing['1.27']])
|
||||||
FormFactor(name="VSOP-14-0.65", description="SMD, 14 terminals, pin spacing 0.65mm"),
|
create_ff("RM 2", "", [tag_tht, tag_pin_spacing['2.0']])
|
||||||
FormFactor(name="VSOP-16-0.65", description="SMD, 16 terminals, pin spacing 0.65mm"),
|
create_ff("RM 2.54", "", [tag_tht, tag_pin_spacing['2.54']])
|
||||||
FormFactor(name="VSOP-18-0.65", description="SMD, 18 terminals, pin spacing 0.65mm"),
|
create_ff("RM 3.5", "", [tag_tht, tag_pin_spacing['3.5']])
|
||||||
FormFactor(name="VSOP-20-0.65", description="SMD, 20 terminals, pin spacing 0.65mm"),
|
create_ff("RM 7.5", "", [tag_tht, tag_pin_spacing['7.5']])
|
||||||
FormFactor(name="VSOP-24-0.65", description="SMD, 24 terminals, pin spacing 0.65mm"),
|
create_ff("RM 5", "", [tag_tht, tag_pin_spacing['5.0']])
|
||||||
FormFactor(name="VSOP-32-0.65", description="SMD, 32 terminals, pin spacing 0.65mm"),
|
create_ff("RM 5.08", "", [tag_tht, tag_pin_spacing['5.08']])
|
||||||
|
|
||||||
FormFactor(name="DFN-8", description="SMD, 8 terminals, pin spacing 1.27mm"),
|
|
||||||
|
|
||||||
FormFactor(name="QFP-32", description="SMD, 32 terminals"),
|
|
||||||
FormFactor(name="QFP-44", description="SMD, 44 terminals"),
|
|
||||||
FormFactor(name="QFP-48", description="SMD, 48 terminals"),
|
|
||||||
FormFactor(name="QFP-64", description="SMD, 64 terminals"),
|
|
||||||
FormFactor(name="QFP-128", description="SMD, 128 terminals"),
|
|
||||||
|
|
||||||
FormFactor(name="LQFP-32", description="SMD, 32 terminals"),
|
|
||||||
FormFactor(name="LQFP-44", description="SMD, 44 terminals"),
|
|
||||||
FormFactor(name="LQFP-48", description="SMD, 48 terminals"),
|
|
||||||
FormFactor(name="LQFP-64", description="SMD, 64 terminals"),
|
|
||||||
FormFactor(name="LQFP-128", description="SMD, 128 terminals"),
|
|
||||||
|
|
||||||
FormFactor(name="TQFP-32", description="SMD, 32 terminals"),
|
|
||||||
FormFactor(name="TQFP-44", description="SMD, 44 terminals"),
|
|
||||||
FormFactor(name="TQFP-48", description="SMD, 48 terminals"),
|
|
||||||
FormFactor(name="TQFP-64", description="SMD, 64 terminals"),
|
|
||||||
FormFactor(name="TQFP-128", description="SMD, 128 terminals"),
|
|
||||||
|
|
||||||
FormFactor(name="QFN-16", description="SMD, 16 terminals"),
|
|
||||||
FormFactor(name="QFN-24", description="SMD, 24 terminals"),
|
|
||||||
FormFactor(name="QFN-32", description="SMD, 32 terminals"),
|
|
||||||
FormFactor(name="QFN-44", description="SMD, 44 terminals"),
|
|
||||||
FormFactor(name="QFN-48", description="SMD, 48 terminals"),
|
|
||||||
FormFactor(name="QFN-64", description="SMD, 64 terminals"),
|
|
||||||
FormFactor(name="QFN-128", description="SMD, 128 terminals"),
|
|
||||||
|
|
||||||
FormFactor(name="LGA-24", description=""),
|
|
||||||
|
|
||||||
# THT
|
|
||||||
FormFactor(name="DIP-8-0.3", description="THT, 8 terminals, pin spacing 2.54mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="DIP-14-0.3", description="THT, 14 terminals, pin spacing 2.54mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="DIP-16-0.3", description="THT, 16 terminals, pin spacing 2.54mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="DIP-18-0.3", description="THT, 18 terminals, pin spacing 2.54mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="DIP-20-0.3", description="THT, 20 terminals, pin spacing 2.54mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="DIP-24-0.3", description="THT, 24 terminals, pin spacing 2.54mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="DIP-28-0.3", description="THT, 28 terminals, pin spacing 2.54mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="DIP-32-0.3", description="THT, 32 terminals, pin spacing 2.54mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="DIP-40-0.3", description="THT, 40 terminals, pin spacing 2.54mm, row spacing 7.62mm"),
|
|
||||||
|
|
||||||
FormFactor(name="DIP-8-0.6", description="THT, 8 terminals, pin spacing 2.54mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="DIP-14-0.6", description="THT, 14 terminals, pin spacing 2.54mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="DIP-16-0.6", description="THT, 16 terminals, pin spacing 2.54mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="DIP-18-0.6", description="THT, 18 terminals, pin spacing 2.54mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="DIP-20-0.6", description="THT, 20 terminals, pin spacing 2.54mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="DIP-24-0.6", description="THT, 24 terminals, pin spacing 2.54mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="DIP-28-0.6", description="THT, 28 terminals, pin spacing 2.54mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="DIP-32-0.6", description="THT, 32 terminals, pin spacing 2.54mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="DIP-40-0.6", description="THT, 40 terminals, pin spacing 2.54mm, row spacing 15.24mm"),
|
|
||||||
|
|
||||||
FormFactor(name="SDIP-8-0.3", description="THT, 8 terminals, pin spacing 1.78mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="SDIP-14-0.3", description="THT, 14 terminals, pin spacing 1.78mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="SDIP-16-0.3", description="THT, 16 terminals, pin spacing 1.78mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="SDIP-18-0.3", description="THT, 18 terminals, pin spacing 1.78mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="SDIP-20-0.3", description="THT, 20 terminals, pin spacing 1.78mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="SDIP-24-0.3", description="THT, 24 terminals, pin spacing 1.78mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="SDIP-28-0.3", description="THT, 28 terminals, pin spacing 1.78mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="SDIP-32-0.3", description="THT, 32 terminals, pin spacing 1.78mm, row spacing 7.62mm"),
|
|
||||||
FormFactor(name="SDIP-40-0.3", description="THT, 40 terminals, pin spacing 1.78mm, row spacing 7.62mm"),
|
|
||||||
|
|
||||||
FormFactor(name="SDIP-8-0.6", description="THT, 8 terminals, pin spacing 1.78mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="SDIP-14-0.6", description="THT, 14 terminals, pin spacing 1.78mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="SDIP-16-0.6", description="THT, 16 terminals, pin spacing 1.78mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="SDIP-18-0.6", description="THT, 18 terminals, pin spacing 1.78mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="SDIP-20-0.6", description="THT, 20 terminals, pin spacing 1.78mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="SDIP-24-0.6", description="THT, 24 terminals, pin spacing 1.78mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="SDIP-28-0.6", description="THT, 28 terminals, pin spacing 1.78mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="SDIP-32-0.6", description="THT, 32 terminals, pin spacing 1.78mm, row spacing 15.24mm"),
|
|
||||||
FormFactor(name="SDIP-40-0.6", description="THT, 40 terminals, pin spacing 1.78mm, row spacing 15.24mm"),
|
|
||||||
|
|
||||||
# THT, Small pin counts
|
|
||||||
FormFactor(name="TO-3", description="THT, panel mount, metal can, mostly power transistors"),
|
|
||||||
FormFactor(name="TO-5", description="THT, metal can, mostly transistors, 6.3×⌀8.9mm"),
|
|
||||||
FormFactor(name="TO-18", description="THT, metal can, small signal transistors, metal version of TO-92"),
|
|
||||||
FormFactor(name="TO-66", description="THT, panel mount, metal can, mostly power transistors, smaller version of TO-3"),
|
|
||||||
FormFactor(name="TO-92", description="THT, plastic package, 3 terminals, pin spacing 1.27mm"),
|
|
||||||
FormFactor(name="SOD-70", description="THT, plastic package, 2 terminals, pin spacing 2.54mm, 2 terminal version of TO-92"),
|
|
||||||
FormFactor(name="TO-126", description="THT, aka. SOT-32, with mounting hole for heatsink, pin spacing 2.54mm"),
|
|
||||||
FormFactor(name="TO-220", description="THT, power package with metal backing, mounting hole in tab, pin spacing 2.54mm"),
|
|
||||||
FormFactor(name="I-PAK", description="THT, mostly power mosfets, 3 terminals, pin spacing 2.29mm"),
|
|
||||||
# THT, diodes
|
|
||||||
|
|
||||||
FormFactor(name="DO-7", description="THT, Diode, mostly germanium"),
|
|
||||||
FormFactor(name="DO-35", description="THT, aka. SOD-27, signal diode, 3.05 to 5.08 × ⌀1.53 to ⌀2.28 mm"),
|
|
||||||
FormFactor(name="DO-41", description="THT, aka. SOD-66, rectifier diode, 4.07 to 5.20 × ⌀2.04 to ⌀2.71 mm"),
|
|
||||||
|
|
||||||
|
|
||||||
FormFactor(name="HC49", description="THT, HC49 quartz crystal package, comes in 2 heights"),
|
|
||||||
FormFactor(name="PG-SSO-3-2", description="THT, Infineon hall effect sensors, 3 terminals, pin spacing 1.27mm"),
|
|
||||||
FormFactor(name="LED 5", description="THT, 5mm LED, pin spacing 1.27mm"),
|
|
||||||
FormFactor(name="LED 3", description="THT, 3mm LED, pin spacing 1.27mm"),
|
|
||||||
|
|
||||||
# THT Raster
|
|
||||||
FormFactor(name="RM 1.27", description="THT, 1.27mm Raster"),
|
|
||||||
FormFactor(name="RM 2", description="THT, 2mm Raster"),
|
|
||||||
FormFactor(name="RM 2.54", description="THT, 2.54mm Raster"),
|
|
||||||
FormFactor(name="RM 3.5", description="THT, 3.5mm Raster"),
|
|
||||||
FormFactor(name="RM 7.5", description="THT, 7.5mm Raster"),
|
|
||||||
FormFactor(name="RM 5", description="THT, 5mm Raster"),
|
|
||||||
FormFactor(name="RM 5.08", description="THT, 5.08mm Raster"),
|
|
||||||
])
|
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# - Arrow (broken webpage)
|
# - Arrow (broken webpage)
|
||||||
|
|
||||||
Distributor.objects.bulk_create([
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Reichelt",
|
||||||
name="Reichelt",
|
description="Reichelt Elektronik",
|
||||||
description="Reichelt Elektronik",
|
web_link="https://www.reichelt.de",
|
||||||
web_link="https://www.reichelt.de",
|
search_link="https://www.reichelt.de/index.html?ACTION=446&LA=0&nbc=1&q={}",
|
||||||
search_link="https://www.reichelt.de/index.html?ACTION=446&LA=0&nbc=1&q={}",
|
phone="+49 4422 955-333",
|
||||||
phone="+49 4422 955-333",
|
email="info@reichelt.de",
|
||||||
email="info@reichelt.de",
|
icon=ImageFile(open('inventory/static/inventory/img/reichelt.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/reichelt.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Amazon",
|
||||||
name="Amazon",
|
description="Amazon DE",
|
||||||
description="Amazon DE",
|
web_link="https://amazon.de",
|
||||||
web_link="https://amazon.de",
|
search_link="https://www.amazon.de/s?k={}",
|
||||||
search_link="https://www.amazon.de/s?k={}",
|
icon=ImageFile(open('inventory/static/inventory/img/amazon.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/amazon.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="AZ Delivery",
|
||||||
name="AZ Delivery",
|
description="AZ Delivery Deutschland",
|
||||||
description="AZ Delivery Deutschland",
|
web_link="https://az-delivery.de",
|
||||||
web_link="https://az-delivery.de",
|
search_link="https://az-delivery.de/de/search?type=product&q={}*",
|
||||||
search_link="https://az-delivery.de/de/search?type=product&q={}*",
|
phone="+49 991 99927827",
|
||||||
phone="+49 991 99927827",
|
email="info@az-delivery.com",
|
||||||
email="info@az-delivery.com",
|
icon=ImageFile(open('inventory/static/inventory/img/azdelivery.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/azdelivery.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="DevElektro",
|
||||||
name="DevElektro",
|
description="DevElektro, consumer branch of Farnell",
|
||||||
description="DevElektro, consumer branch of Farnell",
|
web_link="https://www.develektro.com",
|
||||||
web_link="https://www.develektro.com",
|
search_link="https://www.develektro.com/navi.php?qs={}&search=",
|
||||||
search_link="https://www.develektro.com/navi.php?qs={}&search=",
|
phone=" +49 35754 794780",
|
||||||
phone=" +49 35754 794780",
|
email="info@develektro.com",
|
||||||
email="info@develektro.com",
|
icon=ImageFile(open('inventory/static/inventory/img/develektro.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/develektro.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Watterott",
|
||||||
name="Watterott",
|
description="Watterott electronic",
|
||||||
description="Watterott electronic",
|
web_link="https://shop.watterott.com",
|
||||||
web_link="https://shop.watterott.com",
|
search_link="https://shop.watterott.com/navi.php?qs={}&search=",
|
||||||
search_link="https://shop.watterott.com/navi.php?qs={}&search=",
|
phone="+49 3605 578010",
|
||||||
phone="+49 3605 578010",
|
email="info@watterott.com",
|
||||||
email="info@watterott.com",
|
icon=ImageFile(open('inventory/static/inventory/img/watterott.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/watterott.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Ebay",
|
||||||
name="Ebay",
|
description="Ebay DE",
|
||||||
description="Ebay DE",
|
web_link="https://www.ebay.de/",
|
||||||
web_link="https://www.ebay.de/",
|
search_link="https://www.ebay.de/sch/i.html?_nkw={}&_sacat=0",
|
||||||
search_link="https://www.ebay.de/sch/i.html?_nkw={}&_sacat=0",
|
icon=ImageFile(open('inventory/static/inventory/img/ebay.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/ebay.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Farnell",
|
||||||
name="Farnell",
|
description="Farnell DE",
|
||||||
description="Farnell DE",
|
web_link="https://de.farnell.com/",
|
||||||
web_link="https://de.farnell.com/",
|
search_link="https://de.farnell.com/w/search/prl/ergebnisse?st={}",
|
||||||
search_link="https://de.farnell.com/w/search/prl/ergebnisse?st={}",
|
phone="+49 89 61 39 39 79",
|
||||||
phone="+49 89 61 39 39 79",
|
email="verkauf@farnell.com",
|
||||||
email="verkauf@farnell.com",
|
icon=ImageFile(open('inventory/static/inventory/img/farnell.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/farnell.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Mouser",
|
||||||
name="Mouser",
|
description="Mouser DE",
|
||||||
description="Mouser DE",
|
web_link="https://www.mouser.de/",
|
||||||
web_link="https://www.mouser.de/",
|
search_link="https://www.mouser.de/Search/Refine?Keyword={}",
|
||||||
search_link="https://www.mouser.de/Search/Refine?Keyword={}",
|
phone="+49 89 520 462 110 ",
|
||||||
phone="+49 89 520 462 110 ",
|
email="muenchen@mouser.com",
|
||||||
email="muenchen@mouser.com",
|
icon=ImageFile(open('inventory/static/inventory/img/mouser.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/mouser.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Digikey",
|
||||||
name="Digikey",
|
description="Digikey DE",
|
||||||
description="Digikey DE",
|
web_link="https://www.digikey.de/",
|
||||||
web_link="https://www.digikey.de/",
|
search_link="https://www.digikey.de/products/de?keywords={}",
|
||||||
search_link="https://www.digikey.de/products/de?keywords={}",
|
phone="+49 30 915 884 91",
|
||||||
phone="+49 30 915 884 91",
|
email="eu.support@digikey.com",
|
||||||
email="eu.support@digikey.com",
|
icon=ImageFile(open('inventory/static/inventory/img/digikey.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/digikey.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Conrad",
|
||||||
name="Conrad",
|
description="Conrad DE",
|
||||||
description="Conrad DE",
|
web_link="https://www.conrad.de/",
|
||||||
web_link="https://www.conrad.de/",
|
search_link="https://www.conrad.de/de/search.html?search={}",
|
||||||
search_link="https://www.conrad.de/de/search.html?search={}",
|
phone="+49 9604 40 87 87",
|
||||||
phone="+49 9604 40 87 87",
|
email="kundenservice@conrad.de",
|
||||||
email="kundenservice@conrad.de",
|
icon=ImageFile(open('inventory/static/inventory/img/conrad.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/conrad.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Adafruit",
|
||||||
name="Adafruit",
|
description="Adafruit Industries",
|
||||||
description="Adafruit Industries",
|
web_link="https://www.adafruit.com/",
|
||||||
web_link="https://www.adafruit.com/",
|
search_link="https://www.adafruit.com/?q={}&sort=BestMatch",
|
||||||
search_link="https://www.adafruit.com/?q={}&sort=BestMatch",
|
icon=ImageFile(open('inventory/static/inventory/img/adafruit.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/adafruit.png', 'rb'))
|
).tags.set([tag_usa])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="EBV Elektronik",
|
||||||
name="EBV Elektronik",
|
description="AVNet Germany",
|
||||||
description="AVNet Germany",
|
web_link="https://www.avnet.com/wps/portal/ebv/",
|
||||||
web_link="https://www.avnet.com/wps/portal/ebv/",
|
search_link="https://www.avnet.com/shop/emea/search/{}",
|
||||||
search_link="https://www.avnet.com/shop/emea/search/{}",
|
phone="+49 8121 774 0",
|
||||||
phone="+49 8121 774 0",
|
icon=ImageFile(open('inventory/static/inventory/img/ebv.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/ebv.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Pollin",
|
||||||
name="Pollin",
|
description="Pollin Elektronik",
|
||||||
description="Pollin Elektronik",
|
web_link="https://www.pollin.de/",
|
||||||
web_link="https://www.pollin.de/",
|
search_link="https://www.pollin.de/search?query={}",
|
||||||
search_link="https://www.pollin.de/search?query={}",
|
phone="+49 8403 920 920",
|
||||||
phone="+49 8403 920 920",
|
email="service@pollin.de",
|
||||||
email="service@pollin.de",
|
icon=ImageFile(open('inventory/static/inventory/img/pollin.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/pollin.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Maplin",
|
||||||
name="Maplin",
|
description="Maplin UK",
|
||||||
description="Maplin UK",
|
web_link="https://www.maplin.co.uk/",
|
||||||
web_link="https://www.maplin.co.uk/",
|
search_link="https://www.maplin.co.uk/catalogsearch/result/?q={}",
|
||||||
search_link="https://www.maplin.co.uk/catalogsearch/result/?q={}",
|
icon=ImageFile(open('inventory/static/inventory/img/maplin.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/maplin.png', 'rb'))
|
).tags.set([tag_uk])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Pimoroni",
|
||||||
name="Pimoroni",
|
description="Pimoroni",
|
||||||
description="Pimoroni",
|
web_link="https://shop.pimoroni.com/",
|
||||||
web_link="https://shop.pimoroni.com/",
|
search_link="https://shop.pimoroni.com/?q={}",
|
||||||
search_link="https://shop.pimoroni.com/?q={}",
|
icon=ImageFile(open('inventory/static/inventory/img/pimoroni.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/pimoroni.png', 'rb'))
|
).tags.set([tag_uk])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Rapid",
|
||||||
name="Rapid",
|
description="Rapid Elektronics, Conrad outlet",
|
||||||
description="Rapid Elektronics, Conrad outlet",
|
web_link="https://www.rapidonline.com/",
|
||||||
web_link="https://www.rapidonline.com/",
|
search_link="https://www.rapidonline.com/Catalogue/Search?Query={}",
|
||||||
search_link="https://www.rapidonline.com/Catalogue/Search?Query={}",
|
email="sales@rapidonline.com",
|
||||||
email="sales@rapidonline.com",
|
icon=ImageFile(open('inventory/static/inventory/img/rapid.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/rapid.png', 'rb'))
|
).tags.set([tag_uk])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="RS Components",
|
||||||
name="RS Components",
|
description="RS Components DE",
|
||||||
description="RS Components DE",
|
web_link="https://de.rs-online.com/web/",
|
||||||
web_link="https://de.rs-online.com/web/",
|
search_link="https://de.rs-online.com/web/c/?sra=oss&r=t&searchTerm={}",
|
||||||
search_link="https://de.rs-online.com/web/c/?sra=oss&r=t&searchTerm={}",
|
phone="+49 69 5800 14 234",
|
||||||
phone="+49 69 5800 14 234",
|
email="rs-gmbh@rsonline.de",
|
||||||
email="rs-gmbh@rsonline.de",
|
icon=ImageFile(open('inventory/static/inventory/img/rs.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/rs.png', 'rb'))
|
).tags.set([tag_germany])
|
||||||
),
|
Distributor.objects.create(
|
||||||
Distributor(
|
name="Sparkfun",
|
||||||
name="Sparkfun",
|
description="Sparkfun",
|
||||||
description="Sparkfun",
|
web_link="https://www.sparkfun.com/",
|
||||||
web_link="https://www.sparkfun.com/",
|
search_link="https://www.sparkfun.com/search/results?term={}",
|
||||||
search_link="https://www.sparkfun.com/search/results?term={}",
|
email="support@sparkfun.com",
|
||||||
email="support@sparkfun.com",
|
icon=ImageFile(open('inventory/static/inventory/img/sparkfun.png', 'rb'))
|
||||||
icon=ImageFile(open('inventory/static/inventory/img/sparkfun.png', 'rb'))
|
).tags.set([tag_usa])
|
||||||
),
|
|
||||||
])
|
|
||||||
|
|
||||||
Layout.objects.bulk_create([
|
Layout.objects.bulk_create([
|
||||||
Layout(
|
Layout(
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
# Generated by Django 3.1.4 on 2020-12-22 00:34
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('inventory', '0002_base_data'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='item',
|
|
||||||
name='size',
|
|
||||||
field=models.PositiveIntegerField(default=1),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,28 +0,0 @@
|
||||||
# Generated by Django 3.1.4 on 2020-12-22 18:58
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('inventory', '0003_item_size'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='area',
|
|
||||||
name='show_sub_area',
|
|
||||||
field=models.BooleanField(default=True, help_text='Allow sub-areas to be defined in this area'),
|
|
||||||
),
|
|
||||||
migrations.AddField(
|
|
||||||
model_name='workshop',
|
|
||||||
name='show_boxes',
|
|
||||||
field=models.BooleanField(default=True, help_text='Allow boxes to be defined directly in this workshop'),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name='item',
|
|
||||||
name='size',
|
|
||||||
field=models.PositiveIntegerField(default=1, help_text='Number of sub-compartments this item takes up'),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -1,27 +0,0 @@
|
||||||
# Generated by Django 3.1.4 on 2020-12-22 19:29
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
def create_settings(apps, schema_editor):
|
|
||||||
Settings = apps.get_model('inventory', 'Settings')
|
|
||||||
Settings.objects.create(default_container=None)
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
('inventory', '0004_auto_20201222_1858'),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.CreateModel(
|
|
||||||
name='Settings',
|
|
||||||
fields=[
|
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
||||||
('default_container', models.ForeignKey(blank=True, default=None, help_text='Default container to display when calling the index page', null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.container')),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
migrations.RunPython(create_settings)
|
|
||||||
]
|
|
|
@ -8,6 +8,8 @@ from .container import CanBeContained, Container
|
||||||
class Box(CanBeContained, Container):
|
class Box(CanBeContained, Container):
|
||||||
name = models.CharField(max_length=255, unique=True)
|
name = models.CharField(max_length=255, unique=True)
|
||||||
description = models.CharField(max_length=4096)
|
description = models.CharField(max_length=4096)
|
||||||
|
tags = models.ManyToManyField('inventory.Tag', blank=True)
|
||||||
|
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
changed_at = models.DateTimeField(auto_now=True)
|
changed_at = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,16 @@ from django.db import models
|
||||||
class Distributor(models.Model):
|
class Distributor(models.Model):
|
||||||
name = models.CharField(max_length=255, unique=True)
|
name = models.CharField(max_length=255, unique=True)
|
||||||
description = models.CharField(max_length=4096)
|
description = models.CharField(max_length=4096)
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
|
||||||
changed_at = models.DateTimeField(auto_now=True)
|
|
||||||
|
|
||||||
web_link = models.URLField(null=True, blank=True)
|
web_link = models.URLField(null=True, blank=True)
|
||||||
search_link = models.URLField(help_text='Use {} for search placeholder', null=True, blank=True)
|
search_link = models.URLField(help_text='Use {} for search placeholder', null=True, blank=True)
|
||||||
phone = models.CharField(max_length=128, null=True, blank=True)
|
phone = models.CharField(max_length=128, null=True, blank=True)
|
||||||
email = models.EmailField(null=True, blank=True, default=None)
|
email = models.EmailField(null=True, blank=True, default=None)
|
||||||
icon = models.ImageField(null=True, blank=True)
|
icon = models.ImageField(null=True, blank=True)
|
||||||
|
tags = models.ManyToManyField('inventory.Tag', blank=True)
|
||||||
|
|
||||||
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
|
changed_at = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
@ -4,11 +4,15 @@ from django.db import models
|
||||||
class FormFactor(models.Model):
|
class FormFactor(models.Model):
|
||||||
name = models.CharField(max_length=255, unique=True)
|
name = models.CharField(max_length=255, unique=True)
|
||||||
description = models.CharField(max_length=4096)
|
description = models.CharField(max_length=4096)
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
|
||||||
changed_at = models.DateTimeField(auto_now=True)
|
|
||||||
|
|
||||||
icon = models.ImageField(null=True, blank=True)
|
icon = models.ImageField(null=True, blank=True)
|
||||||
datasheet = models.FileField(null=True, blank=True)
|
datasheet = models.FileField(null=True, blank=True)
|
||||||
|
tags = models.ManyToManyField('inventory.Tag', blank=True)
|
||||||
|
|
||||||
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
|
changed_at = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
items = [self.name]
|
||||||
|
items.extend([tag.description for tag in self.tags.all()])
|
||||||
|
return ", ".join(items)
|
||||||
|
|
|
@ -7,12 +7,7 @@ class Item(CanBeContained):
|
||||||
name = models.TextField(max_length=255)
|
name = models.TextField(max_length=255)
|
||||||
description = models.CharField(max_length=4096)
|
description = models.CharField(max_length=4096)
|
||||||
size = models.PositiveIntegerField(default=1, help_text="Number of sub-compartments this item takes up")
|
size = models.PositiveIntegerField(default=1, help_text="Number of sub-compartments this item takes up")
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
|
||||||
changed_at = models.DateTimeField(auto_now=True)
|
|
||||||
|
|
||||||
metadata = models.JSONField('Custom metadata, used by templates', blank=True, null=True)
|
|
||||||
form_factor = models.ForeignKey('inventory.FormFactor', null=True, blank=True, on_delete=models.PROTECT)
|
form_factor = models.ForeignKey('inventory.FormFactor', null=True, blank=True, on_delete=models.PROTECT)
|
||||||
|
|
||||||
manufacturer = models.ForeignKey('inventory.Manufacturer', null=True, blank=True, on_delete=models.PROTECT)
|
manufacturer = models.ForeignKey('inventory.Manufacturer', null=True, blank=True, on_delete=models.PROTECT)
|
||||||
distributor = models.ForeignKey('inventory.Distributor', null=True, blank=True, on_delete=models.PROTECT)
|
distributor = models.ForeignKey('inventory.Distributor', null=True, blank=True, on_delete=models.PROTECT)
|
||||||
distributor_item_no = models.CharField(max_length=255, null=True, blank=True)
|
distributor_item_no = models.CharField(max_length=255, null=True, blank=True)
|
||||||
|
@ -21,5 +16,13 @@ class Item(CanBeContained):
|
||||||
documentation = models.ManyToManyField('inventory.Documentation', related_name='items', blank=True)
|
documentation = models.ManyToManyField('inventory.Documentation', related_name='items', blank=True)
|
||||||
tags = models.ManyToManyField('inventory.Tag', blank=True)
|
tags = models.ManyToManyField('inventory.Tag', blank=True)
|
||||||
|
|
||||||
|
metadata = models.JSONField('Custom metadata, used by templates', blank=True, null=True)
|
||||||
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
|
changed_at = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name + ", " + str(self.form_factor)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def all_tags(self):
|
||||||
|
return self.tags.all() + self.form_factor.tags.all()
|
||||||
|
|
|
@ -4,11 +4,13 @@ from django.db import models
|
||||||
class Manufacturer(models.Model):
|
class Manufacturer(models.Model):
|
||||||
name = models.CharField(max_length=255, unique=True)
|
name = models.CharField(max_length=255, unique=True)
|
||||||
description = models.CharField(max_length=4096, blank=True)
|
description = models.CharField(max_length=4096, blank=True)
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
|
||||||
changed_at = models.DateTimeField(auto_now=True)
|
|
||||||
|
|
||||||
web_link = models.URLField(null=True, blank=True)
|
web_link = models.URLField(null=True, blank=True)
|
||||||
icon = models.ImageField(null=True, blank=True)
|
icon = models.ImageField(null=True, blank=True)
|
||||||
|
tags = models.ManyToManyField('inventory.Tag', blank=True)
|
||||||
|
|
||||||
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
|
changed_at = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
@ -9,3 +9,6 @@ class Tag(models.Model):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
ordering = ['name', 'pk']
|
||||||
|
|
|
@ -7,6 +7,8 @@ class Workshop(Container):
|
||||||
name = models.CharField(max_length=255, unique=True)
|
name = models.CharField(max_length=255, unique=True)
|
||||||
description = models.CharField(max_length=4096)
|
description = models.CharField(max_length=4096)
|
||||||
show_boxes = models.BooleanField(default=True, help_text="Allow boxes to be defined directly in this workshop")
|
show_boxes = models.BooleanField(default=True, help_text="Allow boxes to be defined directly in this workshop")
|
||||||
|
tags = models.ManyToManyField('inventory.Tag', blank=True)
|
||||||
|
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
changed_at = models.DateTimeField(auto_now=True)
|
changed_at = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,15 @@ tr {
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cell .form_factor {
|
||||||
|
position: absolute;
|
||||||
|
display: inline;
|
||||||
|
top: 5px;
|
||||||
|
right: 5px;
|
||||||
|
font-size: xx-small;
|
||||||
|
color: #808080;
|
||||||
|
}
|
||||||
|
|
||||||
.cell a {
|
.cell a {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header_icons %}
|
{% block header_icons %}
|
||||||
|
<li>
|
||||||
|
<a href="{% url "admin:inventory_area_change" object_id=area.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
||||||
|
</li>
|
||||||
{% include 'inventory/set_index.html' with item=area is_index=is_index %}
|
{% include 'inventory/set_index.html' with item=area is_index=is_index %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -14,5 +14,8 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header_icons %}
|
{% block header_icons %}
|
||||||
|
<li>
|
||||||
|
<a href="{% url "admin:inventory_box_change" object_id=object.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
||||||
|
</li>
|
||||||
{% include 'inventory/set_index.html' with item=object is_index=is_index %}
|
{% include 'inventory/set_index.html' with item=object is_index=is_index %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
<div class="package">{{ item.metadata.package }}</div>
|
<div class="package">{{ item.metadata.package }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.documentation.all %}
|
{% if item.documentation.all %}
|
||||||
<a class="title" href="{{ item.documentation.all.0.file.url }}" {% if item.description %}title="{{ item.description }}"{% endif %}>
|
<a class="title" href="{{ item.documentation.all.0.file.url }}" {% if item.description %}title="{{ item.description }}{% if item.form_factor %}, {{ item.form_factor }}{% endif %}"{% endif %}>
|
||||||
{{ item.name | linebreaksbr }}
|
{{ item.name | linebreaksbr }}
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="title missing-link" title="{{ item.description }}">
|
<div class="title missing-link" title="{{ item.description }}{% if item.form_factor %}, {{ item.form_factor }}{% endif %}">
|
||||||
{{ item.name | linebreaksbr }}
|
{{ item.name | linebreaksbr }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -25,6 +25,9 @@
|
||||||
{% if item.price %}
|
{% if item.price %}
|
||||||
<div class="price">{{ item.price | floatformat:2 }} €</div>
|
<div class="price">{{ item.price | floatformat:2 }} €</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.form_factor %}
|
||||||
|
<div class="form_factor">{{ item.form_factor.name }}</div>
|
||||||
|
{% endif %}
|
||||||
{% if item.distributor %}
|
{% if item.distributor %}
|
||||||
<img class="shop" src="{{ item.distributor.icon.url }}" title="{{ item.distributor.name }}">
|
<img class="shop" src="{{ item.distributor.icon.url }}" title="{{ item.distributor.name }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -2,12 +2,18 @@
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load formatstring %}
|
{% load formatstring %}
|
||||||
|
|
||||||
{% block title %}{{ item.name }}{% endblock %}
|
{% block title %}{{ item }}{% endblock %}
|
||||||
|
|
||||||
{% block header_bar %}
|
{% block header_bar %}
|
||||||
<a href="{{ item.container_url }}"><img class="icon" src="{% static "inventory/img/back.svg" %}"></a>
|
<a href="{{ item.container_url }}"><img class="icon" src="{% static "inventory/img/back.svg" %}"></a>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
<span class="small">{{ item.description}}</span></h2>
|
<span class="small">{{ item.description }} {{ item.form_factor }}</span></h2>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block header_icons %}
|
||||||
|
<li>
|
||||||
|
<a href="{% url "admin:inventory_item_change" object_id=item.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
||||||
|
</li>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@ -15,7 +21,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
<td>{{ item.description }}</td>
|
<td>{{ item }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% if item.manufacturer %}
|
{% if item.manufacturer %}
|
||||||
|
@ -23,8 +29,7 @@
|
||||||
<th>Manufacturer</th>
|
<th>Manufacturer</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'manufacturer-detail' item.manufacturer.id %}">
|
<a href="{% url 'manufacturer-detail' item.manufacturer.id %}">
|
||||||
{% if item.manufacturer.icon %}<img src="{{ item.manufacturer.icon.url }}" class="icon">{% endif %}
|
{% if item.manufacturer.icon %}<img src="{{ item.manufacturer.icon.url }}" class="icon">{% endif %}{{ item.manufacturer.name }}
|
||||||
{{ item.manufacturer.name }}
|
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -35,8 +40,7 @@
|
||||||
<th>Distributor</th>
|
<th>Distributor</th>
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'distributor-detail' item.distributor.id %}">
|
<a href="{% url 'distributor-detail' item.distributor.id %}">
|
||||||
{% if item.distributor.icon %}<img src="{{ item.distributor.icon.url }}" class="icon">{% endif %}
|
{% if item.distributor.icon %}<img src="{{ item.distributor.icon.url }}" class="icon">{% endif %}{{ item.distributor.name }}
|
||||||
{{ item.distributor.name }}
|
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -55,7 +59,6 @@
|
||||||
{% if item.form_factor.icon %}<img src="{{ item.form_factor.icon.url }}" class="icon">{% endif %}
|
{% if item.form_factor.icon %}<img src="{{ item.form_factor.icon.url }}" class="icon">{% endif %}
|
||||||
{{ item.form_factor.name }}
|
{{ item.form_factor.name }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
({{ item.form_factor.description }})
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block header_icons %}
|
{% block header_icons %}
|
||||||
|
<li>
|
||||||
|
<a href="{% url "admin:inventory_workshop_change" object_id=workshop.pk %}"><img class="icon" src="{% static "inventory/img/edit.svg" %}"></a>
|
||||||
|
</li>
|
||||||
{% include 'inventory/set_index.html' with item=workshop is_index=is_index %}
|
{% include 'inventory/set_index.html' with item=workshop is_index=is_index %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue