May 2018
Beginner to intermediate
526 pages
11h 57m
English
We will use the order models we created to persist the items contained in the shopping cart when the user finally places an order. A new order will be created following these steps:
First, we need a form to enter the order details. Create a new file inside the orders application directory and name it forms.py. Add the following code to it:
from django import formsfrom .models import Orderclass OrderCreateForm(forms.ModelForm): class Meta: model = Order fields = ['first_name', 'last_name', ...
Read now
Unlock full access