Exemple #1
0
def listCreated(request, user_name):
    try :
        thereturn = custompopup(request,'<p>Sorry, we were unable to display this page.</p>')
        loggedin, user, loggedin_user, follow, data = getUserVariables(request, user_name)
        logged_in_user = get_logged_in_user(request)
        request_user = get_user_by_name(request, user_name)
        if request_user != False :
            hubs = get_hubs_by_user(request, request_user)
            if len(hubs) == 0 :
                if loggedin and user_name == user['user_name'] :
                    thereturn = render_to_response('partial_user_nocreatedhubsmyself.html',locals(),context_instance=RequestContext(request))
                else :
                    thereturn = render_to_response('partial_user_nocreatedhubs.html',locals(),context_instance=RequestContext(request))
            else :
                response = {'data': {'hubs': hubs }}
                if loggedin :
                    from webapp.views.user import getUserHubs
                    response['data']['joinedhubs'] = getUserHubs(user['user_name'])
                    if user_name == user['user_name'] :
                        response['data']['createdhubs'] = [hub.hub_id for hub in response['data']['hubs']]
                thereturn = render_to_response('partial_user_createdhubs.html',locals(),context_instance=RequestContext(request))
        return thereturn
    except :
        logger=logging.getLogger(__name__)
        return errorscreen(request,logger, sys)
Exemple #2
0
def listCreated(request, user_name):
    try:
        thereturn = custompopup(
            request, '<p>Sorry, we were unable to display this page.</p>')
        loggedin, user, loggedin_user, follow, data = getUserVariables(
            request, user_name)
        logged_in_user = get_logged_in_user(request)
        request_user = get_user_by_name(request, user_name)
        if request_user != False:
            hubs = get_hubs_by_user(request, request_user)
            if len(hubs) == 0:
                if loggedin and user_name == user['user_name']:
                    thereturn = render_to_response(
                        'partial_user_nocreatedhubsmyself.html',
                        locals(),
                        context_instance=RequestContext(request))
                else:
                    thereturn = render_to_response(
                        'partial_user_nocreatedhubs.html',
                        locals(),
                        context_instance=RequestContext(request))
            else:
                response = {'data': {'hubs': hubs}}
                if loggedin:
                    from webapp.views.user import getUserHubs
                    response['data']['joinedhubs'] = getUserHubs(
                        user['user_name'])
                    if user_name == user['user_name']:
                        response['data']['createdhubs'] = [
                            hub.hub_id for hub in response['data']['hubs']
                        ]
                thereturn = render_to_response(
                    'partial_user_createdhubs.html',
                    locals(),
                    context_instance=RequestContext(request))
        return thereturn
    except:
        logger = logging.getLogger(__name__)
        return errorscreen(request, logger, sys)
Exemple #3
0
 def get_hubs(self, request):
     if self.hubs == []:
         self.hubs = get_hubs_by_user(request, self)
     return self.hubs
Exemple #4
0
	def get_hubs(self, request):
		if self.hubs  == []:
			self.hubs = get_hubs_by_user(request, self) 
		return self.hubs