Skip to content

Commit

Permalink
Tietokannan ulkoistaminen
Browse files Browse the repository at this point in the history
  • Loading branch information
Teemu-Kostamo committed Apr 20, 2024
1 parent 2829ea2 commit d21e1ef
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='item',
name='item_avail',
field=models.CharField(choices=[('Va', 'Vapaa'), ('Vr', 'Varattu'), ('Hu', 'Huollossa'), ('Ri', 'Rikki')], default='vapaa', max_length=2),
field=models.CharField(choices=[('Va', 'Vapaa'), ('Vr', 'Varattu'), ('Hu', 'Huollossa'), ('Ri', 'Rikki')], default='Va', max_length=2),
),
migrations.AlterField(
model_name='reservation',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.0.3 on 2024-04-20 15:43

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('lainatehdas', '0016_remove_reservation_reservation_complete'),
]

operations = [
migrations.RemoveField(
model_name='item',
name='item_avail',
),
]
18 changes: 18 additions & 0 deletions lainatehtailijat/lainatehdas/migrations/0018_item_item_avail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.3 on 2024-04-20 15:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('lainatehdas', '0017_remove_item_item_avail'),
]

operations = [
migrations.AddField(
model_name='item',
name='item_avail',
field=models.CharField(choices=[('Va', 'Vapaa'), ('Vr', 'Varattu'), ('Hu', 'Huollossa'), ('Ri', 'Rikki')], default='Va', max_length=2),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.0.3 on 2024-04-20 15:44

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('lainatehdas', '0018_item_item_avail'),
]

operations = [
migrations.RemoveField(
model_name='item',
name='item_avail',
),
]
18 changes: 18 additions & 0 deletions lainatehtailijat/lainatehdas/migrations/0020_item_item_avail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.3 on 2024-04-20 15:45

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('lainatehdas', '0019_remove_item_item_avail'),
]

operations = [
migrations.AddField(
model_name='item',
name='item_avail',
field=models.CharField(choices=[('Va', 'Vapaa'), ('Vr', 'Varattu'), ('Hu', 'Huollossa'), ('Ri', 'Rikki')], default='Va', max_length=2),
),
]
2 changes: 2 additions & 0 deletions lainatehtailijat/lainatehdas/migrations/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import pymysql
pymysql.install_as_MySQLdb
2 changes: 1 addition & 1 deletion lainatehtailijat/lainatehdas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Item(models.Model):
item_name = models.CharField(max_length= 200, verbose_name="Name")
item_desc = models.CharField(max_length= 500, verbose_name="Description")
item_type = models.CharField(max_length=4, choices=item_choices, verbose_name="Type")
item_avail = models.CharField(max_length=2, choices=item_avail_choices)
item_avail = models.CharField(max_length=2, choices=item_avail_choices, default="Va")
item_img = models.ImageField(upload_to='media/', default='media/placeholder.jpg')
def __str__(self) -> str:
return self.item_name
Expand Down

0 comments on commit d21e1ef

Please sign in to comment.