Hi,
I am new in the forum...
I have a little project to present in my class in python ,but I found troubles with my program... the program represent a class loggin ,to verify user and password from a table in sql oracle ...here is a part from the code ...I know I have so many mistakes ...that's why I ask you to help me...
N.B : my class should be called by another program (main program)and should not be the main ...
my partners are developping there own programs like graphical loggin,creating tables ,inventories ...
--------------------------
import cx_Oracle
droit=""
class Loggin(object):
droit=""
class Loggin(object):
def testuser(name_user,pass_user):
self.conn= cx_Oracle.connect('a5harris','a','Hades')
self.curseur = self.conn.cursor()
self.curseur.fetchall()
nblignes = self.curseur.rowcount
print nblignes
self.curseur.execute ("Select * from usagers")
print self.curseur.fetchone()
print self.curseur.fetchraw([numRows = self.curseur.arraysize])
print self.curseur.fetchone()
for i in range (nblignes):
print self.curseur.fetchone()
print self.curseur.fetchone()
print self.curseur.fetchone()[0]
while nblignes:
if ( name_user=self.curseur.execute("select name from usagers where name='carl'")
and pass_user=self.curseur.execute("select pass from usagers where name='carl'")):
droit=self.curseur.execute("select droit from usagers where name='carl'")
return droit
and pass_user=self.curseur.execute("select pass from usagers where name='carl'")):
droit=self.curseur.execute("select droit from usagers where name='carl'")
return droit
if ( name_user=self.curseur.execute("select name from usagers where name='ismail'")
and pass_user=self.curseur.execute("select pass from usagers where name='ismail'")):
droit=self.curseur.execute("select droit from usagers where name='ismail'")
return droit
and pass_user=self.curseur.execute("select pass from usagers where name='ismail'")):
droit=self.curseur.execute("select droit from usagers where name='ismail'")
return droit
if ( name_user=self.curseur.execute("select name from usagers where name='hua'")
and pass_user=self.curseur.execute("select pass from usagers where name='hua'")):
droit=self.curseur.execute("select droit from usagers where name='hua'")
return droit
and pass_user=self.curseur.execute("select pass from usagers where name='hua'")):
droit=self.curseur.execute("select droit from usagers where name='hua'")
return droit
if ( name_user=self.curseur.execute("select name from usagers where name='dominique'")
and pass_user=self.curseur.execute("select pass from usagers where name='dominique'")):
droit=self.curseur.execute("select droit from usagers where name='dominique'")
return droit
if ( name_user=self.curseur.execute("select name from usagers where name='serge'")
and pass_user=self.curseur.execute("select pass from usagers where name='serge'")):
droit=self.curseur.execute("select droit from usagers where name='serge'")
return droit
if ( name_user=self.curseur.execute("select name from usagers where name='abdel'")
and pass_user=self.curseur.execute("select pass from usagers where name='abdel'")):
droit=self.curseur.execute("select droit from usagers where name='abdel'")
return droit
def getNext(self):
print self.curs.fetchone()
print self.curs.fetchone()
def newSQL(self,monsql):
self.curs.execute(monsql)
self.curs.execute(monsql)
if __name__ == "__main__":
maDb=Loggin()
maDb.testuser("ismail","ismail")
print maDb.conn
maDb.getNext()
-------------------
I don't have much time ...please help me
Il ne vous reste quÂ’une semaine pour entreprendre un voyage virtuel dans le cadre du concours Le tour du monde de MSN Recherche.
_______________________________________________ DB-SIG maillist - DB-SIG@python.org http://mail.python.org/mailman/listinfo/db-sig