Ejemplo n.º 1
0
 def getAll(self, o_competition):
     """
     Get all Goals Object
     :return: list of Goals
     """
     rep = AbstractDAO._read(self, R_READALL, [o_competition.id])
     return self.__fetch_to_object(rep)
Ejemplo n.º 2
0
 def update(self, o_team):
     if isinstance(o_team, Team):
         lparam = [o_team.name,
                   o_team.comment,
                   o_team.id]
         rep = AbstractDAO._update(self, R_UPDATE, lparam)
         return rep
Ejemplo n.º 3
0
 def insert(self, obj):
     if isinstance(obj, Competition):
         lparam = [
             obj.name, obj.pts_win, obj.pts_null, obj.pts_lose,
             obj.tworound, obj.comment
         ]
         index = AbstractDAO._insert(self, R_INSERT, lparam)
         obj.id = index
Ejemplo n.º 4
0
 def update(self, o_match):
     if isinstance(o_match, Match):
         lparam = [o_match.datetime,
                   o_match.comment,
                   o_match.isplayed,
                   o_match.id]
         rep = AbstractDAO._update(self, R_UPDATE, lparam)
         return rep
Ejemplo n.º 5
0
 def update(self, obj):
     if isinstance(obj, Competition):
         lparam = [
             obj.name, obj.pts_win, obj.pts_null, obj.pts_lose,
             obj.tworound, obj.comment, obj.id
         ]
         rep = AbstractDAO._update(self, R_UPDATE, lparam)
         return rep
Ejemplo n.º 6
0
 def getById(self, id_goals):
     """
     Get Goals Object By it id
     :param id_goals: id of Goals Object
     :return: Goals Object
     """
     lparam = [id_goals]
     rep = AbstractDAO._read(self, R_READBYID, lparam)
     return self.__fetch_to_object(rep, True)
Ejemplo n.º 7
0
 def delete(self, o_goals):
     """
     Delete Goals Object
     :param o_goals: Goals Object
     :return: boolean, result of operation
     """
     if isinstance(o_goals, Goals):
         lparam = [o_goals.id]
         rep = AbstractDAO._delete(self, R_DELETE, lparam)
         return rep
Ejemplo n.º 8
0
 def insert(self, o_goals):
     """
     Insert Goals Object
     :param o_goals: Goals Object
     """
     if isinstance(o_goals, Goals):
         lparam = [
             o_goals.comment, o_goals.idplayer_ass, o_goals.idplayer_scorer,
             o_goals.idmatch, o_goals.idequipe
         ]
         rep = AbstractDAO._insert(self, R_INSERT, lparam)
         o_goals.id = rep
Ejemplo n.º 9
0
 def update(self, o_goals):
     """
     Update Goals Object
     :param o_goals: Goals Object
     :return: boolean, result of operation
     """
     if isinstance(o_goals, Goals):
         lparam = [
             o_goals.comment, o_goals.idplayer_ass, o_goals.idplayer_scorer,
             o_goals.id
         ]
         rep = AbstractDAO._update(self, R_UPDATE, lparam)
         return rep
Ejemplo n.º 10
0
 def getMatchPlayed(self, o_competition):
     lparam = [o_competition.id]
     rep = AbstractDAO._read(self, R_MATCHPLAYED, lparam)
     return self.__fetch_to_object(rep)
Ejemplo n.º 11
0
 def getNextMatch(self, o_competition):
     lparam = [o_competition.id]
     rep = AbstractDAO._read(self, R_NEXTMATCH, lparam)
     return self.__fetch_to_object(rep, True)
Ejemplo n.º 12
0
 def getAll(self, o_competition):
     rep = AbstractDAO._read(self, R_READALL, [str(o_competition.id)])
     return self.__fetch_to_object(rep)
Ejemplo n.º 13
0
 def getByName(self, str_team):
     lparam = [str_team]
     rep = AbstractDAO._read(self, R_READBYNAME, lparam)
     return self.__fetch_to_object(rep)
Ejemplo n.º 14
0
 def delete(self, o_team):
     if isinstance(o_team, Team):
         lparam = [o_team.id]
         rep = AbstractDAO._delete(self, R_DELETE, lparam)
         return rep
Ejemplo n.º 15
0
 def getAll(self):
     rep = AbstractDAO._read(self, R_READALL)
     return self.__fetch_to_object(rep)
Ejemplo n.º 16
0
 def delete(self, obj):
     if isinstance(obj, Competition):
         lparam = [obj.id]
         rep = AbstractDAO._delete(self, R_DELETE, lparam)
         return rep
Ejemplo n.º 17
0
 def delete(self, o_match):
     if isinstance(o_match, Match):
         lparam = [o_match.id]
         rep = AbstractDAO._delete(self, R_DELETE, lparam)
         return rep
Ejemplo n.º 18
0
 def getById(self, id_match):
     lparam = [str(id_match)]
     rep = AbstractDAO._read(self, R_READBYID, lparam)
     return self.__fetch_to_object(rep, True)
Ejemplo n.º 19
0
 def getByMatch(self, o_match):
     rep = AbstractDAO._read(self, R_READBYMATCH, [o_match.id])
     return self.__fetch_to_object(rep)
Ejemplo n.º 20
0
 def getByName(self, oname):
     lparam = [oname]
     rep = AbstractDAO._read(self, R_READBYNAME, lparam)
     return self.__fetch_to_object(rep, True)