forked from openstate/open-raadsinformatie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorganisations.py
92 lines (66 loc) · 2.67 KB
/
organisations.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
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
from datetime import datetime
from ocd_backend.items.popolo import OrganisationItem
from ocd_backend.utils.misc import slugify
class MunicipalityOrganisationItem(OrganisationItem):
def get_original_object_id(self):
return unicode(self.original_item['Key']).strip()
def get_original_object_urls(self):
return {"html": self.source_definition['file_url']}
def get_rights(self):
return u'undefined'
def get_collection(self):
return unicode(self.source_definition['index_name'])
def get_combined_index_data(self):
combined_index_data = {}
combined_index_data['id'] = unicode(self.get_object_id())
combined_index_data['hidden'] = self.source_definition['hidden']
combined_index_data['name'] = unicode(self.original_item['Title'])
combined_index_data['identifiers'] = [
{
'identifier': self.original_item['Key'].strip(),
'scheme': u'CBS'
},
{
'identifier': self.get_object_id(),
'scheme': u'ORI'
}
]
combined_index_data['classification'] = u'Municipality'
combined_index_data['description'] = self.original_item['Description']
return combined_index_data
def get_index_data(self):
return {}
def get_all_text(self):
text_items = []
return u' '.join(text_items)
class AlmanakOrganisationItem(OrganisationItem):
def get_object_id(self):
return slugify(unicode(self.original_item['name']).strip())
def get_original_object_id(self):
return unicode(self.original_item['name']).strip()
def get_original_object_urls(self):
return {"html": self.source_definition['file_url']}
def get_rights(self):
return u'undefined'
def get_collection(self):
return unicode(self.source_definition['index_name'])
def get_combined_index_data(self):
combined_index_data = {}
combined_index_data['id'] = unicode(self.get_object_id())
combined_index_data['hidden'] = self.source_definition['hidden']
combined_index_data['name'] = unicode(self.original_item['name'])
combined_index_data['identifiers'] = [
{
'identifier': self.get_object_id(),
'scheme': u'ORI'
}
]
combined_index_data['classification'] = self.original_item[
'classification']
combined_index_data['description'] = self.original_item['name']
return combined_index_data
def get_index_data(self):
return {}
def get_all_text(self):
text_items = []
return u' '.join(text_items)