Commit 59d2ac9b authored by James Esguerra's avatar James Esguerra

Added the Models for the pages

parent 4fb2b20c
# Generated by Django 3.1.7 on 2021-04-06 11:17
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type', models.CharField(max_length=50)),
('details', models.TextField(max_length=50)),
],
),
migrations.CreateModel(
name='Key',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('key_name', models.CharField(max_length=50)),
('key_description', models.TextField(max_length=100)),
],
),
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nickname', models.CharField(max_length=50)),
('bio', models.TextField(max_length=100)),
('profile', models.ImageField(upload_to='')),
],
),
]
# Generated by Django 3.1.7 on 2021-04-06 11:17
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pages', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='item',
name='key',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='pages.key'),
),
]
# Generated by Django 3.1.7 on 2021-04-06 14:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pages', '0002_item_key'),
]
operations = [
migrations.CreateModel(
name='ItemsThisWeek',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('details', models.TextField(max_length=50)),
('key_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pages.key')),
],
),
migrations.CreateModel(
name='ItemsToday',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('details', models.TextField(max_length=50)),
('key_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pages.key')),
],
),
migrations.DeleteModel(
name='Item',
),
]
from django.db import models
# Create your models here.
class User(models.Model):
nickname = models.CharField(max_length=50)
bio = models.TextField(max_length=100)
profile = models.ImageField()
def __str__(self):
return self.nickname
class Key(models.Model):
key_name = models.CharField(max_length=50)
key_description = models.TextField(max_length=100)
def __str__(self):
return self.key_name
class ItemsThisWeek(models.Model):
key_type = models.ForeignKey(Key, on_delete=models.CASCADE)
details = models.TextField(max_length=50)
def __str__(self):
return self.details
class ItemsToday(models.Model):
key_type = models.ForeignKey(Key, on_delete=models.CASCADE)
details = models.TextField(max_length=50)
def __str__(self):
return self.details
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment