def createTable(cls, model): # write a model to the file storage = FileHandler("data") page = [] # TODO warp in try-except page = storage.read_page().next() tablePage = len(page)/2 + 1 # 2 is a numer of fields in Table entity page.append(model.__name__) page.append(tablePage) storage.write_page(page) storage.write_page(["null", ], tablePage, True)
def createTable(self, model): # write a model to the file storage = FileHandler("data") page = storage.read_page().next() page.append(model.__name__) storage.write_page(page)