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/private_key_repository.py
1 1
from sqlite3 import Connection, Cursor, Error
2 2
from typing import List
3 3

  
4
from injector import inject
5

  
4 6
from src.model.private_key import PrivateKey
5 7
from src.constants import *
6 8

  
7 9

  
8 10
class PrivateKeyRepository:
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 PrivateKeyRepository object
13 16

  
......
16 19
        """
17 20

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

  
21 24
    def create(self, private_key: PrivateKey):
22 25
        """

Také k dispozici: Unified diff