def get(self, user_id = -1): greeting = self.GenerateGreeting() user = users.get_current_user() if user_id == -1 and user: user_id = user.user_id(); items = models.get_user_items( user_id ) self.PrepItemTemplate( items ) muser = _get_user_by_id( user_id ) template_values = {'user':user, 'user_id':user_id, 'items':items, 'greeting':greeting, 'username': muser.username } path = os.path.join( os.path.dirname( __file__ ), 'templates/view_items.htm' ) self.response.out.write( template.render( path, template_values ) )
def get(self, current_url, profileurl): # set all objects to be passed to template as False so we won't get object passed before instantiated errors profile = False items = False ratings = False userlocations = False useraccount = models.get_current_auth_user(self) profile = models.UserAccount.get_by_key_name(profileurl) if profile: items = models.get_user_items(profile) ratings = models.get_user_ratings(profile) userlocations = models.get_userlocations_for_user(profile) template_values = { 'useraccount': useraccount, 'user_action_url': helpers.get_user_action_url(useraccount, current_url), 'profile': profile, 'items': items, 'ratings': ratings, 'userlocations': userlocations, } viewhelpers.render_template(self, "views/profile", template_values)