Commit e47bde52 authored by Vaughn Fajardo's avatar Vaughn Fajardo

style: fixed code with pep8 rule

parent ee420b92
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>
\ No newline at end of file
from django.db import models
class Department(models.Model):
dept_name = models.CharField(max_length=50, null=True)
home_unit = models.CharField(max_length=50, null=True)
dept_name = models.CharField(max_length=50,null=True)
home_unit = models.CharField(max_length=50,null=True)
def __str__(self):
return self.dept_name
......@@ -11,9 +11,12 @@ class WidgetUser(models.Model):
first_name = models.CharField(max_length=50)
middle_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
id_num = models.IntegerField(max_length=7, null=True)
email = models.EmailField(max_length=50, null=True)
department = models.ForeignKey(Department, on_delete=models.CASCADE, null=True, related_name='department')
id_num = models.IntegerField(max_length=7,null=True)
email = models.EmailField(max_length=50,null=True)
department = models.ForeignKey(Department,
on_delete=models.CASCADE,
null=True,
related_name='department')
def __str__(self):
return self.first_name
\ No newline at end of file
from django.urls import path
from . import views
urlpatterns = [
......
......@@ -7,13 +7,11 @@ def welcome(request):
return HttpResponse('Welcome to Widget!')
def index(request):
widget_user_view = 'WIDGET USERS: '
widget_user = WidgetUser.objects.all()
WidgetUserView = 'WIDGET USERS: '
widgetuser = WidgetUser.objects.all()
for user in widgetuser:
WidgetUserView += "<br/> {}, {} {}: {}, {}, {}, {}".\
for user in widget_user:
widget_user_view += "<br/> {}, {} {}: {}, {}, {}, {}".\
format(user.last_name,
user.first_name,
user.middle_name,
......@@ -22,4 +20,4 @@ def index(request):
user.department.dept_name,
user.department.home_unit)
return HttpResponse(WidgetUserView)
\ No newline at end of file
return HttpResponse(widget_user_view)
\ 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