Exemplo n.º 1
0
                s = ' ' * k
                print(space + colored(str(self.tabele_imena[i]), 'magenta') + s + puscica + str(self.tabele[i]))

        else:
            print(space + str(None))

        print('Prebrano iz SQL:       ' + str(self.prebrano_iz_SQL))
        print('Neshranjene spremembe: ' + str(self.neshranjene_spremembe))
        print()


if __name__ == "__main__":
    b = Baza('Aladeen')
    b.izpis()
    t=Tabela('Neki')
    t.dodaj_vrstico()
    t.dodaj_vrstico()
    t.dodaj_vrstico()
    t.dodaj_vrstico()
    t.dodaj_vrstico()
    t1=Tabela('Neki druzga')
    t1.dodaj_vrstico()
    t1.dodaj_vrstico()
    t1.dodaj_vrstico()
    s1=Stolpec('neki bolšga')
    s1.izpis()
    s2=t.dodaj_podoben_stolpec(s1)
    s3=t1.dodaj_podoben_stolpec(s2)
    s1.izpis()
    s2.izpis()
    s3.izpis()
Exemplo n.º 2
0
    app = QtWidgets.QApplication(sys.argv)
    a = QtWidgets.QWidget()
    a.setMinimumSize(300, 300)
    b = QtWidgets.QVBoxLayout()
    c = QtFunkcije()

    t = Tabela('Stoški')
    i = Stolpec('ime', t)
    i.attribute = 'le'
    m = Stolpec('mesečni', t)
    m.attribute = 'ch'
    v = Stolpec('vrednost', t)

    k = Stolpec('kategorija', t)
    k.attribute = 'cb'

    t.tabela_ime = 'tabela'
    t.dodaj_vrstico()
    v = t.dodaj_vrstico()
    v.vrstica_vrednosti = [1, 2, 3, 4]
    t.dodaj_vrstico()

    c.dodajanje_vrstic(t, b)
    b.addWidget(c.tabla(t))

    b.addWidget(c.quit_button())

    a.setLayout(b)
    a.show()
    sys.exit(app.exec_())