Пример #1
0
 def get(self, path=""):
     """
     HANDLE
     HANDLE/edit|delete
     /add
     b2cfa6ca1e174b1f63d/remove/eventref/1
     """
     page = int(self.get_argument("page", 1))
     search = self.get_argument("search", "")
     if "/" in path:
         handle, action= path.split("/", 1)
     else:
         handle, action = path, "view"
     # We don't need connections to other things
     # and will in fact add a new Table:
     if handle:
         table = Table()
         action = table.get_item_by_handle(handle)
         self.render("action.html",
                     **self.get_template_dict(tview=_("action detail"),
                                              page=page,
                                              search=search,
                                              form=ActionForm(self.database, _, instance=action),
                                          )
                 )
     else:
         self.render("page_view.html",
                     **self.get_template_dict(tview=_("action view"),
                                              page=page,
                                              search=search,
                                              form=ActionForm(self.database, _, table="Action"),
                                          )
                 )
Пример #2
0
 def get(self, path=""):
     """
     HANDLE
     HANDLE/edit|delete
     /add
     b2cfa6ca1e174b1f63d/remove/eventref/1
     """
     page = int(self.get_argument("page", 1))
     search = self.get_argument("search", "")
     if "/" in path:
         handle, action = path.split("/", 1)
     else:
         handle, action = path, "view"
     if handle:
         if handle == "add":
             person = Person()
             person.primary_name.surname_list.append(Surname())
             action = "edit"
         else:
             person = self.database.get_person_from_handle(handle)
         if person:
             person.probably_alive = True
             self.render(
                 "person.html",
                 **self.get_template_dict(tview=_("person detail"),
                                          action=action,
                                          page=page,
                                          search=search,
                                          form=PersonForm(self.database,
                                                          _,
                                                          instance=person),
                                          logform=None))
             return
         else:
             self.clear()
             self.set_status(404)
             self.finish("<html><body>No such person</body></html>")
             return
     self.render(
         "page_view.html",
         **self.get_template_dict(
             tview=_("person view"),
             page=page,
             search=search,
             form=PersonForm(self.database, _, table="Person"),
         ))
Пример #3
0
 def get(self, path=""):
     """
     HANDLE
     HANDLE/edit|delete
     /add
     b2cfa6ca1e174b1f63d/remove/eventref/1
     """
     page = int(self.get_argument("page", 1))
     search = self.get_argument("search", "")
     if "/" in path:
         handle, action = path.split("/", 1)
     else:
         handle, action = path, "view"
     if handle:
         if handle == "add":
             citation = Citation()
             action = "edit"
         else:
             citation = self.database.get_citation_from_handle(handle)
         if citation:
             self.render(
                 "citation.html",
                 **self.get_template_dict(tview=_("citation detail"),
                                          action=action,
                                          page=page,
                                          search=search,
                                          form=CitationForm(
                                              self.database,
                                              _,
                                              instance=citation),
                                          logform=None))
             return
         else:
             self.clear()
             self.set_status(404)
             self.finish("<html><body>No such citation</body></html>")
             return
     self.render(
         "page_view.html",
         **self.get_template_dict(
             tview=_("citation view"),
             page=page,
             search=search,
             form=CitationForm(self.database, _, table="Citation"),
         ))
Пример #4
0
 def get(self, path=""):
     """
     HANDLE
     HANDLE/edit|delete
     /add
     b2cfa6ca1e174b1f63d/remove/eventref/1
     """
     page = int(self.get_argument("page", 1))
     search = self.get_argument("search", "")
     if "/" in path:
         handle, action= path.split("/", 1)
     else:
         handle, action = path, "view"
     if handle:
         if handle == "add":
             person = Person()
             person.primary_name.surname_list.append(Surname())
             action = "edit"
         else:
             person = self.database.get_person_from_handle(handle)
         if person:
             person.probably_alive = True
             self.render("person.html",
                         **self.get_template_dict(tview=_("person detail"),
                                                  action=action,
                                                  page=page,
                                                  search=search,
                                                  form=PersonForm(self.database, _, instance=person),
                                                  logform=None))
             return
         else:
             self.clear()
             self.set_status(404)
             self.finish("<html><body>No such person</body></html>")
             return
     self.render("page_view.html",
                 **self.get_template_dict(tview=_("person view"),
                                          page=page,
                                          search=search,
                                          form=PersonForm(self.database, _, table="Person"),
                                      )
             )
Пример #5
0
 def get(self, path=""):
     """
     HANDLE
     HANDLE/edit|delete
     /add
     b2cfa6ca1e174b1f63d/remove/eventref/1
     """
     page = int(self.get_argument("page", 1))
     search = self.get_argument("search", "")
     if "/" in path:
         handle, action= path.split("/", 1)
     else:
         handle, action = path, "view"
     if handle:
         if handle == "add":
             media = Media()
             action = "edit"
         else:
             media = self.database.get_media_from_handle(handle)
         if media:
             self.render("media.html",
                         **self.get_template_dict(tview=_("media detail"),
                                                  action=action,
                                                  page=page,
                                                  search=search,
                                                  form=MediaForm(self.database, _, instance=media),
                                                  logform=None))
             return
         else:
             self.clear()
             self.set_status(404)
             self.finish("<html><body>No such media</body></html>")
             return
     self.render("page_view.html",
                 **self.get_template_dict(tview=_("media view"),
                                          page=page,
                                          search=search,
                                          form=MediaForm(self.database, _, table="Media"),
                                      )
             )