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
709a019d
Commit
709a019d
authored
Dec 12, 2021
by
Felizia Tiburcio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make models
parent
77a6b16a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
7 deletions
+89
-7
.gitignore
.gitignore
+2
-1
settings.py
blizzardblast/settings.py
+1
-1
styles.css
blizzardblast/static/css/styles.css
+3
-3
0001_initial.py
main/migrations/0001_initial.py
+38
-0
models.py
main/models.py
+32
-1
views.py
main/views.py
+13
-1
No files found.
.gitignore
View file @
709a019d
*.pyc
.env
\ No newline at end of file
.env
*.sql
\ No newline at end of file
blizzardblast/settings.py
View file @
709a019d
...
...
@@ -42,6 +42,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'main'
]
MIDDLEWARE
=
[
...
...
@@ -91,7 +92,6 @@ DATABASES = {
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
...
...
blizzardblast/static/css/styles.css
View file @
709a019d
...
...
@@ -75,14 +75,14 @@ ul {
/* ======= HEADING ======= */
header
{
padding
:
0.5rem
;
animation
:
gradient
1s
1
s
infinite
;
animation
:
gradient
5s
5
s
infinite
;
color
:
#FEFCFD
;
}
@keyframes
gradient
{
0
%
{
background-color
:
#5D5D81
;
}
}
100
%
{
background-color
:
#BFCDE0
;
}
...
...
@@ -260,4 +260,4 @@ table, th {
cursor
:
pointer
;
background-color
:
#3B3355
;
color
:
#FEFCFD
;
}
\ No newline at end of file
}
main/migrations/0001_initial.py
0 → 100644
View file @
709a019d
# Generated by Django 3.1.7 on 2021-12-12 06:02
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Employee'
,
fields
=
[
(
'employee_id'
,
models
.
IntegerField
(
primary_key
=
True
,
serialize
=
False
)),
(
'employee_name'
,
models
.
CharField
(
max_length
=
255
)),
],
options
=
{
'db_table'
:
'employee'
,
'managed'
:
False
,
},
),
migrations
.
CreateModel
(
name
=
'Employeerole'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'role_date'
,
models
.
DateField
()),
(
'role_description'
,
models
.
CharField
(
choices
=
[(
'Cashier'
,
'Cashier'
),
(
'Preparation'
,
'Preparation'
),
(
'Cleaning'
,
'Cleaning'
)],
max_length
=
20
)),
(
'is_manager'
,
models
.
CharField
(
max_length
=
1
)),
],
options
=
{
'db_table'
:
'employeerole'
,
'managed'
:
False
,
},
),
]
main/models.py
View file @
709a019d
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey and OneToOneField has `on_delete` set to the desired behavior
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from
django.db
import
models
# Create your models here.
class
Employee
(
models
.
Model
):
employee_id
=
models
.
IntegerField
(
primary_key
=
True
)
employee_name
=
models
.
CharField
(
max_length
=
255
)
class
Meta
:
managed
=
False
db_table
=
'employee'
class
EmployeeRole
(
models
.
Model
):
ROLES
=
[
(
'Cashier'
,
'Cashier'
),
(
'Preparation'
,
'Preparation'
),
(
'Cleaning'
,
'Cleaning'
),
]
role_date
=
models
.
DateField
()
employee
=
models
.
ForeignKey
(
Employee
,
models
.
DO_NOTHING
)
role_description
=
models
.
CharField
(
max_length
=
20
,
choices
=
ROLES
)
is_manager
=
models
.
CharField
(
max_length
=
1
)
class
Meta
:
managed
=
False
db_table
=
'employeerole'
main/views.py
View file @
709a019d
...
...
@@ -2,26 +2,38 @@ from django.shortcuts import render
from
django.http
import
HttpResponse
from
.forms
import
AddOrderForm
from
.models
import
*
def
homepage
(
request
):
return
render
(
request
,
"blizzardblast/templates/index.html"
)
def
order
(
request
):
return
render
(
request
,
"blizzardblast/templates/order.html"
)
def
receipt
(
request
):
return
render
(
request
,
"blizzardblast/templates/receipt.html"
)
def
inventory
(
request
):
return
render
(
request
,
"blizzardblast/templates/inventory.html"
)
def
schedule
(
request
):
for
employee
in
Employee
.
objects
.
raw
(
'SELECT * FROM employee'
):
print
(
employee
.
employee_name
)
for
role
in
EmployeeRole
.
objects
.
all
():
print
(
role
.
role_description
)
return
render
(
request
,
"blizzardblast/templates/schedule.html"
)
def
report
(
request
):
return
render
(
request
,
"blizzardblast/templates/report.html"
)
def
addorder
(
request
):
form
=
AddOrderForm
()
return
render
(
request
,
"blizzardblast/templates/addorder.html"
,
{
'form'
:
form
})
\ No newline at end of file
return
render
(
request
,
"blizzardblast/templates/addorder.html"
,
{
'form'
:
form
})
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