Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1d2add74

Přidáno uživatelem Jan Pašek před asi 4 roky(ů)

Re #8569 Removed cursor from repository constructors

Zobrazit rozdíly:

src/dao/certificate_repository.py
1
from sqlite3 import Connection, Error
1 2
from typing import Dict, List
2
from sqlite3 import Connection, Cursor, Error
3 3

  
4
from src.model.certificate import Certificate
4
from injector import inject
5

  
5 6
from src.constants import *
7
from src.model.certificate import Certificate
6 8

  
7 9

  
8 10
class CertificateRepository:
9 11

  
10
    def __init__(self, connection: Connection, cursor: Cursor):
12
    @inject
13
    def __init__(self, connection: Connection):
11 14
        """
12 15
        Constructor of the CertificateRepository object
13 16

  
14 17
        :param connection: Instance of the Connection object
15
        :param cursor: Instance of the Cursor object
16 18
        """
17

  
18 19
        self.connection = connection
19
        self.cursor = cursor
20
        self.cursor = connection.cursor()
20 21

  
21 22
    def create(self, certificate: Certificate):
22 23
        """

Také k dispozici: Unified diff