- Setup a virtual environment.
- Fork the repository for Django Task 10, in JoinCODED’s Github and Clone it.
- Install the packages from the requirements file.
- Create a field called
owner
for theRestaurant
model.ForeignKey
to theUser
model.- set a default value or delete the database.
- Create a model called
Item
with the following fields:name
description
price
restaurant
:ForeignKey
to theRestaurant
model.
- Adjust the
restaurant_create
view so that when a user who is logged in creates aRestaurant
object, they get assigned as theowner
. - The
item_create
view has been partially written for you, complete it:- The user should only input the
name
,description
, andprice
. - The
restaurant
should be assigned automatically. - After creating an Item you should be redirected to the
restaurant_detail
page. - Display a Create Item button in the restaurant detail page.
- The user should only input the
- The URL for
item_create
has been partially written for you, complete it. - Display a list of items belonging to the restaurant in the restaurant detail page.
- Pass the tests.
- Push your code.
s-bader / task_10 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from joincoded/task_10
Django Task 10