def get_prerequisite_from_td(td, lang):
    try:
        tr_rec = TutorialResource.objects.get(Q(status = 1) | Q(status = 2), tutorial_detail = td, language_id = lang.id)
        return tr_rec.id
    except:
        if lang.name != 'English':
            try:
                tr_rec = TutorialResource.objects.get(Q(status = 1) | Q(status = 2), tutorial_detail = td, language__name = 'English')
                return tr_rec.id
            except:
                pass
    return None