Commit c9f8e0b0 authored by Brendan Fausto's avatar Brendan Fausto

More error fixes on model, and mmigrations done

parent 4de7a617
......@@ -2,7 +2,7 @@ from django.contrib import admin
from .models import Department, WidgetUser
class DepartmentAdmin(model.ModelAdmin):
class DepartmentAdmin(admin.ModelAdmin):
model = Department
......@@ -11,7 +11,7 @@ class DepartmentAdmin(model.ModelAdmin):
list_display = ('dept_name','home_unit',)
class WidgetUserAdmin(model.ModelAdmin):
class WidgetUserAdmin(admin.ModelAdmin):
model = WidgetUser
......
# Generated by Django 4.1.6 on 2023-03-05 03:39
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
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=255)),
('home_unit', models.CharField(max_length=255)),
],
),
migrations.CreateModel(
name='WidgetUser',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=255)),
('middle_name', models.CharField(max_length=255)),
('last_name', models.CharField(max_length=255)),
('department', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='dashboard.department')),
],
),
]
from django.shortcuts import render
from django.http import HttpResponse
from .models import WidgetUser
# Create your views here.
def index(request):
......@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'dashboard',
]
MIDDLEWARE = [
......
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