Exemplo n.º 1
0
def process_fields(form, meta):
    for key in editableKeys:
        value = form.getfirst(key, '')
        if value != '':
            meta[key] = value
        elif key == 'title':
            meta[key] = ' '

    if meta.has_key('uploaded_by_site') and meta['uploaded_by_site'] != '':
        meta['creator'] = meta['uploaded_by_site']

    for key in editableKeys:
        formStr = 'hindi_' + key
        value = form.getfirst(formStr, '')
        if value == '':
            continue
        if meta.has_key('hindi'):
            hindi = meta['hindi']
        else:
            hindi = {}
            meta['hindi'] = hindi
        hindi[key] = value

    process_checkboxes(form, meta, 'subjects', 'subject')
    process_dropdown(form, meta, 'content_type')
    process_checkboxes(form, meta, 'languages', 'language')
    process_checkboxes(form, meta, 'show', 'show')
    process_checkboxes(form, meta, 'cache', 'cache')
    process_dropdown(form, meta, 'class')
    process_bracket(form, meta, 'age', 'age_from', 'age_to',
                    'hindi_age_from', 'hindi_age_to')
    process_checkboxes(form, meta, 'media', 'media')
    ryw_upload.process_English_dropdown('video_resolution', form, meta)
    ryw_upload.process_bracket(form, 
                               'time_length_hours', 'time_length_minutes',
                               'time_length', meta)
    ryw_upload.process_English_dropdown('time_length_seconds', form, meta)
    resize_thumbnails(meta)
Exemplo n.º 2
0
def process_bracket(form, meta, categoryName, key1, key2,
                    hindiKey1, hindiKey2):
    oPair = ryw_upload.process_bracket(form, key1, key2, categoryName, meta)
    ryw_upload.process_hindi_bracket(form, hindiKey1, hindiKey2,
                                     categoryName, meta, oldPair = oPair)