Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Blizzard Blast
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
Martina Therese R. Reyes
Blizzard Blast
Commits
cfbc4269
Commit
cfbc4269
authored
Dec 12, 2021
by
Martina Therese R. Reyes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created new views and urls.
parent
686e1d01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
14 deletions
+28
-14
urls.py
main/urls.py
+4
-1
views.py
main/views.py
+24
-13
No files found.
main/urls.py
View file @
cfbc4269
...
...
@@ -8,6 +8,9 @@ urlpatterns = [
path
(
'schedule'
,
schedule
,
name
=
'schedule'
),
path
(
'report'
,
report
,
name
=
'report'
),
path
(
'receipt'
,
receipt
,
name
=
'receipt'
),
path
(
'addorder'
,
addorder
,
name
=
'addorder'
),
path
(
'addorder'
,
addorder
,
name
=
'addorder'
),
path
(
'manager_query'
,
manager_query
,
name
=
'manager_query'
),
path
(
'week_query'
,
week_query
,
name
=
'week_query'
),
path
(
'role_query'
,
role_query
,
name
=
'role_query'
)
]
main/views.py
View file @
cfbc4269
...
...
@@ -22,30 +22,41 @@ def inventory(request):
def
schedule
(
request
):
# 1: FILTER EMPLOYEES BY MANAGER FOR THE DAY - mate
ismanager_query
=
EmployeeRole
.
objects
.
all
()
.
filter
(
is_manager
=
'Y'
)
all_values
=
EmployeeRole
.
objects
.
all
()
# 2: FILTER EMPLOYEES AND ROLES IN ALPHABETICAL ORDER - felizia
employee_role_order_query
=
EmployeeRole
.
objects
.
all
()
.
order_by
(
'role_description'
)
# 3 : FILTER BY WEEK - dedz
week_query1
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_date__range
=
[
"2025-09-01"
,
"2025-09-06"
])
.
order_by
(
'role_date'
)
week_query2
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_date__range
=
[
"2025-09-08"
,
"2025-09-13"
])
.
order_by
(
'role_date'
)
# 4: FILTER EMPLOYEES BY ROLES - xtine
role_query1
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_description
=
'Cashier'
)
role_query2
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_description
=
'Preparation'
)
role_query3
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_description
=
'Cleaning'
)
# 5: FILTER EMPLOYEES AND ROLES BY DATE IN ORDER - xx
date_order_query
=
EmployeeRole
.
objects
.
all
()
.
order_by
(
'role_date'
)
return
render
(
request
,
"blizzardblast/templates/schedule.html"
,
{
'
manager'
:
ismanager_query
'
all_values'
:
all_values
}
)
# 1: FILTER EMPLOYEES BY MANAGER FOR THE DAY - mate
def
manager_query
(
request
):
ismanager_query
=
EmployeeRole
.
objects
.
all
()
.
filter
(
is_manager
=
'Y'
)
return
render
(
request
,
"blizzardblast/templates/queries/manager_query.html"
,
{
'manager'
:
ismanager_query
})
# 3 : FILTER BY WEEK - dedz
def
week_query
(
request
):
week_query1
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_date__range
=
[
"2025-09-01"
,
"2025-09-06"
])
.
order_by
(
'role_date'
)
week_query2
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_date__range
=
[
"2025-09-08"
,
"2025-09-13"
])
.
order_by
(
'role_date'
)
return
render
(
request
,
"blizzardblast/templates/queries/week_query.html"
,
{
'week_query1'
:
week_query1
,
'week_query2'
:
week_query2
}
)
# 4: FILTER EMPLOYEES BY ROLES - xtine
def
role_query
(
request
):
role_query1
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_description
=
'Cashier'
)
role_query2
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_description
=
'Preparation'
)
role_query3
=
EmployeeRole
.
objects
.
all
()
.
filter
(
role_description
=
'Cleaning'
)
return
render
(
request
,
"blizzardblast/templates/queries/role_query.html"
,
{
'cashier'
:
role_query1
,
'preparation'
:
role_query2
,
'cleaning'
:
role_query3
}
)
def
report
(
request
):
return
render
(
request
,
"blizzardblast/templates/report.html"
)
...
...
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