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
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
def render(self, session, room, **arguments): return Room.get_unique(session, room, compel=True)