def getBlitemFromRequest(key, value, labels): slug = key[3:] typex = key[:2] blitem = {} blitem['t'] = typex blitem['s'] = slug if BControl.isMultitext(typex): value = BControl.autoP(value) elif BControl.isMp3(typex): song = Song() song.load(value) value = song.dumpSong() elif BControl.isImage(typex): value = ObjectId(value) blitem['v'] = value blitem['l'] = labels.get(slug) return blitem
def test_isImage(self): print 'Image: ' + str(BControl.IMAGE) + ' -' + BControl.getType(BControl.IMAGE) + ' - ' + str(BControl.isImage('15'))