Exemple #1
0
    def render(self, session, bunker, room, building, fullname, comments,
               **arguments):
        if room:
            dbparent = Room.get_unique(session, room, compel=True)
        elif building:
            dbparent = Building.get_unique(session, building, compel=True)
        else:  # pragma: no cover
            raise ArgumentError("Please specify either --room or --building.")

        add_location(session, Bunker, bunker, dbparent, fullname=fullname,
                     comments=comments)

        session.flush()

        return
Exemple #2
0
    def render(self, session, desk, room, building, fullname, comments,
               **arguments):
        if room:
            dbparent = Room.get_unique(session, room, compel=True)
        elif building:
            dbparent = Building.get_unique(session, building, compel=True)
        else:  # pragma: no cover
            raise ArgumentError("Please specify either --room or --building.")

        add_location(session,
                     Desk,
                     desk,
                     dbparent,
                     fullname=fullname,
                     comments=comments)

        session.flush()

        return
Exemple #3
0
 def render(self, session, room, **arguments):
     return Room.get_unique(session, room, compel=True)