Example #1
0
    def insert(self, game):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Games']['insert'], CMD_TYPE_FUNCTION, (
            game.bar_code,
            game.new_bar_code if 'new_bar_code' in vars(
                game) else game.bar_code,
            game.name,
            game.price,
            game.cost,
            game.stock,
            game.score,
            game.local_trailer,
            game.web_trailer,
            game.cover,
            game.info_media.genre,
            game.info_media.minimum_age,
            game.info_media.producer,
            game.info_media.distributor,
            game.info_media.subtitles,
            game.info_media.audios,
            game.info_media.synopsis,
            game.info_media.fisic_type,
            game.players,
            game.is_online,
            game.console,
            game.status
        )
        )
Example #2
0
    def update(self, movie):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Movies']['update'], CMD_TYPE_FUNCTION, (
            movie.bar_code,
            movie.new_bar_code if 'new_bar_code' in vars(
                movie) else movie.bar_code,
            movie.name,
            movie.price,
            movie.cost,
            movie.stock,
            movie.score,
            movie.local_trailer,
            movie.web_trailer,
            movie.cover,
            movie.info_media.genre,
            movie.info_media.minimum_age,
            movie.info_media.producer,
            movie.info_media.distributor,
            movie.info_media.subtitles,
            movie.info_media.audios,
            movie.info_media.synopsis,
            movie.info_media.fisic_type,
            movie.cast,
            movie.duraction,
            movie.screen_format,
            movie.status
        )
        )
Example #3
0
    def get(self, identifier=None):

        sql = inout.get_queries_file()

        if identifier:
            return PgSqlDal.execute_query(sql['Address']['getOneOrMore'], CMD_TYPE_TEXT, (identifier,))
        else:
            return PgSqlDal.execute_query(sql['Address']['getAll'], CMD_TYPE_TEXT)
Example #4
0
    def update(self, cash_desk_mov):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['CashDeskMovs']['update'], CMD_TYPE_FUNCTION, (
            cash_desk_mov.value,
            cash_desk_mov.mov_type,
            cash_desk_mov.observations
        )
        )
Example #5
0
    def insert(self, cash_desk):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['CashDesks']['insert'], CMD_TYPE_FUNCTION, (
            cash_desk.functionary,
            cash_desk.cash_fund,
            cash_desk.observations,
        )
        )
Example #6
0
    def get(self, zip_number=None):
        """
        Return a list of tuples with the data of registers
        """

        sql = inout.get_queries_file()

        if zip_number:
            return PgSqlDal.execute_query(sql['ZipCodes']['getOneOrMore'], CMD_TYPE_TEXT, (zip_number,))
        else:
            return PgSqlDal.execute_query(sql['Zipcodes']['getAll'], CMD_TYPE_TEXT)
Example #7
0
    def update(self, address):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Address']['update'], CMD_TYPE_FUNCTION, (
            address.identifier,
            address.zip_code,
            address.number,
            address.complement
        )
        )
Example #8
0
    def update(self, devolution):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Devolutions']['update'], CMD_TYPE_FUNCTION, (
            devolution.identifier,
            devolution.products,
            devolution.value,
            devolution.observations,
            devolution.returned_by
        )
        )
Example #9
0
    def insert(self, cash_desk_mov):
        
        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['CashDeskMovs']['insert'], CMD_TYPE_FUNCTION, (
            cash_desk_mov.cash_desk,
            cash_desk_mov.functionary,
            cash_desk_mov.value,
            cash_desk_mov.mov_type,
            cash_desk_mov.observations
        )
        )
Example #10
0
    def insert(self, zip_code):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['ZipCodes']['insert'], CMD_TYPE_FUNCTION, (
            zip_code.zip_number,
            zip_code.state,
            zip_code.city,
            zip_code.neighborhood,
            zip_code.street
        )
        )
Example #11
0
    def update(self, rent):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Rents']['update'], CMD_TYPE_FUNCTION, (
            rent.identifier,
            rent.products,
            rent.value,
            rent.observations,
            rent.value_paid,
            rent.status
        )
        )
Example #12
0
    def insert(self, rent):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Rents']['insert'], CMD_TYPE_FUNCTION, (
            rent.products,
            rent.client,
            rent.functionary,
            rent.value,
            rent.observations,
            rent.value_paid,
        )
        )
Example #13
0
    def update(self, booking):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Bookings']['update'], CMD_TYPE_FUNCTION, (
            booking.identifier,
            booking.products,
            booking.value,
            booking.observations,
            booking.date_time_chosen_remove,
            booking.date_time_removed,
            booking.status
        )
        )
Example #14
0
    def insert(self, booking):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Bookings']['insert'], CMD_TYPE_FUNCTION, (
            booking.products,
            booking.client,
            booking.functionary,
            booking.value,
            booking.observations,
            booking.date_time_chosen_remove,
            booking.date_time_removed,
        )
        )
Example #15
0
    def update(self, cash_desk):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['CashDesks']['update'], CMD_TYPE_FUNCTION, (
            cash_desk.identifier,
            cash_desk.cash_fund,
            cash_desk.expected_value,
            cash_desk.value_in_cash,
            cash_desk.date_time_closed,
            cash_desk.observations,
            cash_desk.status
        )
        )
Example #16
0
    def insert(self, devolution):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Devolutions']['insert'], CMD_TYPE_FUNCTION, (
            devolution.products,
            devolution.client,
            devolution.functionary,
            devolution.value,
            devolution.observations,
            devolution.rent,
            devolution.returned_by
        )
        )
Example #17
0
    def update(self, zip_code):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['ZipCodes']['update'], CMD_TYPE_FUNCTION, (
            zip_code.zip_number,
            zip_code.new_zip_number if 'new_zip_number' in vars(
                zip_code) else zip_code.zip_number,
            zip_code.state,
            zip_code.city,
            zip_code.neighborhood,
            zip_code.street
        )
        )
Example #18
0
    def insert(self, functionary):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Functionaries']['insert'], CMD_TYPE_FUNCTION, (
            functionary.person.name,
            functionary.person.telephone,
            functionary.person.email,
            functionary.person.address,
            functionary.person.photo,
            functionary.person.login,
            functionary.person.password,
            functionary.person.is_authorized,
            functionary.is_root
        )
        )
Example #19
0
    def update(self, dependent):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Dependents']['update'], CMD_TYPE_FUNCTION, (
            dependent.identifier,
            dependent.person.name,
            dependent.person.telephone,
            dependent.person.email,
            dependent.person.address,
            dependent.person.photo,
            dependent.person.login,
            dependent.person.password,
            dependent.person.is_authorized,
            dependent.guarantor,
        )
        )
Example #20
0
    def test_exec_n_query_text(self):
        """<TestPgSqlDal> O insert na tabela de testes deve ocorrer sem erros e não retornar nada se o SGDB estiver alcançável"""

        ret = PgSqlDal.execute_no_query(self.sql['TblTests']['insert'],
                                        CMD_TYPE_TEXT, ('Matheus Saraiva', ),
                                        must_commit=False,
                                        is_test=True)

        self.assertIsNone(ret, 'Houve um retorno')
Example #21
0
    def insert(self, client):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(sql['Clients']['insert'], CMD_TYPE_FUNCTION, (
            client.person.name,
            client.person.telephone,
            client.person.email,
            client.person.address,
            client.person.photo,
            client.person.login,
            client.person.password,
            client.person.is_authorized,
            client.rg,
            client.cpf,
            client.birth,
        )
        )
Example #22
0
    def test_exec_query_func(self):
        """<TestPgSqlDal> A chamada à função "insert_in_tbltests" deve ocorrer sem erros e ter algum retorno se o SGDB estiver alcançável"""

        ret = PgSqlDal.execute_query(self.sql['TblTests']['callFunction'],
                                     CMD_TYPE_FUNCTION, ('Matheus Saraiva', ),
                                     must_commit=False,
                                     is_test=True)

        self.assertIsNotNone(ret, 'Não houve um retorno')
Example #23
0
    def test_exec_n_query_func_n_par(self):
        """<TestPgSqlDal> A chamada à função sem parâmetros "select_in_tbltests" deve ocorrer sem erros e não retornar nada se o SGDB estiver alcançável"""

        ret = PgSqlDal.execute_no_query(
            self.sql['TblTests']['callFunctionWithoutParameters'],
            CMD_TYPE_FUNCTION,
            must_commit=False,
            is_test=True)

        self.assertIsNone(ret, 'Houve um retorno')
Example #24
0
    def test_exec_n_query_text_n_par(self):
        """<TestPgSqlDal> A conslta sem parametros deve ocorrer sem erros e não retornar nada se o SGDB estiver alcançável"""

        ret = PgSqlDal.execute_no_query(
            self.sql['TblTests']['selectWithoutParameter'],
            CMD_TYPE_TEXT,
            must_commit=False,
            is_test=True)

        self.assertIsNone(ret, 'Houve um retorno')
Example #25
0
    def test_exec_query_text_n_par(self):
        """<TestPgSqlDal> A consulta sem parâmetros deve ocorrer sem erros e ter algum retorno"""

        ret = PgSqlDal.execute_query(
            self.sql['TblTests']['selectWithoutParameter'],
            CMD_TYPE_TEXT,
            must_commit=False,
            is_test=True)

        self.assertIsNotNone(ret, 'Não houve um retorno')
Example #26
0
    def insert(self, address):
        """
        Insert a Address object in data base and return the current ID
        """

        sql = inout.get_queries_file()

        return PgSqlDal.execute_query(sql['Address']['insert'], CMD_TYPE_FUNCTION, (
            address.zip_code,
            address.number,
            address.complement
        )
        )
Example #27
0
    def insert(self, dependent):

        sql = inout.get_queries_file()

        return PgSqlDal.execute_query(sql['Dependents']['insert'], CMD_TYPE_FUNCTION, (
            dependent.person.name,
            dependent.person.telephone,
            dependent.person.email,
            dependent.person.address,
            dependent.person.photo,
            dependent.person.login,
            dependent.person.password,
            dependent.person.is_authorized,
            dependent.guarantor,
        )
        )
Example #28
0
    def delete(self, identifier):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(
            sql['Address']['delete'], CMD_TYPE_TEXT, (identifier,))
Example #29
0
    def delete(self, zip_code):

        sql = inout.get_queries_file()

        PgSqlDal.execute_no_query(
            sql['ZipCodes']['delete'], CMD_TYPE_TEXT, (zip_code.zip_number,))