Compare commits
5 Commits
8b90fe17fe
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3345edf71f | |||
| c416758e82 | |||
| 932b36c530 | |||
| dea9befd24 | |||
| b266d044cc |
0
techdb/catops/__init__.py
Normal file
0
techdb/catops/__init__.py
Normal file
21
techdb/catops/admin.py
Normal file
21
techdb/catops/admin.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.contrib import admin
|
||||
from .models.box import Box, BoxAdmin
|
||||
from .models.part import Part, PartAdmin
|
||||
from .models.vendor import Vendor, VendorAdmin
|
||||
from .models.formone import FormOne,FormOneAdmin
|
||||
from .models.customer import Customer, CustomerAdmin
|
||||
from .models.plane import Plane, PlaneAdmin
|
||||
from .models.workorder import Workorder, WorkorderAdmin
|
||||
from .models.operator import Operator, OperatorAdmin
|
||||
from .models.movimag import Movimag, MovimagAdmin
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(Box, BoxAdmin)
|
||||
admin.site.register(Part, PartAdmin)
|
||||
admin.site.register(Vendor, VendorAdmin)
|
||||
admin.site.register(FormOne,FormOneAdmin)
|
||||
admin.site.register(Customer, CustomerAdmin)
|
||||
admin.site.register(Plane, PlaneAdmin)
|
||||
admin.site.register(Workorder, WorkorderAdmin)
|
||||
admin.site.register(Operator, OperatorAdmin)
|
||||
admin.site.register(Movimag, MovimagAdmin)
|
||||
6
techdb/catops/apps.py
Normal file
6
techdb/catops/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CatopsConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'catops'
|
||||
20
techdb/catops/migrations/0001_initial.py
Normal file
20
techdb/catops/migrations/0001_initial.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 5.1.2 on 2024-10-18 09:46
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Parts',
|
||||
fields=[
|
||||
('id', models.UUIDField(primary_key=True, serialize=False)),
|
||||
],
|
||||
),
|
||||
]
|
||||
17
techdb/catops/migrations/0002_rename_parts_part.py
Normal file
17
techdb/catops/migrations/0002_rename_parts_part.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 5.1.2 on 2024-10-18 09:55
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catops', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameModel(
|
||||
old_name='Parts',
|
||||
new_name='Part',
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,101 @@
|
||||
# Generated by Django 5.1.2 on 2024-10-18 15:45
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.db.models.functions.datetime
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catops', '0002_rename_parts_part'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='FormOne',
|
||||
fields=[
|
||||
('reg_date', models.DateTimeField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('external_id', models.CharField(db_index=True, null=True)),
|
||||
('doc_path', models.FilePathField(null=True)),
|
||||
('active', models.BooleanField(db_default=True)),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='active',
|
||||
field=models.BooleanField(db_default=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='expiry_time',
|
||||
field=models.DurationField(null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='last_stock',
|
||||
field=models.DateField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='min_reorder',
|
||||
field=models.PositiveIntegerField(null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='part_number',
|
||||
field=models.CharField(db_index=True, default='aaa', max_length=64, unique=True),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='properties',
|
||||
field=models.JSONField(null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='quantity',
|
||||
field=models.PositiveIntegerField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='reg_date',
|
||||
field=models.DateTimeField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='serial_number',
|
||||
field=models.CharField(db_index=True, max_length=64, null=True, unique=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='unit',
|
||||
field=models.CharField(choices=[('QTY', 'Quantity'), ('LT', 'Liters'), ('USG', 'US Gallons'), ('QTS', 'US Quarters'), ('KG', 'Kilograms'), ('LBS', 'Pounds')], default='QTY'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='part',
|
||||
name='id',
|
||||
field=models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Box',
|
||||
fields=[
|
||||
('reg_date', models.DateTimeField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False)),
|
||||
('id', models.UUIDField(db_index=True, default=uuid.uuid1, editable=False, primary_key=True, serialize=False)),
|
||||
('loc_room', models.CharField(choices=[('ST1', 'Magazzino'), ('ST2', 'Deposito Esterno')], default='ST1', max_length=3)),
|
||||
('loc_x', models.CharField(max_length=4)),
|
||||
('loc_y', models.CharField(max_length=4)),
|
||||
('loc_z', models.CharField(max_length=4)),
|
||||
('active', models.BooleanField(db_default=True)),
|
||||
('label_printed', models.BooleanField(db_default=False)),
|
||||
('part', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='catops.part')),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='part',
|
||||
name='form_one',
|
||||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='catops.formone'),
|
||||
),
|
||||
]
|
||||
22
techdb/catops/migrations/0004_vendor.py
Normal file
22
techdb/catops/migrations/0004_vendor.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Generated by Django 5.1.2 on 2024-10-18 15:45
|
||||
|
||||
import django.db.models.functions.datetime
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catops', '0003_formone_part_active_part_expiry_time_part_last_stock_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Vendor',
|
||||
fields=[
|
||||
('reg_date', models.DateTimeField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False)),
|
||||
('id', models.UUIDField(primary_key=True, serialize=False)),
|
||||
('active', models.BooleanField(db_default=True)),
|
||||
],
|
||||
),
|
||||
]
|
||||
26
techdb/catops/migrations/0005_customer.py
Normal file
26
techdb/catops/migrations/0005_customer.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 5.1.2 on 2024-10-18 15:45
|
||||
|
||||
import django.db.models.functions.datetime
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catops', '0004_vendor'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Customer',
|
||||
fields=[
|
||||
('reg_date', models.DateTimeField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=32)),
|
||||
('surname', models.CharField(max_length=32)),
|
||||
('external_id', models.CharField(db_index=True, null=True)),
|
||||
('properties', models.JSONField(null=True)),
|
||||
('active', models.BooleanField(db_default=True)),
|
||||
],
|
||||
),
|
||||
]
|
||||
30
techdb/catops/migrations/0006_plane.py
Normal file
30
techdb/catops/migrations/0006_plane.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Generated by Django 5.1.2 on 2024-10-18 15:46
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.db.models.functions.datetime
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catops', '0005_customer'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Plane',
|
||||
fields=[
|
||||
('reg_date', models.DateTimeField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('tail', models.CharField(max_length=6)),
|
||||
('manufacturer', models.CharField(max_length=32)),
|
||||
('model', models.CharField(max_length=32)),
|
||||
('chassis_num', models.CharField(max_length=32)),
|
||||
('external_id', models.CharField(db_index=True, null=True)),
|
||||
('properties', models.JSONField(null=True)),
|
||||
('active', models.BooleanField(db_default=True)),
|
||||
('customer', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='catops.customer')),
|
||||
],
|
||||
),
|
||||
]
|
||||
41
techdb/catops/migrations/0007_operator_workorder.py
Normal file
41
techdb/catops/migrations/0007_operator_workorder.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# Generated by Django 5.1.2 on 2024-10-18 15:47
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.db.models.functions.datetime
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catops', '0006_plane'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Operator',
|
||||
fields=[
|
||||
('reg_date', models.DateTimeField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=32)),
|
||||
('surname', models.CharField(max_length=32)),
|
||||
('external_id', models.CharField(db_index=True, null=True)),
|
||||
('properties', models.JSONField(null=True)),
|
||||
('active', models.BooleanField(db_default=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Workorder',
|
||||
fields=[
|
||||
('reg_date', models.DateTimeField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('date_begin', models.DateTimeField(db_default=django.db.models.functions.datetime.Now())),
|
||||
('date_end', models.DateTimeField()),
|
||||
('external_id', models.CharField(db_index=True, max_length=32, null=True)),
|
||||
('properties', models.JSONField(null=True)),
|
||||
('active', models.BooleanField(db_default=True)),
|
||||
('operator', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='catops.operator')),
|
||||
('plane', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='catops.plane')),
|
||||
],
|
||||
),
|
||||
]
|
||||
26
techdb/catops/migrations/0008_movimag.py
Normal file
26
techdb/catops/migrations/0008_movimag.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 5.1.2 on 2024-10-18 15:47
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.db.models.functions.datetime
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('catops', '0007_operator_workorder'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Movimag',
|
||||
fields=[
|
||||
('mov_datetime', models.DateTimeField(auto_created=True, db_default=django.db.models.functions.datetime.Now(), editable=False)),
|
||||
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('direction', models.CharField(choices=[('LOAD', 'Load'), ('UNLOAD', 'UnLoad')])),
|
||||
('operator', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='catops.operator')),
|
||||
('part', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='catops.part')),
|
||||
('workorder', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='catops.workorder')),
|
||||
],
|
||||
),
|
||||
]
|
||||
0
techdb/catops/migrations/__init__.py
Normal file
0
techdb/catops/migrations/__init__.py
Normal file
0
techdb/catops/misc/__init__.py
Normal file
0
techdb/catops/misc/__init__.py
Normal file
19
techdb/catops/misc/units.py
Normal file
19
techdb/catops/misc/units.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
class RoomLocation(models.TextChoices):
|
||||
STORAGE_1 = "ST1", _("Magazzino")
|
||||
STORAGE_2 = "ST2", _("Deposito Esterno")
|
||||
|
||||
class Units(models.TextChoices):
|
||||
NUM = "QTY", _("Quantity")
|
||||
LT = "LT", _("Liters")
|
||||
USG = "USG", _("US Gallons")
|
||||
QTS = "QTS", _("US Quarters")
|
||||
KG = "KG", _("Kilograms")
|
||||
LBS = "LBS", _("Pounds")
|
||||
|
||||
class MoviDirection(models.TextChoices):
|
||||
LOAD = "LOAD", _("Load")
|
||||
UNLOAD = "UNLOAD", _("UnLoad")
|
||||
|
||||
0
techdb/catops/models/__init__.py
Normal file
0
techdb/catops/models/__init__.py
Normal file
69
techdb/catops/models/box.py
Normal file
69
techdb/catops/models/box.py
Normal file
@@ -0,0 +1,69 @@
|
||||
import uuid
|
||||
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
from .part import Part
|
||||
from ..misc.units import RoomLocation
|
||||
|
||||
# Box identifies a part storage location, it can be a drawer or a bag or a carbord box.
|
||||
# It has a location and one or multiple parts inside it.
|
||||
|
||||
# Properties to visualize the Box model in the Django admin view
|
||||
class BoxAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "loc_room", "loc_x", "loc_y", "loc_z", "reg_date", "active")
|
||||
list_filter = ["loc_room"]
|
||||
|
||||
class Box(models.Model):
|
||||
id = models.UUIDField(
|
||||
primary_key=True,
|
||||
default=uuid.uuid1,
|
||||
db_index=True,
|
||||
editable=False,
|
||||
serialize=str,
|
||||
)
|
||||
|
||||
reg_date = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now(),
|
||||
)
|
||||
|
||||
loc_room = models.CharField(
|
||||
max_length=3,
|
||||
choices=RoomLocation,
|
||||
default=RoomLocation.STORAGE_1,
|
||||
null=False,
|
||||
)
|
||||
|
||||
loc_x = models.CharField(
|
||||
max_length=4,
|
||||
)
|
||||
|
||||
loc_y = models.CharField(
|
||||
max_length=4,
|
||||
)
|
||||
|
||||
loc_z = models.CharField(
|
||||
max_length=4,
|
||||
)
|
||||
|
||||
active = models.BooleanField(
|
||||
db_default=True
|
||||
)
|
||||
|
||||
label_printed = models.BooleanField(
|
||||
db_default=False,
|
||||
)
|
||||
|
||||
part = models.OneToOneField(
|
||||
Part,
|
||||
unique=True,
|
||||
db_index=True,
|
||||
swappable=True,
|
||||
null=True,
|
||||
on_delete=models.CASCADE,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return f"{str(self.id)}"
|
||||
39
techdb/catops/models/customer.py
Normal file
39
techdb/catops/models/customer.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
|
||||
class CustomerAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = []
|
||||
|
||||
class Customer(models.Model):
|
||||
id = models.BigAutoField(
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
reg_date = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
name = models.CharField(
|
||||
max_length=32
|
||||
)
|
||||
|
||||
surname = models.CharField(
|
||||
max_length=32
|
||||
)
|
||||
|
||||
external_id = models.CharField(
|
||||
db_index=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
properties = models.JSONField(
|
||||
null=True
|
||||
)
|
||||
|
||||
active = models.BooleanField(
|
||||
db_default=True
|
||||
)
|
||||
31
techdb/catops/models/formone.py
Normal file
31
techdb/catops/models/formone.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
|
||||
class FormOneAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = []
|
||||
|
||||
class FormOne(models.Model):
|
||||
id = models.BigAutoField(
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
reg_date = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
external_id = models.CharField(
|
||||
db_index=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
doc_path = models.FilePathField(
|
||||
null=True
|
||||
)
|
||||
|
||||
active = models.BooleanField(
|
||||
db_default=True
|
||||
)
|
||||
43
techdb/catops/models/movimag.py
Normal file
43
techdb/catops/models/movimag.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
|
||||
from .part import Part
|
||||
from .operator import Operator
|
||||
from .workorder import Workorder
|
||||
from ..misc import units
|
||||
|
||||
class MovimagAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = []
|
||||
|
||||
class Movimag(models.Model):
|
||||
id = models.BigAutoField(
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
mov_datetime = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
part = models.ForeignKey(
|
||||
Part,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
workorder = models.ForeignKey(
|
||||
Workorder,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
operator = models.ForeignKey(
|
||||
Operator,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
direction = models.CharField(
|
||||
null=False,
|
||||
choices=units.MoviDirection
|
||||
)
|
||||
39
techdb/catops/models/operator.py
Normal file
39
techdb/catops/models/operator.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
|
||||
class OperatorAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = ()
|
||||
|
||||
class Operator(models.Model):
|
||||
id = models.BigAutoField(
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
reg_date = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
name = models.CharField(
|
||||
max_length=32
|
||||
)
|
||||
|
||||
surname = models.CharField(
|
||||
max_length=32
|
||||
)
|
||||
|
||||
external_id = models.CharField(
|
||||
db_index=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
properties = models.JSONField(
|
||||
null=True
|
||||
)
|
||||
|
||||
active = models.BooleanField(
|
||||
db_default=True
|
||||
)
|
||||
87
techdb/catops/models/part.py
Normal file
87
techdb/catops/models/part.py
Normal file
@@ -0,0 +1,87 @@
|
||||
import uuid
|
||||
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from ..misc.units import Units
|
||||
from .formone import FormOne
|
||||
|
||||
# Part identifies a part with its part number and associated properties:
|
||||
# such as torage quantity, min reorder quantities and expiry date.
|
||||
|
||||
class PartAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = ()
|
||||
|
||||
class Part(models.Model):
|
||||
id = models.UUIDField(
|
||||
primary_key=True,
|
||||
default=uuid.uuid4,
|
||||
db_index=True,
|
||||
editable=False,
|
||||
serialize=str
|
||||
)
|
||||
|
||||
reg_date = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
part_number = models.CharField(
|
||||
db_index=True,
|
||||
max_length=64,
|
||||
null=False,
|
||||
unique=True
|
||||
)
|
||||
|
||||
serial_number = models.CharField(
|
||||
db_index=True,
|
||||
max_length=64,
|
||||
null=True,
|
||||
unique=True
|
||||
)
|
||||
|
||||
quantity = models.PositiveIntegerField(
|
||||
null=False,
|
||||
default=0
|
||||
)
|
||||
|
||||
unit = models.CharField(
|
||||
choices=Units,
|
||||
default=Units.NUM,
|
||||
null=False
|
||||
)
|
||||
|
||||
last_stock = models.DateField(
|
||||
null=False,
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
expiry_time = models.DurationField(
|
||||
null=True,
|
||||
)
|
||||
|
||||
min_reorder = models.PositiveIntegerField(
|
||||
null=True
|
||||
)
|
||||
|
||||
properties = models.JSONField(
|
||||
null=True
|
||||
)
|
||||
|
||||
form_one = models.OneToOneField(
|
||||
FormOne,
|
||||
on_delete=models.DO_NOTHING,
|
||||
db_index=True,
|
||||
unique=True,
|
||||
null=True
|
||||
)
|
||||
|
||||
active = models.BooleanField(
|
||||
db_default=True
|
||||
)
|
||||
59
techdb/catops/models/plane.py
Normal file
59
techdb/catops/models/plane.py
Normal file
@@ -0,0 +1,59 @@
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
|
||||
from .customer import Customer
|
||||
|
||||
class PlaneAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = []
|
||||
|
||||
class Plane(models.Model):
|
||||
id = models.BigAutoField(
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
reg_date = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
tail = models.CharField(
|
||||
max_length=6,
|
||||
null=False
|
||||
)
|
||||
|
||||
manufacturer = models.CharField(
|
||||
max_length=32,
|
||||
null=False
|
||||
)
|
||||
|
||||
model = models.CharField(
|
||||
max_length=32,
|
||||
null=False
|
||||
)
|
||||
|
||||
chassis_num = models.CharField(
|
||||
max_length=32,
|
||||
null=False
|
||||
)
|
||||
|
||||
external_id = models.CharField(
|
||||
db_index=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
customer = models.ForeignKey(
|
||||
Customer,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
properties = models.JSONField(
|
||||
null=True
|
||||
)
|
||||
|
||||
active = models.BooleanField(
|
||||
db_default=True
|
||||
)
|
||||
|
||||
23
techdb/catops/models/vendor.py
Normal file
23
techdb/catops/models/vendor.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import uuid
|
||||
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
|
||||
class VendorAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = ()
|
||||
|
||||
class Vendor(models.Model):
|
||||
id = models.UUIDField(primary_key=True)
|
||||
|
||||
reg_date = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
active = models.BooleanField(
|
||||
db_default=True
|
||||
)
|
||||
|
||||
54
techdb/catops/models/workorder.py
Normal file
54
techdb/catops/models/workorder.py
Normal file
@@ -0,0 +1,54 @@
|
||||
from django.db import models
|
||||
from django.contrib import admin
|
||||
from django.db.models.functions import Now
|
||||
|
||||
from .plane import Plane
|
||||
from .operator import Operator
|
||||
|
||||
class WorkorderAdmin(admin.ModelAdmin):
|
||||
list_display = ()
|
||||
list_filter = []
|
||||
|
||||
class Workorder(models.Model):
|
||||
id = models.BigAutoField(
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
reg_date = models.DateTimeField(
|
||||
auto_created=True,
|
||||
editable=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
date_begin = models.DateTimeField(
|
||||
null=False,
|
||||
db_default=Now()
|
||||
)
|
||||
|
||||
date_end = models.DateTimeField(
|
||||
null=False
|
||||
)
|
||||
|
||||
external_id = models.CharField(
|
||||
max_length=32,
|
||||
db_index=True,
|
||||
null=True,
|
||||
)
|
||||
|
||||
plane = models.ForeignKey(
|
||||
Plane,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
operator = models.ForeignKey(
|
||||
Operator,
|
||||
on_delete=models.DO_NOTHING
|
||||
)
|
||||
|
||||
properties = models.JSONField(
|
||||
null=True
|
||||
)
|
||||
|
||||
active = models.BooleanField(
|
||||
db_default=True
|
||||
)
|
||||
3
techdb/catops/tests.py
Normal file
3
techdb/catops/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
techdb/catops/views.py
Normal file
3
techdb/catops/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
21
techdb/docker/docker-compose.yml
Normal file
21
techdb/docker/docker-compose.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
# Use postgres/example user/password credentials
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
|
||||
postgresql:
|
||||
image: postgres:17.0
|
||||
container_name: tech-postgresql
|
||||
restart: always
|
||||
# set shared memory limit when using docker-compose
|
||||
shm_size: 128mb
|
||||
volumes:
|
||||
- /mnt/data/postgresql:/var/lib/postgresql/data
|
||||
ports:
|
||||
- 5432:5432
|
||||
environment:
|
||||
POSTGRES_USER: tech
|
||||
POSTGRES_PASSWORD: tech
|
||||
POSTGRED_DB: techstorage
|
||||
PGDATA: /var/lib/postgresql/data
|
||||
|
||||
22
techdb/manage.py
Executable file
22
techdb/manage.py
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
"""Django's command-line utility for administrative tasks."""
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
def main():
|
||||
"""Run administrative tasks."""
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'techdb.settings')
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError as exc:
|
||||
raise ImportError(
|
||||
"Couldn't import Django. Are you sure it's installed and "
|
||||
"available on your PYTHONPATH environment variable? Did you "
|
||||
"forget to activate a virtual environment?"
|
||||
) from exc
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
78
techdb/poetry.lock
generated
78
techdb/poetry.lock
generated
@@ -34,6 +34,82 @@ tzdata = {version = "*", markers = "sys_platform == \"win32\""}
|
||||
argon2 = ["argon2-cffi (>=19.1.0)"]
|
||||
bcrypt = ["bcrypt"]
|
||||
|
||||
[[package]]
|
||||
name = "psycopg2-binary"
|
||||
version = "2.9.10"
|
||||
description = "psycopg2 - Python-PostgreSQL Database Adapter"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "psycopg2-binary-2.9.10.tar.gz", hash = "sha256:4b3df0e6990aa98acda57d983942eff13d824135fe2250e6522edaa782a06de2"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:0ea8e3d0ae83564f2fc554955d327fa081d065c8ca5cc6d2abb643e2c9c1200f"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:3e9c76f0ac6f92ecfc79516a8034a544926430f7b080ec5a0537bca389ee0906"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ad26b467a405c798aaa1458ba09d7e2b6e5f96b1ce0ac15d82fd9f95dc38a92"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:270934a475a0e4b6925b5f804e3809dd5f90f8613621d062848dd82f9cd62007"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:48b338f08d93e7be4ab2b5f1dbe69dc5e9ef07170fe1f86514422076d9c010d0"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f4152f8f76d2023aac16285576a9ecd2b11a9895373a1f10fd9db54b3ff06b4"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:32581b3020c72d7a421009ee1c6bf4a131ef5f0a968fab2e2de0c9d2bb4577f1"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:2ce3e21dc3437b1d960521eca599d57408a695a0d3c26797ea0f72e834c7ffe5"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:e984839e75e0b60cfe75e351db53d6db750b00de45644c5d1f7ee5d1f34a1ce5"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3c4745a90b78e51d9ba06e2088a2fe0c693ae19cc8cb051ccda44e8df8a6eb53"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-win32.whl", hash = "sha256:e5720a5d25e3b99cd0dc5c8a440570469ff82659bb09431c1439b92caf184d3b"},
|
||||
{file = "psycopg2_binary-2.9.10-cp310-cp310-win_amd64.whl", hash = "sha256:3c18f74eb4386bf35e92ab2354a12c17e5eb4d9798e4c0ad3a00783eae7cd9f1"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:04392983d0bb89a8717772a193cfaac58871321e3ec69514e1c4e0d4957b5aff"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:1a6784f0ce3fec4edc64e985865c17778514325074adf5ad8f80636cd029ef7c"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b5f86c56eeb91dc3135b3fd8a95dc7ae14c538a2f3ad77a19645cf55bab1799c"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2b3d2491d4d78b6b14f76881905c7a8a8abcf974aad4a8a0b065273a0ed7a2cb"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2286791ececda3a723d1910441c793be44625d86d1a4e79942751197f4d30341"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:512d29bb12608891e349af6a0cccedce51677725a921c07dba6342beaf576f9a"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5a507320c58903967ef7384355a4da7ff3f28132d679aeb23572753cbf2ec10b"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6d4fa1079cab9018f4d0bd2db307beaa612b0d13ba73b5c6304b9fe2fb441ff7"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:851485a42dbb0bdc1edcdabdb8557c09c9655dfa2ca0460ff210522e073e319e"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:35958ec9e46432d9076286dda67942ed6d968b9c3a6a2fd62b48939d1d78bf68"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-win32.whl", hash = "sha256:ecced182e935529727401b24d76634a357c71c9275b356efafd8a2a91ec07392"},
|
||||
{file = "psycopg2_binary-2.9.10-cp311-cp311-win_amd64.whl", hash = "sha256:ee0e8c683a7ff25d23b55b11161c2663d4b099770f6085ff0a20d4505778d6b4"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:880845dfe1f85d9d5f7c412efea7a08946a46894537e4e5d091732eb1d34d9a0"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:9440fa522a79356aaa482aa4ba500b65f28e5d0e63b801abf6aa152a29bd842a"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e3923c1d9870c49a2d44f795df0c889a22380d36ef92440ff618ec315757e539"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b2c956c028ea5de47ff3a8d6b3cc3330ab45cf0b7c3da35a2d6ff8420896526"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f758ed67cab30b9a8d2833609513ce4d3bd027641673d4ebc9c067e4d208eec1"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cd9b4f2cfab88ed4a9106192de509464b75a906462fb846b936eabe45c2063e"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6dc08420625b5a20b53551c50deae6e231e6371194fa0651dbe0fb206452ae1f"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:d7cd730dfa7c36dbe8724426bf5612798734bff2d3c3857f36f2733f5bfc7c00"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:155e69561d54d02b3c3209545fb08938e27889ff5a10c19de8d23eb5a41be8a5"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c3cc28a6fd5a4a26224007712e79b81dbaee2ffb90ff406256158ec4d7b52b47"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-win32.whl", hash = "sha256:ec8a77f521a17506a24a5f626cb2aee7850f9b69a0afe704586f63a464f3cd64"},
|
||||
{file = "psycopg2_binary-2.9.10-cp312-cp312-win_amd64.whl", hash = "sha256:18c5ee682b9c6dd3696dad6e54cc7ff3a1a9020df6a5c0f861ef8bfd338c3ca0"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-macosx_12_0_x86_64.whl", hash = "sha256:26540d4a9a4e2b096f1ff9cce51253d0504dca5a85872c7f7be23be5a53eb18d"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:e217ce4d37667df0bc1c397fdcd8de5e81018ef305aed9415c3b093faaeb10fb"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:245159e7ab20a71d989da00f280ca57da7641fa2cdcf71749c193cea540a74f7"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c4ded1a24b20021ebe677b7b08ad10bf09aac197d6943bfe6fec70ac4e4690d"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3abb691ff9e57d4a93355f60d4f4c1dd2d68326c968e7db17ea96df3c023ef73"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8608c078134f0b3cbd9f89b34bd60a943b23fd33cc5f065e8d5f840061bd0673"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:230eeae2d71594103cd5b93fd29d1ace6420d0b86f4778739cb1a5a32f607d1f"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:bb89f0a835bcfc1d42ccd5f41f04870c1b936d8507c6df12b7737febc40f0909"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:f0c2d907a1e102526dd2986df638343388b94c33860ff3bbe1384130828714b1"},
|
||||
{file = "psycopg2_binary-2.9.10-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f8157bed2f51db683f31306aa497311b560f2265998122abe1dce6428bd86567"},
|
||||
{file = "psycopg2_binary-2.9.10-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:eb09aa7f9cecb45027683bb55aebaaf45a0df8bf6de68801a6afdc7947bb09d4"},
|
||||
{file = "psycopg2_binary-2.9.10-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b73d6d7f0ccdad7bc43e6d34273f70d587ef62f824d7261c4ae9b8b1b6af90e8"},
|
||||
{file = "psycopg2_binary-2.9.10-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ce5ab4bf46a211a8e924d307c1b1fcda82368586a19d0a24f8ae166f5c784864"},
|
||||
{file = "psycopg2_binary-2.9.10-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:056470c3dc57904bbf63d6f534988bafc4e970ffd50f6271fc4ee7daad9498a5"},
|
||||
{file = "psycopg2_binary-2.9.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73aa0e31fa4bb82578f3a6c74a73c273367727de397a7a0f07bd83cbea696baa"},
|
||||
{file = "psycopg2_binary-2.9.10-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:8de718c0e1c4b982a54b41779667242bc630b2197948405b7bd8ce16bcecac92"},
|
||||
{file = "psycopg2_binary-2.9.10-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:5c370b1e4975df846b0277b4deba86419ca77dbc25047f535b0bb03d1a544d44"},
|
||||
{file = "psycopg2_binary-2.9.10-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:ffe8ed017e4ed70f68b7b371d84b7d4a790368db9203dfc2d222febd3a9c8863"},
|
||||
{file = "psycopg2_binary-2.9.10-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:8aecc5e80c63f7459a1a2ab2c64df952051df196294d9f739933a9f6687e86b3"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:7a813c8bdbaaaab1f078014b9b0b13f5de757e2b5d9be6403639b298a04d218b"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d00924255d7fc916ef66e4bf22f354a940c67179ad3fd7067d7a0a9c84d2fbfc"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7559bce4b505762d737172556a4e6ea8a9998ecac1e39b5233465093e8cee697"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e8b58f0a96e7a1e341fc894f62c1177a7c83febebb5ff9123b579418fdc8a481"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b269105e59ac96aba877c1707c600ae55711d9dcd3fc4b5012e4af68e30c648"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:79625966e176dc97ddabc142351e0409e28acf4660b88d1cf6adb876d20c490d"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:8aabf1c1a04584c168984ac678a668094d831f152859d06e055288fa515e4d30"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:19721ac03892001ee8fdd11507e6a2e01f4e37014def96379411ca99d78aeb2c"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7f5d859928e635fa3ce3477704acee0f667b3a3d3e4bb109f2b18d4005f38287"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-win32.whl", hash = "sha256:3216ccf953b3f267691c90c6fe742e45d890d8272326b4a8b20850a03d05b7b8"},
|
||||
{file = "psycopg2_binary-2.9.10-cp39-cp39-win_amd64.whl", hash = "sha256:30e34c4e97964805f715206c7b789d54a78b70f3ff19fbe590104b71c45600e5"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlparse"
|
||||
version = "0.5.1"
|
||||
@@ -63,4 +139,4 @@ files = [
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.12"
|
||||
content-hash = "c58c989c26a59d063c77b955477c184bc3a91197896eb42a640a3ae7db62fb5a"
|
||||
content-hash = "c3b2acd3f06588e63224efb9ff8fc91a396c95e22862e40427c05b788901ea24"
|
||||
|
||||
@@ -8,6 +8,7 @@ readme = "README.md"
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.12"
|
||||
django = "^5.1.2"
|
||||
psycopg2-binary = "^2.9.10"
|
||||
|
||||
|
||||
[build-system]
|
||||
|
||||
16
techdb/techdb/asgi.py
Normal file
16
techdb/techdb/asgi.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
ASGI config for techdb project.
|
||||
|
||||
It exposes the ASGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.asgi import get_asgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'techdb.settings')
|
||||
|
||||
application = get_asgi_application()
|
||||
128
techdb/techdb/settings.py
Normal file
128
techdb/techdb/settings.py
Normal file
@@ -0,0 +1,128 @@
|
||||
"""
|
||||
Django settings for techdb project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 5.1.2.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.1/topics/settings/
|
||||
|
||||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/5.1/ref/settings/
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-s%(9^y#!1*ge)7u%$vf3zp0lisgd%=(k@$13&ej13p5(ei71hi'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'catops',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'techdb.urls'
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
'django.template.context_processors.debug',
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = 'techdb.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'techstorage',
|
||||
'USER': 'tech',
|
||||
'PASSWORD': 'tech',
|
||||
'HOST': 'localhost',
|
||||
'PORT': '5432'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/5.1/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
|
||||
TIME_ZONE = 'UTC'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/5.1/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
22
techdb/techdb/urls.py
Normal file
22
techdb/techdb/urls.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
URL configuration for techdb project.
|
||||
|
||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
||||
https://docs.djangoproject.com/en/5.1/topics/http/urls/
|
||||
Examples:
|
||||
Function views
|
||||
1. Add an import: from my_app import views
|
||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
||||
Class-based views
|
||||
1. Add an import: from other_app.views import Home
|
||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
||||
Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
16
techdb/techdb/wsgi.py
Normal file
16
techdb/techdb/wsgi.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
WSGI config for techdb project.
|
||||
|
||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'techdb.settings')
|
||||
|
||||
application = get_wsgi_application()
|
||||
Reference in New Issue
Block a user