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
fb8ba6c0
Commit
fb8ba6c0
authored
Dec 15, 2021
by
Martina Therese R. Reyes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made Migrations. Edited. Thought I needed a foreign key for base flavor
parent
bfc19a3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
0003_auto_20211215_2311.py
main/migrations/0003_auto_20211215_2311.py
+17
-0
models.py
main/models.py
+13
-1
No files found.
main/migrations/0003_auto_20211215_2311.py
0 → 100644
View file @
fb8ba6c0
# Generated by Django 3.1.7 on 2021-12-15 15:11
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'main'
,
'0002_baseflavor_customer_ingredient_item_orders_size'
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
'orders'
,
options
=
{
'managed'
:
False
,
'verbose_name_plural'
:
'Orders'
},
),
]
main/models.py
View file @
fb8ba6c0
...
@@ -30,12 +30,24 @@ class Customer(models.Model):
...
@@ -30,12 +30,24 @@ class Customer(models.Model):
return
self
.
customer_name
return
self
.
customer_name
class
Ingredient
(
models
.
Model
):
class
Ingredient
(
models
.
Model
):
INGREDIENT_CATEGORIES
=
[
(
'nuts'
,
'nuts'
),
(
'fruits'
,
'fruits'
),
(
'chocolate'
,
'chocolate'
),
(
'baked'
,
'baked'
),
(
'mix-in'
,
'mix-in'
),
(
'base'
,
'base'
),
(
'topping'
,
'topping'
)
]
REPLENISHED_STOCK
=
[
REPLENISHED_STOCK
=
[
(
'Y'
,
'Y'
),
(
'Y'
,
'Y'
),
(
'N'
,
'N'
),
(
'N'
,
'N'
),
]
]
ingredient_id
=
models
.
AutoField
(
primary_key
=
True
)
ingredient_id
=
models
.
AutoField
(
primary_key
=
True
)
ingredient_name
=
models
.
CharField
(
max_length
=
255
)
ingredient_name
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
)
category
=
models
.
CharField
(
max_length
=
200
,
choices
=
INGREDIENT_CATEGORIES
)
quantity
=
models
.
IntegerField
()
quantity
=
models
.
IntegerField
()
price_per_serving
=
models
.
FloatField
()
price_per_serving
=
models
.
FloatField
()
replenished_stock
=
models
.
CharField
(
max_length
=
1
,
choices
=
REPLENISHED_STOCK
)
replenished_stock
=
models
.
CharField
(
max_length
=
1
,
choices
=
REPLENISHED_STOCK
)
...
...
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