def on_tree_books_row_activated(self, treeview, path, view_column): object_p = TreeviewProxy(treeview).get_selected_row() self.add_edit('book', object_p) def add_editor(self, widget): self.add_edit('editor') def add_author(self, widget): self.add_edit('author') def add_serial(self, widget): self.add_edit('serial') def add_user(self, widget): self.add_edit('user') def add_book(self, widget): self.add_edit('book') if __name__ == '__main__': import os.path prefix = os.path.dirname(__file__) database.start(os.path.join(prefix, 'db.db')) ui = UI(os.path.join(prefix, 'ui/ui.xml')) ui.run() ui._w.show_all() gtk.main()
def on_tree_books_row_activated(self,treeview,path,view_column): object_p = TreeviewProxy(treeview).get_selected_row() self.add_edit('book',object_p) def add_editor(self,widget): self.add_edit('editor') def add_author(self,widget): self.add_edit('author') def add_serial(self,widget): self.add_edit('serial') def add_user(self,widget): self.add_edit('user') def add_book(self,widget): self.add_edit('book') if __name__ == '__main__': import os.path prefix = os.path.dirname(__file__) database.start(os.path.join(prefix,'db.db')) ui = UI(os.path.join(prefix,'ui/ui.xml')) ui.run() ui._w.show_all() gtk.main()
from bookeditor import BookEditor import clubBD.database as database import pygtk pygtk.require('2.0') import gtk import sys database.start('db.db') if sys.argv[1:]: id = sys.argv[1] obj = database.session.query(database.model.Book).get(id) else: obj = database.model.Book ui = BookEditor('ui/dialog_book.xml', ['title', 'ean', 'reference', 'buy_date', 'serial_nb'], obj) ret = ui.run() print ret, ret.id #gtk.main()
from bookeditor import BookEditor import clubBD.database as database import pygtk pygtk.require('2.0') import gtk import sys database.start('db.db') if sys.argv[1:]: id = sys.argv[1] obj = database.session.query(database.model.Book).get(id) else: obj = database.model.Book ui = BookEditor('ui/dialog_book.xml',['title','ean','reference','buy_date','serial_nb'],obj) ret = ui.run() print ret, ret.id #gtk.main()
from uieditor import UIEditor import clubBD.database as database import pygtk pygtk.require("2.0") import gtk import sys database.start("db.db") if sys.argv[1:]: id = sys.argv[1] obj = database.session.query(database.model.Editor).get(id) else: obj = database.model.Editor ui = UIEditor("ui/dialog_editor.xml", ["name"], obj) ret = ui.run() print ret, ret.id # gtk.main()