Пример #1
0
 def display_collection(self, id):
     collection = Collection.get_by_id(self.db, id);
     if collection == None:
         raise Exception("No collection with id {}!".format(id))
     Collection.print_table_header()
     collection.print_for_table()
     items = Item.get_by_collection(self.db, collection.id)
     print("ITEMS")
     Item.print_table_header()
     for item in items:
         item.print_for_table()
Пример #2
0
 def display_item(self, id):
     item = Item.get_by_id(self.db, id);
     if item == None:
         raise Exception("No item with id {}!".format(id))
     Item.print_table_header()
     item.print_for_table()