Projekt

Obecné

Profil

Stáhnout (659 Bajtů) Statistiky
| Větev: | Revize:
1 af7609b5 Tomáš Ballák
from typing import Dict
2
3
4 527abccd petrh
class DatabaseDataLine:
5 04a2b5a4 petrh
    """
6
    Class that specifies the look of data line in database
7
    """
8 af7609b5 Tomáš Ballák
    def __init__(self, name: str, longitude: float, latitude: float, date: str,
9
                 occurrence: int):
10 527abccd petrh
        self.name = name
11
        self.latitude = latitude
12
        self.longitude = longitude
13
        self.date = date
14 04a2b5a4 petrh
        self.occurrence = occurrence
15 527abccd petrh
16 af7609b5 Tomáš Ballák
    def to_dictionary(self) -> Dict[str, any]:
17
        return {
18
            "place": self.name,
19
            "x": self.longitude,
20
            "y": self.latitude,
21
            "number": self.occurrence,
22
            "date": self.date
23
        }