예제 #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")