예제 #1
0
    def hydrate_to_tile_json(self):
        keys = [
            'event_date_end', 'event_date_start', 'event_id', 'event_slug',
            'event_location', 'event_name', 'event_organizers_text',
            'event_short_description', 'event_thumbnail'
        ]

        return keys_subset(self.hydrate_to_json(), keys)
예제 #2
0
    def hydrate_to_tile_json(self):
        keys = [
            'group_date_modified', 'group_id', 'group_name', 'group_location',
            'group_country', 'group_state', 'group_city',
            'group_short_description', 'group_project_count',
            'group_issue_areas', 'group_thumbnail'
        ]

        return keys_subset(self.hydrate_to_json(), keys)
예제 #3
0
    def hydrate_to_tile_json(self):
        keys = [
            'project_id', 'project_name', 'project_creator',
            'project_description', 'project_url', 'project_location',
            'project_country', 'project_state', 'project_city',
            'project_issue_area', 'project_stage', 'project_positions',
            'project_date_modified', 'project_thumbnail'
        ]

        return keys_subset(self.hydrate_to_json(), keys)
예제 #4
0
    def hydrate_to_tile_json(self):
        keys = [
            'project_id', 'project_name', 'project_creator', 'project_url',
            'project_location', 'project_country', 'project_state',
            'project_city', 'project_issue_area', 'project_stage',
            'project_positions', 'project_date_modified', 'project_thumbnail',
            'project_description'
        ]
        json_base = self.hydrate_to_json()
        json_result = keys_subset(json_base, keys)
        project_short_description = json_base['project_short_description']
        if len(project_short_description) > 0:
            json_result['project_description'] = project_short_description

        return json_result
예제 #5
0
 def test_keys_subset(self):
     dict_a = {'a': 1, 'b': 2, 'c': 3}
     self.assertEqual({'a': 1, 'c': 3}, keys_subset(dict_a, ['a', 'c']))