Exemplo n.º 1
0
 def evNewMember(self):
     dlg = od.OptionsDialog(top,(
                            ["Name",""],
                            ["Email",""]))
     if dlg.changed:
        data.update_member(None,dlg.options[0][1],dlg.options[1][1])
        self.members = data.get_members()
        self.populateMemberList()
Exemplo n.º 2
0
 def evEditMember(self, event=None):
     indices = self.memberList.curselection()
     index = int(indices[0]) if indices else 0
     mbr = self.members[index]
     dlg = od.OptionsDialog(top, (["Name", mbr[1]], ["Email", mbr[2]]))
     if dlg.changed:
         data.update_member(mbr[0], dlg.options[0][1], dlg.options[1][1])
         self.members = data.get_members()
         self.populateMemberList()
Exemplo n.º 3
0
    def ev_edit_member(self, event=None):
        indices = self.member_list.curselection()
        index = int(indices[0]) if indices else 0
        mbr = self.members[index]
        dlg = od.OptionsDialog(top, (["Name", mbr[1]], ["Email", mbr[2]]))

        if dlg.changed:
            data.update_member(mbr[0], dlg.options[0][1], dlg.options[1][1])
            self.members = data.get_members()
            self.populate_member_list()
Exemplo n.º 4
0
 def evNewMember(self):
     dlg = od.OptionsDialog(top, (["Name", ""], ["Email", ""]))
     if dlg.changed:
         data.update_member(None, dlg.options[0][1], dlg.options[1][1])
         self.members = data.get_members()
         self.populateMemberList()
Exemplo n.º 5
0
print(ld.get_items())

ld.insert_item('Python Projects','Book',6,30,'Excellent')
###
# this should not have worked..... BUT IT DID. WTF PRAGMA?!>!?
###

ld.insert_member('Alan','*****@*****.**')
print(ld.get_members())
ld.insert_item('Python Projects','Book',6,30,'Excellent')
ld.get_items()

ld.update_item(7,Price=25)
ld.get_item_details(7)
ld.get_member_name(6)
ld.update_member(6,Name='Alan Gould')
ld.get_member_details(6)

ld.delete_member(6)  # this also shouldn't work due to referential integrity, but does...
ld.delete_item(7)
ld.delete_member(6)

ld.cursor.execute("""
    select * from item
    where OwnerID in (select id from member where name like '%e%')
    """).fetchall()

ld.cursor.execute("""
    select * from item
    where ownerid not in (select id from member where name like '%e%')
    """).fetchall()