Commit 2d1f29ff authored by Jose Emmanuel B. Laurel's avatar Jose Emmanuel B. Laurel

added file db.sqlite3

parents f24a38d9 ce88a2af
...@@ -2,5 +2,7 @@ from django.contrib import admin ...@@ -2,5 +2,7 @@ from django.contrib import admin
# Register your models here. # Register your models here.
from .models import WidgetUser from .models import WidgetUser
from .models import Department
admin.site.register(WidgetUser) admin.site.register(WidgetUser)
admin.site.register(Department)
\ No newline at end of file
# Generated by Django 3.2.12 on 2022-03-30 15:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='widgetuser',
name='email',
field=models.CharField(default='someemail@gmail.com', max_length=50),
),
migrations.AddField(
model_name='widgetuser',
name='id_name',
field=models.CharField(default='1234567', max_length=7),
),
migrations.AlterField(
model_name='widgetuser',
name='first_name',
field=models.CharField(default='first_name', max_length=50),
),
migrations.AlterField(
model_name='widgetuser',
name='last_name',
field=models.CharField(default='last_name', max_length=50),
),
migrations.AlterField(
model_name='widgetuser',
name='middle_name',
field=models.CharField(default='middle_name', max_length=50),
),
migrations.CreateModel(
name='Department',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('dept_name', models.CharField(max_length=50)),
('home_unit', models.CharField(max_length=50)),
('widgetuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser')),
],
),
]
...@@ -2,9 +2,19 @@ from django.db import models ...@@ -2,9 +2,19 @@ from django.db import models
# Create your models here. # Create your models here.
class WidgetUser(models.Model): class WidgetUser(models.Model):
first_name = models.CharField(max_length=50) first_name = models.CharField(max_length=50, default='first_name')
middle_name = models.CharField(max_length=50) middle_name = models.CharField(max_length=50, default='middle_name')
last_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50, default='last_name')
id_name = models.CharField(max_length=7, default='1234567')
email = models.CharField(max_length=50, default='someemail@gmail.com')
def __str__(self): def __str__(self):
return self.last_name return self.last_name
class Department(models.Model):
widgetuser = models.ForeignKey(WidgetUser, on_delete=models.CASCADE)
dept_name = models.CharField(max_length=50)
home_unit = models.CharField(max_length=50)
def __str__(self):
return self.dept_name
\ No newline at end of file
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