make container and item SoftDeleteModel
This commit is contained in:
parent
04581b66b6
commit
e2a2e3e117
2 changed files with 35 additions and 2 deletions
|
@ -0,0 +1,33 @@
|
||||||
|
# Generated by Django 4.2.7 on 2023-11-20 11:23
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('inventory', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='container',
|
||||||
|
name='deleted_at',
|
||||||
|
field=models.DateTimeField(blank=True, null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='container',
|
||||||
|
name='is_deleted',
|
||||||
|
field=models.BooleanField(default=False),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='item',
|
||||||
|
name='deleted_at',
|
||||||
|
field=models.DateTimeField(blank=True, null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='item',
|
||||||
|
name='is_deleted',
|
||||||
|
field=models.BooleanField(default=False),
|
||||||
|
),
|
||||||
|
]
|
|
@ -13,7 +13,7 @@ class ItemManager(models.Manager):
|
||||||
return super().create(**kwargs)
|
return super().create(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
class Item(models.Model):
|
class Item(SoftDeleteModel):
|
||||||
iid = models.AutoField(primary_key=True)
|
iid = models.AutoField(primary_key=True)
|
||||||
uid = models.IntegerField()
|
uid = models.IntegerField()
|
||||||
description = models.TextField()
|
description = models.TextField()
|
||||||
|
@ -29,7 +29,7 @@ class Item(models.Model):
|
||||||
unique_together = (('uid', 'event'),)
|
unique_together = (('uid', 'event'),)
|
||||||
|
|
||||||
|
|
||||||
class Container(models.Model):
|
class Container(SoftDeleteModel):
|
||||||
cid = models.AutoField(primary_key=True)
|
cid = models.AutoField(primary_key=True)
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
created_at = models.DateTimeField(blank=True, null=True)
|
created_at = models.DateTimeField(blank=True, null=True)
|
||||||
|
|
Loading…
Reference in a new issue