try last_order request user order_set latest date_create except DoesNo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
try:
last_order = request.user.order_set.latest('date_create')
except DoesNotExist:
last_order = request.user.order_set.create()
NameError at /orders/new/chigour/
global name 'DoesNotExist' is not definedRequest Method: POST
Request URL: http://localhost:8000/orders/new/chigour/
Exception Type: NameError
Exception Value: global name 'DoesNotExist' is not defined
E:\my_project\django\koval_magazine\orders\views.py in get_goods_to_order
...
except DoesNotExist: