Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_vincentdjango
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
1
Merge Requests
1
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
Almira Redoble
midterm_vincentdjango
Commits
4ffca08f
Commit
4ffca08f
authored
Mar 01, 2023
by
Almira Redoble
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented and migrated models
parent
a37c4657
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
0 deletions
+59
-0
models.cpython-311.pyc
...incentdjango/dashboard/__pycache__/models.cpython-311.pyc
+0
-0
0001_initial.py
widget_vincentdjango/dashboard/migrations/0001_initial.py
+33
-0
0001_initial.cpython-311.pyc
...board/migrations/__pycache__/0001_initial.cpython-311.pyc
+0
-0
models.py
widget_vincentdjango/dashboard/models.py
+26
-0
db.sqlite3
widget_vincentdjango/db.sqlite3
+0
-0
No files found.
widget_vincentdjango/dashboard/__pycache__/models.cpython-311.pyc
View file @
4ffca08f
No preview for this file type
widget_vincentdjango/dashboard/migrations/0001_initial.py
0 → 100644
View file @
4ffca08f
# Generated by Django 3.2 on 2023-03-01 01:38
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
(
default
=
''
,
max_length
=
100
)),
(
'home_unit'
,
models
.
CharField
(
default
=
''
,
max_length
=
100
)),
],
),
migrations
.
CreateModel
(
name
=
'WidgetUser'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'first_name'
,
models
.
CharField
(
default
=
''
,
max_length
=
50
)),
(
'middle_name'
,
models
.
CharField
(
default
=
''
,
max_length
=
50
)),
(
'last_name'
,
models
.
CharField
(
default
=
''
,
max_length
=
50
)),
(
'department'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'User'
,
to
=
'dashboard.department'
)),
],
),
]
widget_vincentdjango/dashboard/migrations/__pycache__/0001_initial.cpython-311.pyc
0 → 100644
View file @
4ffca08f
File added
widget_vincentdjango/dashboard/models.py
View file @
4ffca08f
from
django.db
import
models
from
django.db
import
models
class
Department
(
models
.
Model
):
dept_name
=
models
.
CharField
(
max_length
=
100
,
default
=
""
)
home_unit
=
models
.
CharField
(
max_length
=
100
,
default
=
""
)
def
__str__
(
self
):
return
'{},{}'
.
format
(
self
.
dept_name
,
self
.
home_unit
)
class
WidgetUser
(
models
.
Model
):
first_name
=
models
.
CharField
(
max_length
=
50
,
default
=
""
)
middle_name
=
models
.
CharField
(
max_length
=
50
,
default
=
""
)
last_name
=
models
.
CharField
(
max_length
=
50
,
default
=
""
)
department
=
models
.
ForeignKey
(
Department
,
on_delete
=
models
.
CASCADE
,
related_name
=
'User'
)
def
__str__
(
self
):
return
'{}, {} {}'
.
format
(
self
.
last_name
,
self
.
first_name
,
self
.
middle_name
)
# Create your models here.
# Create your models here.
widget_vincentdjango/db.sqlite3
View file @
4ffca08f
No preview for this file type
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