コード例 #1
0
ファイル: entity.py プロジェクト: nessc/inphosite
    def list_new(self):
        if not h.auth.is_logged_in():
            response.status_int = 401
            return "Unauthorized"
        if not h.auth.is_admin():
            response.status_int = 403
            return "Forbidden"

        addlist = sep.new_entries()
        titles = sep.get_titles()

        c.entries = []

        #perform a fuzzy match for each page and construct an appropriate link
        for sep_dir in addlist:
            #create a link for each entry in addlist()
            link = h.url(controller='entity',
                         action='new',
                         label=titles[sep_dir],
                         sep_dir=sep_dir)
            c.entries.append({
                'sep_dir': sep_dir,
                'title': titles[sep_dir],
                'link': link,
                'published': sep.published(sep_dir)
            })

        return render('admin/newentries.html')
コード例 #2
0
ファイル: autotest.py プロジェクト: inpho/testcases
 def test_sep_publishing_list(self):
     """
     SEP Publishing list
     Verify items are not already in database. Check sep_dir fields.
     """
     new = sep.new_entries()
     entries_in_db = 0
     for entry in new:
         if(len(Session.query(Entity).filter(Entity.sep_dir == entry).all()) > 0):
             entries_in_db += 1
             print entry
     self.assertEqual(entries_in_db, 0)
コード例 #3
0
ファイル: __init__.py プロジェクト: we1l1n/inpho
 def test_sep_publishing_list(self):
     """
     SEP Publishing list
     Verify items are not already in database. Check sep_dir fields at /admin
     """
     new = sep.new_entries()
     entries_in_db = 0
     for entry in new:
         if (len(
                 Session.query(Entity).filter(
                     Entity.sep_dir == entry).all()) > 0):
             entries_in_db += 1
             print entry
     self.assertEqual(entries_in_db, 0)
コード例 #4
0
ファイル: entity.py プロジェクト: inpho/inphosite
    def list_new(self):
        if not h.auth.is_logged_in():
            response.status_int = 401
            return "Unauthorized"
        if not h.auth.is_admin():
            response.status_int = 403
            return "Forbidden"

        addlist = sep.new_entries()
        titles = sep.get_titles()

        c.entries = []

        # perform a fuzzy match for each page and construct an appropriate link
        for sep_dir in addlist:
            # create a link for each entry in addlist()
            link = h.url(controller="entity", action="new", label=titles[sep_dir], sep_dir=sep_dir)
            c.entries.append(
                {"sep_dir": sep_dir, "title": titles[sep_dir], "link": link, "published": sep.published(sep_dir)}
            )

        return render("admin/newentries.html")