-
Notifications
You must be signed in to change notification settings - Fork 0
/
datatype.py
60 lines (45 loc) · 1.26 KB
/
datatype.py
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
49
50
51
52
53
54
55
56
57
58
59
60
# -*- coding: utf-8 -*-
from transform import Transform
"""
This class represents one Collection in the data source MongoDB.
For evey collection:
source: Mongo collection name
destination: Elasticsearch document type
"""
class Collection(object):
class Review(object):
source = "review"
destination = "review"
@staticmethod
def apply_transform():
return Transform.review
class Business(object):
source = "business"
destination = "business"
@staticmethod
def apply_transform():
return Transform.business
class User(object):
source = "users"
destination = "user"
@staticmethod
def apply_transform():
return Transform.user
class Tip(object):
source = "tip"
destination = "tip"
@staticmethod
def apply_transform():
return Transform.tip
class CheckIn(object):
source = "checkin"
destination = "checkin"
@staticmethod
def apply_transform():
return Transform.checkin
class Photo(object):
source = "photo_business"
destination = "photo"
@staticmethod
def apply_transform():
return Transform.photo