Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group17
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vaughn Nephi Fajardo
widget_group17
Commits
304572fc
Commit
304572fc
authored
Mar 24, 2022
by
Vaughn Fajardo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: resolved foreignkey dependency issue with department and user
parent
6d2b2900
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
db.sqlite3
widget_group_17/db.sqlite3
+0
-0
models.cpython-39.pyc
widget_group_17/homepage/__pycache__/models.cpython-39.pyc
+0
-0
models.py
widget_group_17/homepage/models.py
+9
-14
No files found.
widget_group_17/db.sqlite3
View file @
304572fc
No preview for this file type
widget_group_17/homepage/__pycache__/models.cpython-39.pyc
View file @
304572fc
No preview for this file type
widget_group_17/homepage/models.py
View file @
304572fc
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
)
def
__str__
(
self
):
return
self
.
dept_name
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
)
def
__str__
(
self
):
return
self
.
first_name
# Create your models here.
class
Department
(
models
.
Model
):
dept_name
=
models
.
CharField
(
max_length
=
50
,
null
=
True
)
home_unit
=
models
.
CharField
(
max_length
=
50
,
null
=
True
)
widgetuser
=
models
.
ForeignKey
(
WidgetUser
,
on_delete
=
models
.
CASCADE
,
null
=
True
)
return
self
.
first_name
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment