예제 #1
0
 def _populateChannels(self, channels):
     l = []
     for channel in channels:
         dict = {'label' : channel}
         obj = Channel()
         obj.populate(dict)
         l.append(obj)
     self['channels'] = l
예제 #2
0
 def _populateChannels(self, channels):
     l = []
     for channel in channels:
         dict = {"label": channel}
         obj = Channel()
         obj.populate(dict)
         l.append(obj)
     self["channels"] = l
예제 #3
0
 def preprocess(self):
     for content_source in self.batch:
         # Link back content sources to channel objects to subscribe them to existing channels right after import
         if 'channels' in content_source and content_source['channels'] is not None:
             for channel_label in content_source['channels']:
                 if channel_label not in self.channels_to_link:
                     db_channel = channel_info(channel_label)
                     channel_obj = Channel()
                     channel_obj.id = db_channel['id']
                     channel_obj['content-sources'] = []
                     self.channels_to_link[channel_label] = channel_obj
                 self.channels_to_link[channel_label]['content-sources'].append(content_source)
예제 #4
0
 def preprocess(self):
     for content_source in self.batch:
         # Link back content sources to channel objects to subscribe them to existing channels right after import
         if 'channels' in content_source and content_source['channels'] is not None:
             for channel_label in content_source['channels']:
                 if channel_label not in self.channels_to_link:
                     db_channel = channel_info(channel_label)
                     channel_obj = Channel()
                     channel_obj.id = db_channel['id']
                     channel_obj['content-sources'] = []
                     self.channels_to_link[channel_label] = channel_obj
                 self.channels_to_link[channel_label]['content-sources'].append(content_source)