Пример #1
0
    def post(self, id):
        id = int(id)
        txt = self.get_argument('txt', None)
        rt = self.get_argument('rt', None)
        title = self.get_argument('name', None)
        sync = self.get_argument('sync', None)
        po = RssPo.mc_get(id)
        po.txt = txt
        next = self.get_argument('next', None) or '/rss/index'
        if rt:
            po.state = RSS_RT_PO
        else:
            po.state = RSS_PRE_PO
        site = self.get_argument('site', None)
        if site:
            po.site_id = site
        if title:
            po.title = title
        po.save()

        if sync:
            site_sync_new(id)
        else:
            site_sync_rm(id)

        self.redirect(next)
Пример #2
0
def _edit(broad, sync, site, po, id):
    if broad:
        from model.po_recommend import po_recommend_new
        test_po = Po.get(rid=po.id, user_id=0, state=STATE_ACTIVE)
        if not test_po:
            po_recommend_new(po.id, 0, '')
    else:
        po_show_rm(po)

    if sync:
        site_sync_new(id)
    else:
        site_sync_rm(id)

    if site:
        po.zsite_id_set(site)
Пример #3
0
def _edit(broad, sync, site, po, id):
    if broad:
        from model.po_recommend import po_recommend_new

        test_po = Po.get(rid=po.id, user_id=0, state=STATE_ACTIVE)
        if not test_po:
            po_recommend_new(po.id, 0, "")
    else:
        po_show_rm(po)

    if sync:
        site_sync_new(id)
    else:
        site_sync_rm(id)

    if site:
        po.zsite_id_set(site)
Пример #4
0
 def get(self, id):
     site_sync_rm(id)
     self.redirect('/po/show/set/%s' % id)
Пример #5
0
 def get(self, id):
     site_sync_rm(id)
     self.redirect("/po/show/set/%s" % id)