def notifier_values(self, user_ref, acc_ref, height, width): token = 0 notifier_ref = None if not acc_ref: notifier_ref = Notifier() else: try: notifier_ref = acc_ref.notifierWidget except: notifier_ref = widgets_dao.add_notifier(acc_ref) token = notifier.get_channel_token(user_ref) ret = {"status":"success"} ret["token"] = token # here we get the custom settings for ii in notifier_ref.properties(): ret[ii] = getattr(notifier_ref, ii) # 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']) - 16 #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_notifier_properties_to_render(email): return get_values("Notifier", email, Notifier.properties())