-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodels.py
More file actions
48 lines (34 loc) · 798 Bytes
/
models.py
File metadata and controls
48 lines (34 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from mobync import OperationType
from dataclasses import dataclass
from .model import Model
@dataclass
class Task(Model):
id: str
name: str
created_time: str
done: bool
def __init__(self, **kwargs):
Model.__init__(self, **kwargs)
def __str__(self):
return self.to_json()
@dataclass
class Model1(Model):
id: str
field1: str
def __init__(self, **kwargs):
Model.__init__(self, **kwargs)
def __str__(self):
return self.to_json()
@dataclass
class Diff(Model):
id: str
owner: str
logical_clock: int
utc_timestamp: int
type: OperationType
model: str
json_data: str
def __init__(self, **kwargs):
Model.__init__(self, **kwargs)
def __str__(self):
return self.to_json()