Exemple #1
0
    def post(self):
        _id = self.get_argument("id", None)
        name = self.get_argument("name", None)
        intro = self.get_argument("intro", None)
        listname = self.get_argument("listname", None)
        logo = self.get_argument("logo", None)

        if not listname:
            listname = get_pinyin(name)

        if not _id:
            r, v = add(name,
                       listname,
                       logo=logo,
                       intro=intro,
                       seo=self.get_seo_params())
            self.write(dict(status=r, data=v))
        else:
            r = m_update(T_GROUP,
                         _id,
                         name=name,
                         listname=listname,
                         logo=logo,
                         intro=intro,
                         seo=self.get_seo_params())
            self.write(dict(status=r))
Exemple #2
0
    def post(self):
        try:
            obj = MArea.fetch_data(self)
            if not obj.get('listname', None):
                obj['listname'] = get_pinyin(obj['name'])

            obj['_id'] = self.get_argument('_id', None)
            if not obj['_id'] and MArea.exists(listname=obj['listname']):
                raise Exception('已存在域名:' + obj['listname'])

            r = MArea.save(obj)
            self.write(dict(status=True, data=r))
        except Exception as e:
            self.write(dict(status=False, errmsg=e.message))
Exemple #3
0
    def post(self):
        try:
            obj = MArea.fetch_data(self)
            if not obj.get('listname',None):
                obj['listname'] = get_pinyin(obj['name'])
            
            obj['_id'] = self.get_argument('_id',None)
            if not obj['_id'] and MArea.exists(listname = obj['listname']):
                raise Exception('已存在域名:'+obj['listname'])

            r = MArea.save(obj) 
            self.write(dict(status=True, data = r))
        except Exception as e:
            self.write(dict(status=False, errmsg = e.message))
Exemple #4
0
    def post(self):
        _id = self.get_argument("id", None)
        name = self.get_argument("name", None)
        intro = self.get_argument("intro", None)
        listname  = self.get_argument("listname", None)
        logo  = self.get_argument("logo", None)

        if not listname:
            listname = get_pinyin(name)
        
        if not _id:
            r,v = add(name,listname,logo = logo,intro = intro, seo = self.get_seo_params())
            self.write(dict(status = r, data =v ))
        else:
            r = m_update(T_GROUP,_id, name = name ,listname = listname,logo = logo,intro = intro ,seo = self.get_seo_params())
            self.write(dict(status = r))
Exemple #5
0
    def post(self):
        _id = self.get_argument("id", None)
        name = self.get_argument("name", None)
        logo = self.get_argument("logo", None)
        groupid = self.get_argument("groupid", None)
        listname = self.get_argument("listname", None)
        intro = self.get_argument("intro", None)
        tags = self.get_argument("tags", '').split('|')
        
        if not listname:
            listname = get_pinyin(name)

        if not _id:
            r,v = add(name, groupid,listname,intro, logo = logo, tags = tags ,seo = self.get_seo_params())
            self.write(dict(status = r, data =v ))
        else:
            r,v = m_update(T_CATEGORY,_id, name = name, groupid = groupid, listname = listname, intro = intro,logo = logo, tags = tags, seo = self.get_seo_params())
            self.write(dict(status = r,data = v))