Beispiel #1
0
    def RemoveDataVersion(self):
        stype = int(request.params['stype'])
        version = int(request.params['version'])

        if stype <= 0 or version <= 0:
            return "参数错误"
        o = self.data_version_.filter_by(stype=stype, version=version).first()

        Session.delete(o)
        Session.commit()
        return '成功删除版本' + str(version)
Beispiel #2
0
  def RemoveDataVersion(self):
    stype = int(request.params['stype'])
    version = int(request.params['version'])

    if stype <= 0 or version <= 0:
      return "参数错误"
    o = self.data_version_.filter_by(stype=stype, version=version).first()

    Session.delete(o)
    Session.commit()
    return '成功删除版本' + str(version)
Beispiel #3
0
  def RemoveTemplate(self):
    if self.UserRight(request, response) < 2:
      return '"没有操作权限, 请确保管理员帐号登录"'

    tpl_id = int(request.params['tpl_id'])
    view = int(request.params['view'])
    if tpl_id <= 0 or view < 0:
      return '参数错误'

    tpl = self.tpl_views_.filter_by(tpl_id = tpl_id, view = view).first()

    Session.delete(tpl)
    Session.commit()

    return '删除模板成功'
Beispiel #4
0
    def RemoveTemplate(self):
        if self.UserRight(request, response) < 2:
            return '"没有操作权限, 请确保管理员帐号登录"'

        tpl_id = int(request.params['tpl_id'])
        view = int(request.params['view'])
        if tpl_id <= 0 or view < 0:
            return '参数错误'

        tpl = self.tpl_views_.filter_by(tpl_id=tpl_id, view=view).first()

        Session.delete(tpl)
        Session.commit()

        return '删除模板成功'
Beispiel #5
0
  def RemoveStype(self):
    if self.UserRight(request, response) < 2:
      return '"没有操作权限, 请确保管理员帐号登录"'

    stype_id = int(request.params['stype_id'])
    if stype_id <= 0:
      return '参数错误'

    # 删除stype 
    stype_cfg = self.stype_config_.filter_by(stype = stype_id).first()
    Session.delete(stype_cfg)
 
    # 删除数据格式定义
    schemas = self.data_version_.filter_by(stype = stype_id).first()
    Session.delete(schemas)

    # TODO : 删除模板

    Session.commit()

    return '成功删除新鲜事类型' + str(stype_id)
Beispiel #6
0
    def RemoveStype(self):
        if self.UserRight(request, response) < 2:
            return '"没有操作权限, 请确保管理员帐号登录"'

        stype_id = int(request.params['stype_id'])
        if stype_id <= 0:
            return '参数错误'

        # 删除stype
        stype_cfg = self.stype_config_.filter_by(stype=stype_id).first()
        Session.delete(stype_cfg)

        # 删除数据格式定义
        schemas = self.data_version_.filter_by(stype=stype_id).first()
        Session.delete(schemas)

        # TODO : 删除模板

        Session.commit()

        return '成功删除新鲜事类型' + str(stype_id)
Beispiel #7
0
 def RemoveUserApply(self):
   apply_id = request.params['apply_id']
   a = self.user_applies_.filter_by(apply_id = apply_id).first()
   Session.delete(a)
   Session.commit()
   return '删除成功'
Beispiel #8
0
 def RemoveUserApply(self):
     apply_id = request.params['apply_id']
     a = self.user_applies_.filter_by(apply_id=apply_id).first()
     Session.delete(a)
     Session.commit()
     return '删除成功'