# coding: utf-8 import time from pony.orm import * from ._base import db, SessionMixin, ModelMixin import config import models as m from helpers import strip_tags from extensions import mc config = config.rec() class Node(db.Entity, SessionMixin, ModelMixin): user_id = Required(int, default=1) name = Required(unicode, 80, unique=True) urlname = Required(unicode, 80, unique=True) topic_count = Required(int, default=0) follow_count = Required(int, default=0) role = Required(unicode, 10, default='node') created_at = Required(int, default=int(time.time())) updated_at = Required(int, default=int(time.time())) active = Required(int, default=int(time.time())) description = Optional(LongUnicode) summary = Optional(LongUnicode) style = Optional(unicode, 6000)
from sqlalchemy.exc import IntegrityError from DoctorSpring.models import User,Patient,Doctor,Diagnose ,DiagnoseTemplate,Report,UserRole from DoctorSpring.models import User,Comment,Message,DiagnoseLog ,AlipayLog,AlipayChargeRecord from DoctorSpring.util import result_status as rs,object2dict ,constant,pdf_utils from DoctorSpring.util.authenticated import authenticated from DoctorSpring.util.constant import MessageUserType,Pagger, ReportType from DoctorSpring.util.pay import alipay import string from config import LOGIN_URL,ERROR_URL from DoctorSpring import app import data_change_service as dataChangeService import json import config config = config.rec() diagnoseView = Blueprint('diagnose', __name__) LOG=app.logger #领取诊断 @diagnoseView.route('/admin/diagnose/update', methods = ['GET', 'POST']) @authenticated('admin',constant.RoleId.Admin) def fetchDiagnoseByAdmin(): diagnoseId=request.form.get('diagnoseId') userId=session['userId'] # if diagnoseId is None :
import config __author__ = 'Jeremy' # coding: utf-8 from hashlib import md5 import time setting = config.rec() def getDay(timestamp): FORY = '%d' #os.environ["TZ"] = config.default_timezone #time.tzset() str = time.strftime(FORY, time.localtime(timestamp)) return str def getMonth(timestamp): FORY = '%b' #os.environ["TZ"] = config.default_timezone #time.tzset() str = time.strftime(FORY, time.localtime(timestamp)) return str def getAvatar(email, size=48): return \ 'http://gravatar.com/avatar/%s?d=identicon&s=%d&d=http://feather.im/static/img/gravatar.png' \ % (md5(email.strip().lower().encode('utf-8')).hexdigest(), size)