Projekt

Obecné

Profil

Stáhnout (659 Bajtů) Statistiky
| Větev: | Revize:
1
from typing import Dict
2

    
3

    
4
class DatabaseDataLine:
5
    """
6
    Class that specifies the look of data line in database
7
    """
8
    def __init__(self, name: str, longitude: float, latitude: float, date: str,
9
                 occurrence: int):
10
        self.name = name
11
        self.latitude = latitude
12
        self.longitude = longitude
13
        self.date = date
14
        self.occurrence = occurrence
15

    
16
    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
        }
(1-1/3)