Exemplo n.º 1
0
 def exists(cls,iid,table):
     if table == "match":
         try:
             Match.get(iid=iid)
         except Match.DoesNotExist:
             return False
     if table == "odd":
         try:
             Odd.get(iid=iid)
         except Odd.DoesNotExist:
             return False
     if table == "cat":
         try:
             OddCategory.get(idd=iid)
         except OddCategory.DoesNotExist:
             return False
     if table == "result":
         try:
             Result.get(iid=iid)
         except Result.DoesNotExist:
             return False
     if table == "user":
         try:
             User.get(iid=iid)
         except User.DoesNotExist:
             return False
     return True
Exemplo n.º 2
0
 def exists(cls, iid, table):
     if table == "match":
         try:
             Match.get(iid=iid)
         except Match.DoesNotExist:
             return False
     if table == "odd":
         try:
             Odd.get(iid=iid)
         except Odd.DoesNotExist:
             return False
     if table == "cat":
         try:
             OddCategory.get(idd=iid)
         except OddCategory.DoesNotExist:
             return False
     if table == "result":
         try:
             Result.get(iid=iid)
         except Result.DoesNotExist:
             return False
     if table == "user":
         try:
             User.get(iid=iid)
         except User.DoesNotExist:
             return False
     return True