forked from the-blue-alliance/the-blue-alliance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bulkloader.yaml
146 lines (113 loc) · 4.08 KB
/
bulkloader.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Autogenerated bulkloader.yaml file.
# At a minimum address the items marked with TODO:
# * Fill in connector and connector_options
# * Review the property_map.
# - Ensure the 'external_name' matches the name of your CSV column,
# XML tag, etc.
# - Check that __key__ property is what you want. Its value will become
# the key name on import, and on export the value will be the Key
# object. If you would like automatic key generation on import and
# omitting the key on export, you can remove the entire __key__
# property from the property map.
# If you have module(s) with your model classes, add them here. Also
# change the kind properties to model_class.
python_preamble:
- import: base64
- import: re
- import: google.appengine.ext.bulkload.transform
- import: google.appengine.ext.bulkload.bulkloader_wizard
- import: google.appengine.ext.db
- import: google.appengine.api.datastore
- import: google.appengine.api.users
- import: helpers.bulkloader_helper
transformers:
- kind: Event
connector: csv
property_map:
- property: __key__
external_name: key
export_transform: transform.key_id_or_name_as_string
- property: end_date
external_name: end_date
import_transform: transform.import_date_time('%Y-%m-%dT%H:%M:%S')
export_transform: transform.export_date_time('%Y-%m-%dT%H:%M:%S')
- property: event_short
external_name: event_short
- property: event_type
external_name: event_type
- property: first_eid
external_name: first_eid
- property: location
external_name: location
- property: name
external_name: name
- property: short_name
external_name: short_name
- property: official
external_name: official
import_transform: transform.regexp_bool('true', re.IGNORECASE)
- property: start_date
external_name: start_date
import_transform: transform.import_date_time('%Y-%m-%dT%H:%M:%S')
export_transform: transform.export_date_time('%Y-%m-%dT%H:%M:%S')
- property: venue
external_name: venue
- property: website
external_name: website
- property: year
external_name: year
import_transform: transform.none_if_empty(int)
- kind: Match
connector: csv
property_map:
- property: __key__
external_name: key
export_transform: transform.key_id_or_name_as_string
- property: alliances_json
external_name: alliances_json
import_transform: bulkloader_helper.fix_json
#TODO: Make this work
# JSON gets enclosed by ", but only " is allowed in JSON. -gregmarra 26 Sept 2010.
- property: comp_level
external_name: comp_level
- property: event
external_name: event
import_transform: transform.create_foreign_key('Event')
export_transform: transform.key_id_or_name_as_string
- property: game
external_name: game
- property: match_number
external_name: match_number
import_transform: transform.none_if_empty(int)
- property: set_number
external_name: set_number
import_transform: transform.none_if_empty(int)
- property: team_key_names
external_name: team_key_names
import_transform: bulkloader_helper.fix_list
#This is such a dirty hack. It should be replaced with a better function. -gregmarra 26 Sept 2010.
- property: no_auto_update
external_name: no_auto_update
import_transform: transform.regexp_bool('true', re.IGNORECASE)
- kind: Team
connector: csv
property_map:
- property: __key__
external_name: key
export_transform: transform.key_id_or_name_as_string
- property: address
external_name: address
import_transform: db.PostalAddress
- property: first_tpid
external_name: first_tpid
import_transform: transform.none_if_empty(int)
- property: name
external_name: name
- property: nickname
external_name: nickname
- property: team_number
external_name: team_number
import_transform: transform.none_if_empty(int)
- property: website
external_name: website
import_transform: db.Link