@handle_response_format
@treeio_login_required
def contact_view(request, contact_id, attribute='', response_format='html'):
 contact = get_object_or_404(Contact, pk=contact_id)
 if (not request.user.profile.has_permission(contact)):
  return user_denied(request, message="You don't have access to this Contact")
 types = Object.filter_by_request(request, ContactType.objects.order_by('name'))
 subcontacts = Object.filter_by_request(request, contact.child_set)
 contact_values = contact.contactvalue_set.order_by('field__name')
 objects = get_contact_objects(request.user.profile, contact, preformat=True)
 module = None
 for key in objects:
  if (not attribute):
   if objects[key]['count']:
    module = objects[key]['module']
  elif (attribute in objects[key]['objects'].keys()):
   module = objects[key]['module']
   break
 return render_to_response('identities/contact_view', {'contact': contact, 'subcontacts': subcontacts, 'objects': objects, 'current_module': module, 'attribute': attribute, 'types': types, 'contact_values': contact_values}, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def contact_view ( request , contact_id , attribute = '' , response_format = 'html' ) : contact = get_object_or_404 ( Contact , pk = contact_id ) if ( not request . user . profile . has_permission ( contact ) ) : return user_denied ( request , message = "You don't have access to this Contact" ) types = Object . filter_by_request ( request , ContactType . objects . order_by ( 'name' ) ) subcontacts = Object . filter_by_request ( request , contact . child_set ) contact_values = contact . contactvalue_set . order_by ( 'field__name' ) objects = get_contact_objects ( request . user . profile , contact , preformat = True ) module = None for key in objects : if ( not attribute ) : if objects [ key ] [ 'count' ] : module = objects [ key ] [ 'module' ] elif ( attribute in objects [ key ] [ 'objects' ] . keys ( ) ) : module = objects [ key ] [ 'module' ] break return render_to_response ( 'identities/contact_view' , { 'contact' : contact , 'subcontacts' : subcontacts , 'objects' : objects , 'current_module' : module , 'attribute' : attribute , 'types' : types , 'contact_values' : contact_values } , context_instance = RequestContext ( request ) , response_format = response_format )
contact view .