列出Kivy App中数据库中的所有名称

时间:2020-04-01 20:00:55

标签: python android kivy kivy-language

我正在创建一个应用程序,并且希望它列出数据库中所有用户的所有名称,电子邮件,扇区和创建日期。 现在,它仅显示当前用户的信息。这是python代码

class MainWindow(Screen):
n = ObjectProperty(None)
created = ObjectProperty(None)
email = ObjectProperty(None)
current = ""
sector= ObjectProperty(None)

def logOut(self):
    sm.current = "login"

def on_enter(self, *args):
    password, name, created, sector = db.get_user(self.current)
    self.n.text = "Account Name: " + name
    self.email.text = "Email: " + self.current
    self.created.text = "Created On: " + created
    self.sector.text = "Sector: " + sector

这是相应的kivy文件

<MainWindow>:
canvas.before:
    Rectangle:
        pos: self.pos
        size: self.size
        source: 'back2.jpg'

n: n
email: email
created:created
sector:sector

FloatLayout:
    Label:
        id: n
        pos_hint:{"x": 0.1, "top":0.9}
        size_hint:0.8, 0.2
        text: "Name: "
        color: 0, 0, 1, .5

    Label:
        id: email
        pos_hint:{"x": 0.1, "top":0.7}
        size_hint:0.8, 0.2
        text: "Email: "
        color: 0, 0, 1, .5

    Label:
        id: created
        pos_hint:{"x": 0.1, "top":0.5}
        size_hint:0.8, 0.2
        text: "Created: "
        color: 0, 0, 1, .5

    Label:
        id: sector
        pos_hint:{"x": 0.1, "top":0.3}
        size_hint:0.8, 0.2
        text: "Sector: "
        color: 0, 0, 1, .5

1 个答案:

答案 0 :(得分:0)

问题是您确切在哪里,您的问题描述性不够

相关问题