Commit 9525e3b0 authored by Stefan Gomez's avatar Stefan Gomez

Created the dashboards page and its models, and updated the project's settings.

parent 7d25903a
from django.contrib import admin
from.models import Department, WidgetUser
class DepartmentAdmin(admin.ModelAdmin):
model = Department
class WidgetUserAdmin(admin.ModelAdmin):
model = WidgetUser
admin.site.register(Department, DepartmentAdmin)
admin.site.register(Assignment, AssignmentAdmin)
from django.apps import AppConfig
class DashboardConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'dashboard'
from django.db import models
class Department(models.Model):
dept_name = models.CharField(max_length=100)
home_unit = models.CharField(max_length=100)
def__str__(self):
return '{}, {}'.format(self.dept_name, self.home_unit)
class WidgetUser(models.Model):
first_name = models.CharField(max_length=100)
middle_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
department = models.ForeignKey(Department, on_delete=models.CASCADE)
from django.test import TestCase
# Create your tests here.
from django.contrib import admin
from django.urls import path
from .views import index
urlpatterns = [
path('', index, name='index'),
]
app_name = "dashboard"
\ No newline at end of file
from django.shortcuts import render
# Create your views here.
......@@ -43,6 +43,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'assignments',
'dashboard',
]
MIDDLEWARE = [
......
......@@ -3,5 +3,6 @@ from django.urls import include, path
urlpatterns = [
path('assignments/', include('assignments.urls', namespace="assignments")),
path('dashboard/', include('dashboard.urls', namespace="dashboard")),
path('admin/', admin.site.urls),
]
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