Django:“ RegisterEmployeeView”对象没有属性“ object”

时间:2019-11-27 17:49:23

标签: python django

我正在使用django进行开发,执行我的运行服务器后,我在/ employee / register处出现AttributeError。

这是我的views.py

中的代码
f = get_sec(timeformat)
x = 0
n = 0
ab = True 

class timer(Thread):
    def run(self):
        global x, f, ab
        while ab:
            if x == n:
                c = n-x
                f = f-c
                x = n
            x = x + 1
            de.set(x)
            print(x)
            if x >= f:
                ab = False
            mins, secs = divmod(x, 60)
            mins = round(mins)
            secs = round(secs)
            songdurationleft = '{:02d}:{:02d}'.format(mins, secs)
            abc2['text']='playing'+songdurationleft
            time.sleep(1)

class setppos(Thread):
    def run(self):
        print('hi')
        global n
        b = de.get()
        mixer.music.set_pos(b)
        n = b

def gg():
    mixer.music.load(a)
    mixer.music.set_volume(0.2)
    mixer.music.play()
    T1 = timer(daemon=True)
    T2 = setppos(daemon=True)
    T1.start()
    T2.start()

abc = Button(r,command=gg,text='play/start threads')
abc.pack()
abc1 = Label(r,text=timeformat)
abc1.pack(side=LEFT)
abc2 = Label(r,text='song duration:')
abc2.pack(side=RIGHT)

de=Scale(r,from_=0,to_=f,orient=HORIZONTAL,sliderlength=10,length=600,tickinterval=5,showvalue=0,command
=setppos)
de.set(0)
de.pack()

r.mainloop()

TRACEBACK

0 个答案:

没有答案