@treeio_login_required
@handle_response_format
def product_view(request, product_id, response_format='html'):
 product = get_object_or_404(Product, pk=product_id)
 if ((not request.user.profile.has_permission(product)) and (not request.user.profile.is_admin('treeio.sales'))):
  return user_denied(request, message="You don't have access to this Product")
 query = Q(product=product)
 if request.GET:
  if (('status' in request.GET) and request.GET['status']):
   query = (query & _get_filter_query(request.GET))
  else:
   query = ((query & Q(status__hidden=False)) & _get_filter_query(request.GET))
 else:
  query = (query & Q(status__hidden=False))
 subproducts = Object.filter_by_request(request, Product.objects.filter(parent=product))
 subscriptions = product.subscription_set.all()
 return render_to_response('sales/product_view', {'product': product, 'subproducts': subproducts, 'subscriptions': subscriptions}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def product_view ( request , product_id , response_format = 'html' ) : product = get_object_or_404 ( Product , pk = product_id ) if ( ( not request . user . profile . has_permission ( product ) ) and ( not request . user . profile . is_admin ( 'treeio.sales' ) ) ) : return user_denied ( request , message = "You don't have access to this Product" ) query = Q ( product = product ) if request . GET : if ( ( 'status' in request . GET ) and request . GET [ 'status' ] ) : query = ( query & _get_filter_query ( request . GET ) ) else : query = ( ( query & Q ( status__hidden = False ) ) & _get_filter_query ( request . GET ) ) else : query = ( query & Q ( status__hidden = False ) ) subproducts = Object . filter_by_request ( request , Product . objects . filter ( parent = product ) ) subscriptions = product . subscription_set . all ( ) return render_to_response ( 'sales/product_view' , { 'product' : product , 'subproducts' : subproducts , 'subscriptions' : subscriptions } , context_instance = RequestContext ( request ) , response_format = response_format )
product view .