def import_category(self, filename ,category): dat=self.csv.load(filename) #ncat=data.item(parent=category,model="Default", contents=[]) for row in dat: print row #not ncat but cat #hack to prevent import from creating a new category data.item(parent=category, model=row[0], manufacturer=row[1], description=row[2], quantity=row[3], cost=row[4], location=row[5]) #self.add_category_parent( category, ncat) #not ncat but cat self.category_select(category)
def add_category(self, widget): if not self.category_selected: return itr = self.category_store.get_iter_first() parent_category=self.compare_children(self.category_store, self.category_selected, itr) item=data.item(parent=self.category_selected, model="Default", contents=[]) self.category_store.append(parent_category, [item, item.model])
def add_item(self, stuff): if self.category_selected==None: print "add_item, no category selected" self.category_selected=self.db.root print "adding_item, to "+self.category_selected.model item=data.item(parent=self.category_selected, model="Default") self.category_select( self.category_selected) """