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
Show 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
*.pyc
.env
.env
*.sql
\ No newline at end of file
blizzardblast/settings.py
View file @
709a019d
...
@@ -42,6 +42,7 @@ INSTALLED_APPS = [
...
@@ -42,6 +42,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'main'
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
@@ -91,7 +92,6 @@ DATABASES = {
...
@@ -91,7 +92,6 @@ DATABASES = {
}
}
# Password validation
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
...
...
blizzardblast/static/css/styles.css
View file @
709a019d
...
@@ -75,7 +75,7 @@ ul {
...
@@ -75,7 +75,7 @@ ul {
/* ======= HEADING ======= */
/* ======= HEADING ======= */
header
{
header
{
padding
:
0.5rem
;
padding
:
0.5rem
;
animation
:
gradient
1s
1
s
infinite
;
animation
:
gradient
5s
5
s
infinite
;
color
:
#FEFCFD
;
color
:
#FEFCFD
;
}
}
...
...
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
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
...
@@ -2,26 +2,38 @@ from django.shortcuts import render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.forms
import
AddOrderForm
from
.forms
import
AddOrderForm
from
.models
import
*
def
homepage
(
request
):
def
homepage
(
request
):
return
render
(
request
,
"blizzardblast/templates/index.html"
)
return
render
(
request
,
"blizzardblast/templates/index.html"
)
def
order
(
request
):
def
order
(
request
):
return
render
(
request
,
"blizzardblast/templates/order.html"
)
return
render
(
request
,
"blizzardblast/templates/order.html"
)
def
receipt
(
request
):
def
receipt
(
request
):
return
render
(
request
,
"blizzardblast/templates/receipt.html"
)
return
render
(
request
,
"blizzardblast/templates/receipt.html"
)
def
inventory
(
request
):
def
inventory
(
request
):
return
render
(
request
,
"blizzardblast/templates/inventory.html"
)
return
render
(
request
,
"blizzardblast/templates/inventory.html"
)
def
schedule
(
request
):
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"
)
return
render
(
request
,
"blizzardblast/templates/schedule.html"
)
def
report
(
request
):
def
report
(
request
):
return
render
(
request
,
"blizzardblast/templates/report.html"
)
return
render
(
request
,
"blizzardblast/templates/report.html"
)
def
addorder
(
request
):
def
addorder
(
request
):
form
=
AddOrderForm
()
form
=
AddOrderForm
()
return
render
(
request
,
"blizzardblast/templates/addorder.html"
,
{
'form'
:
form
})
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