Ejemplo n.º 1
0
    def append(self, obj):
        json = super(AudioPickerBase, self).append(obj)
        instance = getattr(obj, self.field)

        audio_formatted = [render_upload(obj),]
        json['link_content'] = ['Click to insert'];
        json['poster'] = obj.poster.file.url
        json['insert'] = audio_formatted

        return json
Ejemplo n.º 2
0
    def append(self, obj):
        json = super(VideoPickerBase, self).append(obj)
        instance = getattr(obj, self.field)

        if obj.embed_object:
            # try to grab and decode the embed object
            video_formatted = [obj.embed_object]
        elif obj.file:
            video_formatted = [render_upload(obj)]
        else:
            video_formatted = ['unknown']

        json['link_content'] = ['Click to insert'];
        json['insert'] = video_formatted
        json['poster'] = poster = obj.poster.file.url

        return json