Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_nicsbabes
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
Nics De Vega
midterm_nicsbabes
Commits
5c71d058
Commit
5c71d058
authored
Mar 06, 2023
by
Sharmaine Chua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented models of app dashboard
parent
b1626001
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
2 deletions
+58
-2
0001_initial.py
widget_nicsbabes/dashboard/migrations/0001_initial.py
+33
-0
models.py
widget_nicsbabes/dashboard/models.py
+15
-1
urls.py
widget_nicsbabes/dashboard/urls.py
+8
-0
urls.cpython-39.pyc
...icsbabes/widget_nicsbabes/__pycache__/urls.cpython-39.pyc
+0
-0
urls.py
widget_nicsbabes/widget_nicsbabes/urls.py
+2
-1
No files found.
widget_nicsbabes/dashboard/migrations/0001_initial.py
0 → 100644
View file @
5c71d058
# Generated by Django 3.2 on 2023-03-06 02:48
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
,
unique
=
True
)),
(
'home_unit'
,
models
.
CharField
(
default
=
''
,
max_length
=
100
,
unique
=
True
)),
],
),
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
=
100
)),
(
'middle_name'
,
models
.
CharField
(
default
=
''
,
max_length
=
100
)),
(
'last_name'
,
models
.
CharField
(
default
=
''
,
max_length
=
100
)),
(
'department'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'dashboard.department'
)),
],
),
]
widget_nicsbabes/dashboard/models.py
View file @
5c71d058
from
django.db
import
models
# Create your models here.
class
Department
(
models
.
Model
):
dept_name
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
,
default
=
""
)
home_unit
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
,
default
=
""
)
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
dept_name
)
class
WidgetUser
(
models
.
Model
):
first_name
=
models
.
CharField
(
max_length
=
100
,
default
=
""
)
middle_name
=
models
.
CharField
(
max_length
=
100
,
default
=
""
)
last_name
=
models
.
CharField
(
max_length
=
100
,
default
=
""
)
department
=
models
.
ForeignKey
(
Department
,
on_delete
=
models
.
CASCADE
)
def
__str__
(
self
):
return
'{} {}'
.
format
(
self
.
first_name
,
self
.
last_name
)
\ No newline at end of file
widget_nicsbabes/dashboard/urls.py
0 → 100644
View file @
5c71d058
from
django.urls
import
path
from
.views
import
index
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
)
]
app_name
=
'announcement_board'
\ No newline at end of file
widget_nicsbabes/widget_nicsbabes/__pycache__/urls.cpython-39.pyc
View file @
5c71d058
No preview for this file type
widget_nicsbabes/widget_nicsbabes/urls.py
View file @
5c71d058
...
...
@@ -14,8 +14,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from
django.contrib
import
admin
from
django.urls
import
path
from
django.urls
import
path
,
include
urlpatterns
=
[
path
(
'dashboard/'
,
include
(
'dashboard.urls'
,
namespace
=
"dashboard"
)),
path
(
'admin/'
,
admin
.
site
.
urls
),
]
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