Linting
This commit is contained in:
parent
c049512b6a
commit
90cc256ee6
8 changed files with 157 additions and 70 deletions
|
@ -1,3 +0,0 @@
|
||||||
from django.contrib import admin
|
|
||||||
|
|
||||||
# Register your models here.
|
|
|
@ -53,7 +53,6 @@ class ItemInlineAdmin(NestedStackedInline):
|
||||||
model = Item
|
model = Item
|
||||||
extra = 1
|
extra = 1
|
||||||
filter_horizontal = ('tags', 'documentation')
|
filter_horizontal = ('tags', 'documentation')
|
||||||
#inlines = [DocumentationInlineAdmin]
|
|
||||||
|
|
||||||
|
|
||||||
class BoxAdmin(NestedModelAdmin):
|
class BoxAdmin(NestedModelAdmin):
|
||||||
|
|
|
@ -31,4 +31,4 @@ class ItemAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
|
|
||||||
admin.site.register(Item, ItemAdmin)
|
admin.site.register(Item, ItemAdmin)
|
||||||
admin.site.register(Documentation, DocumentationAdmin)
|
admin.site.register(Documentation, DocumentationAdmin)
|
||||||
|
|
|
@ -15,19 +15,23 @@ class Migration(migrations.Migration):
|
||||||
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)),
|
||||||
('web_link', models.URLField(blank=True, null=True)),
|
('web_link', models.URLField(blank=True, null=True)),
|
||||||
('search_link', models.URLField(blank=True, help_text='Use {} for search placeholder', null=True)),
|
('search_link', models.URLField(blank=True,
|
||||||
|
help_text='Use {} for search placeholder', null=True)),
|
||||||
('phone', models.CharField(blank=True, max_length=128, null=True)),
|
('phone', models.CharField(blank=True, max_length=128, null=True)),
|
||||||
('email', models.EmailField(blank=True, default=None, max_length=254, null=True)),
|
('email', models.EmailField(blank=True,
|
||||||
|
default=None, max_length=254, null=True)),
|
||||||
('icon', models.ImageField(blank=True, null=True, upload_to='')),
|
('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)),
|
||||||
|
@ -36,7 +40,8 @@ class Migration(migrations.Migration):
|
||||||
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)),
|
||||||
|
@ -46,7 +51,8 @@ class Migration(migrations.Migration):
|
||||||
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)),
|
||||||
('icon', models.ImageField(blank=True, null=True, upload_to='')),
|
('icon', models.ImageField(blank=True, null=True, upload_to='')),
|
||||||
|
@ -58,19 +64,22 @@ class Migration(migrations.Migration):
|
||||||
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='Tag',
|
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(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)),
|
||||||
|
@ -80,8 +89,11 @@ class Migration(migrations.Migration):
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Settings',
|
name='Settings',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
('id', models.AutoField(auto_created=True,
|
||||||
('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')),
|
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')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name_plural': 'Settings',
|
'verbose_name_plural': 'Settings',
|
||||||
|
@ -90,7 +102,8 @@ class Migration(migrations.Migration):
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Manufacturer',
|
name='Manufacturer',
|
||||||
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(blank=True, max_length=4096)),
|
||||||
('web_link', models.URLField(blank=True, null=True)),
|
('web_link', models.URLField(blank=True, null=True)),
|
||||||
|
@ -103,22 +116,33 @@ class Migration(migrations.Migration):
|
||||||
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,
|
||||||
('index', models.PositiveIntegerField(verbose_name='Index of compartment in layout')),
|
primary_key=True, serialize=False, verbose_name='ID')),
|
||||||
|
('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)),
|
||||||
('size', models.PositiveIntegerField(default=1, help_text='Number of sub-compartments this item takes up')),
|
('size', models.PositiveIntegerField(default=1,
|
||||||
('distributor_item_no', models.CharField(blank=True, max_length=255, null=True)),
|
help_text='Number of sub-compartments this item takes up')),
|
||||||
('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)),
|
||||||
|
('price', models.DecimalField(blank=True,
|
||||||
|
decimal_places=3, max_digits=7, null=True)),
|
||||||
('last_ordered_on', models.DateField(blank=True, null=True)),
|
('last_ordered_on', models.DateField(blank=True, null=True)),
|
||||||
('metadata', models.JSONField(blank=True, null=True, verbose_name='Custom metadata, used by templates')),
|
('metadata', models.JSONField(blank=True, null=True,
|
||||||
|
verbose_name='Custom metadata, used by templates')),
|
||||||
('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)),
|
||||||
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='item_related', to='inventory.container')),
|
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE,
|
||||||
('distributor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.distributor')),
|
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,
|
||||||
('form_factor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.formfactor')),
|
on_delete=django.db.models.deletion.PROTECT, to='inventory.distributor')),
|
||||||
('manufacturer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.manufacturer')),
|
('documentation', models.ManyToManyField(blank=True,
|
||||||
|
related_name='items', to='inventory.Documentation')),
|
||||||
|
('form_factor', models.ForeignKey(blank=True, null=True,
|
||||||
|
on_delete=django.db.models.deletion.PROTECT, to='inventory.formfactor')),
|
||||||
|
('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')),
|
('tags', models.ManyToManyField(blank=True, to='inventory.Tag')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
|
@ -138,15 +162,18 @@ class Migration(migrations.Migration):
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='container',
|
model_name='container',
|
||||||
name='layout',
|
name='layout',
|
||||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.layout'),
|
field=models.ForeignKey(
|
||||||
|
blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='inventory.layout'),
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Workshop',
|
name='Workshop',
|
||||||
fields=[
|
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')),
|
('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)),
|
('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')),
|
||||||
('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')),
|
('tags', models.ManyToManyField(blank=True, to='inventory.Tag')),
|
||||||
|
@ -156,13 +183,16 @@ class Migration(migrations.Migration):
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Box',
|
name='Box',
|
||||||
fields=[
|
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')),
|
('container_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE,
|
||||||
('index', models.PositiveIntegerField(verbose_name='Index of compartment in layout')),
|
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)),
|
('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)),
|
||||||
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='box_related', to='inventory.container')),
|
('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')),
|
('tags', models.ManyToManyField(blank=True, to='inventory.Tag')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
|
@ -173,14 +203,18 @@ class Migration(migrations.Migration):
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Area',
|
name='Area',
|
||||||
fields=[
|
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')),
|
('container_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE,
|
||||||
('index', models.PositiveIntegerField(verbose_name='Index of compartment in layout')),
|
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)),
|
('name', models.CharField(max_length=255, unique=True)),
|
||||||
('description', models.CharField(max_length=4096)),
|
('description', models.CharField(max_length=4096)),
|
||||||
('show_sub_area', models.BooleanField(default=True, help_text='Allow sub-areas to be defined in this area')),
|
('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)),
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||||
('changed_at', models.DateTimeField(auto_now=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')),
|
('container', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='area_related', to='inventory.container')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
'abstract': False,
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# Generated by Django 3.1.4 on 2020-12-15 17:40
|
# Generated by Django 3.1.4 on 2020-12-15 17:40
|
||||||
|
|
||||||
from inventory.models import layout
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
from django.core.files.images import ImageFile
|
from django.core.files.images import ImageFile
|
||||||
|
|
||||||
|
@ -25,7 +24,7 @@ def default_data(apps, schema_editor):
|
||||||
tag_electrolytic = Tag.objects.create(name='Electrolytic', description='Electrolytic capacitor')
|
tag_electrolytic = Tag.objects.create(name='Electrolytic', description='Electrolytic capacitor')
|
||||||
tag_tantalum = Tag.objects.create(name='Tantalum', description='Tantalum capacitor')
|
tag_tantalum = Tag.objects.create(name='Tantalum', description='Tantalum capacitor')
|
||||||
tag_diode = Tag.objects.create(name='Diode', description='Diode')
|
tag_diode = Tag.objects.create(name='Diode', description='Diode')
|
||||||
tag_resistor = Tag.objects.create(name='Resistor', description='Resistor')
|
tag_resistor = Tag.objects.create(name='Resistor', description='Resistor') # noqa: F841
|
||||||
tag_chip = Tag.objects.create(name='Chip', description='Chip')
|
tag_chip = Tag.objects.create(name='Chip', description='Chip')
|
||||||
tag_polarized = Tag.objects.create(name='Polarized', description='Polarized part')
|
tag_polarized = Tag.objects.create(name='Polarized', description='Polarized part')
|
||||||
tag_terminals = {}
|
tag_terminals = {}
|
||||||
|
@ -63,7 +62,6 @@ def default_data(apps, schema_editor):
|
||||||
tag_uk = Tag.objects.create(name='UK', description='United Kingdom 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')
|
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',
|
||||||
description='Default layout for a single item',
|
description='Default layout for a single item',
|
||||||
|
@ -116,19 +114,19 @@ def default_data(apps, schema_editor):
|
||||||
ff.tags.set(t)
|
ff.tags.set(t)
|
||||||
|
|
||||||
# Passive SMD
|
# Passive SMD
|
||||||
create_ff("2920", "7.4×5.1mm", tags_passive)
|
create_ff("2920", "7.4×5.1mm", tags_passive)
|
||||||
create_ff("2725", "6.9×6.3mm", tags_passive)
|
create_ff("2725", "6.9×6.3mm", tags_passive)
|
||||||
create_ff("2512", "6.3×3.2mm", tags_passive)
|
create_ff("2512", "6.3×3.2mm", tags_passive)
|
||||||
create_ff("2010", "5.0×2.5mm", tags_passive)
|
create_ff("2010", "5.0×2.5mm", tags_passive)
|
||||||
create_ff("1812", "4.5×6.4mm", tags_passive)
|
create_ff("1812", "4.5×6.4mm", tags_passive)
|
||||||
create_ff("1806", "4.5×2.6mm", tags_passive)
|
create_ff("1806", "4.5×2.6mm", tags_passive)
|
||||||
create_ff("1210", "3.2×2.5mm", tags_passive)
|
create_ff("1210", "3.2×2.5mm", tags_passive)
|
||||||
create_ff("1206", "3.2×1.6mm", tags_passive)
|
create_ff("1206", "3.2×1.6mm", tags_passive)
|
||||||
create_ff("1008", "2.5×2.0mm", tags_passive)
|
create_ff("1008", "2.5×2.0mm", tags_passive)
|
||||||
create_ff("0805", "2.0×1.25mm",tags_passive)
|
create_ff("0805", "2.0×1.25mm", tags_passive)
|
||||||
create_ff("0603", "1.6×0.8mm", tags_passive)
|
create_ff("0603", "1.6×0.8mm", tags_passive)
|
||||||
create_ff("0402", "1.0×0.5mm", tags_passive)
|
create_ff("0402", "1.0×0.5mm", tags_passive)
|
||||||
create_ff("0201", "0.6×0.3mm", tags_passive)
|
create_ff("0201", "0.6×0.3mm", tags_passive)
|
||||||
|
|
||||||
# Tantalum SMD
|
# Tantalum SMD
|
||||||
create_ff("EIA 2012-12", "Kemet R, AVX R, 2.0×1.3×1.2mm", tags_tantalum)
|
create_ff("EIA 2012-12", "Kemet R, AVX R, 2.0×1.3×1.2mm", tags_tantalum)
|
||||||
|
@ -195,8 +193,24 @@ def default_data(apps, schema_editor):
|
||||||
create_ff("SOT-223", "6.5×3.5×1.8mm", [tag_smd, tag_chip, tag_terminals[4]])
|
create_ff("SOT-223", "6.5×3.5×1.8mm", [tag_smd, tag_chip, tag_terminals[4]])
|
||||||
|
|
||||||
# Power transistors/mosfets
|
# Power transistors/mosfets
|
||||||
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]])
|
create_ff("TO-252", "aka. DPAK, SOT-428, 6.5×10.0×2.2mm", [
|
||||||
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]])
|
tag_smd,
|
||||||
|
tag_chip,
|
||||||
|
tag_power_package,
|
||||||
|
tag_terminals[3],
|
||||||
|
tag_terminals[5]
|
||||||
|
])
|
||||||
|
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]
|
||||||
|
])
|
||||||
create_ff("TO-268", "aka. D3PAK", [tag_smd, tag_chip, tag_power_package, tag_terminals[3]])
|
create_ff("TO-268", "aka. D3PAK", [tag_smd, tag_chip, tag_power_package, tag_terminals[3]])
|
||||||
|
|
||||||
# SOT 5 terminals
|
# SOT 5 terminals
|
||||||
|
@ -256,17 +270,56 @@ def default_data(apps, schema_editor):
|
||||||
create_ff("TO-3", "mostly power transistors", [tag_tht, tag_terminals[3], tag_panel_mount, tag_metal_can])
|
create_ff("TO-3", "mostly power transistors", [tag_tht, tag_terminals[3], tag_panel_mount, tag_metal_can])
|
||||||
create_ff("TO-5", "mostly transistors, 6.3×⌀8.9mm", [tag_tht, tag_terminals[3], tag_metal_can])
|
create_ff("TO-5", "mostly transistors, 6.3×⌀8.9mm", [tag_tht, tag_terminals[3], tag_metal_can])
|
||||||
create_ff("TO-18", "small signal transistors, metal version of TO-92", [tag_tht, tag_terminals[3], tag_metal_can])
|
create_ff("TO-18", "small signal transistors, metal version of TO-92", [tag_tht, tag_terminals[3], tag_metal_can])
|
||||||
create_ff("TO-66", "mostly power transistors, smaller version of TO-3", [tag_tht, tag_terminals[3], tag_panel_mount, tag_metal_can])
|
create_ff("TO-66", "mostly power transistors, smaller version of TO-3", [
|
||||||
|
tag_tht,
|
||||||
|
tag_terminals[3],
|
||||||
|
tag_panel_mount,
|
||||||
|
tag_metal_can
|
||||||
|
])
|
||||||
create_ff("TO-92", "", [tag_tht, tag_terminals[3], tag_plastic_package, tag_pin_spacing['1.27']])
|
create_ff("TO-92", "", [tag_tht, tag_terminals[3], tag_plastic_package, tag_pin_spacing['1.27']])
|
||||||
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']])
|
create_ff("SOD-70", "2 terminal version of TO-92, used in 5mm LED", [
|
||||||
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']])
|
tag_tht,
|
||||||
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']])
|
tag_polarized,
|
||||||
create_ff("I-PAK", "mostly power mosfets", [tag_tht, tag_terminals[3], tag_plastic_package, tag_power_package, tag_pin_spacing['2.29']])
|
tag_terminals[2],
|
||||||
|
tag_plastic_package,
|
||||||
|
tag_pin_spacing['2.54']
|
||||||
|
])
|
||||||
|
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']
|
||||||
|
])
|
||||||
|
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']
|
||||||
|
])
|
||||||
|
|
||||||
# THT, diodes
|
# THT, diodes
|
||||||
create_ff("DO-7", "mostly germanium", [tag_tht, tag_polarized, tag_terminals[2], tag_diode])
|
create_ff("DO-7", "mostly germanium", [tag_tht, tag_polarized, tag_terminals[2], tag_diode])
|
||||||
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])
|
create_ff("DO-35", "aka. SOD-27, signal diode, 3.05 to 5.08 × ⌀1.53 to ⌀2.28 mm", [
|
||||||
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])
|
tag_tht,
|
||||||
|
tag_terminals[2],
|
||||||
|
tag_polarized,
|
||||||
|
tag_diode
|
||||||
|
])
|
||||||
|
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
|
||||||
|
])
|
||||||
|
|
||||||
# THT, misc
|
# THT, misc
|
||||||
create_ff("HC49", "HC49 quartz crystal package, comes in 2 heights", [tag_tht, tag_terminals[2]])
|
create_ff("HC49", "HC49 quartz crystal package, comes in 2 heights", [tag_tht, tag_terminals[2]])
|
||||||
|
@ -450,7 +503,7 @@ def default_data(apps, schema_editor):
|
||||||
data=[
|
data=[
|
||||||
[1, 1, 1, 1, 1, 1],
|
[1, 1, 1, 1, 1, 1],
|
||||||
[2, 1, 1, 1, 1, 1],
|
[2, 1, 1, 1, 1, 1],
|
||||||
[ 1, 1, 1, 1, 1]
|
[ 1, 1, 1, 1, 1] # noqa: E201
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -511,7 +564,7 @@ def default_data(apps, schema_editor):
|
||||||
[3, 3, 3, 3],
|
[3, 3, 3, 3],
|
||||||
[3, 3, 3, 3],
|
[3, 3, 3, 3],
|
||||||
[3, 3, 3],
|
[3, 3, 3],
|
||||||
[ 3 ]
|
[ 3 ] # noqa: E201, E202
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
Layout(
|
Layout(
|
||||||
|
@ -650,7 +703,7 @@ def default_data(apps, schema_editor):
|
||||||
description="Ikea Sorter, 34x21cm, 5 compartments",
|
description="Ikea Sorter, 34x21cm, 5 compartments",
|
||||||
data=[
|
data=[
|
||||||
[2, 3],
|
[2, 3],
|
||||||
[ 1, 1, 1]
|
[ 1, 1, 1] # noqa: E201
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
Layout(
|
Layout(
|
||||||
|
|
|
@ -2,6 +2,7 @@ from django import template
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag(name='formatstring')
|
@register.simple_tag(name='formatstring')
|
||||||
def formatstring(value, *args):
|
def formatstring(value, *args):
|
||||||
return value.format(*args)
|
return value.format(*args)
|
||||||
|
|
|
@ -132,10 +132,10 @@ USE_TZ = True
|
||||||
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static')
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||||
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
||||||
|
|
||||||
|
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'media')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||||
SERVE_MEDIA_FILES = DEBUG
|
SERVE_MEDIA_FILES = DEBUG
|
||||||
|
|
|
@ -22,3 +22,6 @@ pylint = "*"
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry>=0.12"]
|
requires = ["poetry>=0.12"]
|
||||||
build-backend = "poetry.masonry.api"
|
build-backend = "poetry.masonry.api"
|
||||||
|
|
||||||
|
[tool.pylint]
|
||||||
|
max-line-length=120
|
Loading…
Reference in a new issue