My code looks as such:
def add_cart(request):
return create_object(request, form_class=CartForm,
post_save_redirect=reverse('test.views.show_cart',
kwargs=dict(object_id='%(key)s')))
Ideally, I would like it to look like so:
def add_cart(request):
newobject = create_object(request, form_class=CartForm,
post_save_redirect=reverse('test.views.show_cart',
kwargs=dict(object_id='%(key)s')))
request.session['cartid'] = newobject.key
return newobject
How can I retrieve the key from the newly created object?
I am using google-app-engine-patch with all the latest versions.