I am trying to call a view directly from another (if at all possible). I have a view:
def product_add(request, order_id=None):
Then I have a 2nd view that queries DB for product data and should call the first one.
def product_copy_from_history(request, order_id=None, product_id=None):
product = Product.objects.get(owner=request.user, pk=product_id)
2nd_response = product_add(request, order_id)
return 2nd_response
Since the second one needs to add the product as the first view, I was wondering if I could just call up the first view from the second.
What I'm aiming for is simply to pass the request object to the second view and return the received response object back to the client.
Any help is much appreciated, criticism also if this is a bad way to do it. But then some pointers .. to avoid drying.
Thanx!
Gerard.