def points_values(self, user_ref, acc_ref, height, width): points = 0 if user_ref: points = user_ref.points points_ref = None if not acc_ref: points_ref = Points() else: try: points_ref = acc_ref.pointsWidget except: points_ref = widgets_dao.add_points(acc_ref) ret = {"status":"success"} # here we get the custom points settings for ii in points_ref.properties(): ret[ii] = getattr(points_ref, ii) points = format_integer(points) ret['points'] = points # Internal div's need to be slighy smaller than the iframe if width and height: try: width = int(width) height = int(height) # How did I get this equation? Trial and error. height = height - 2 *int(ret['borderThickness']) - 8 width = width - 2 *int(ret['borderThickness']) - 8 ret['height'] = height ret['width'] = width except: pass return ret
def get_points_properties_to_render(email): return get_values("Points", email, Points.properties())
def get_points_properties_to_render(email): return get_values("Points", email, Points.properties())