Exemplo n.º 1
0
def create_new_mp(mp):
    _mp = MP()
    _mp.id = create_uniq_id(mp)
    _mp.picture = _mp.id + ".jpg"
    _mp.an_id=mp["url_an"].split("/")[-1].split(".")[0]
    if mp["place_en_hemicycle"] :
        _mp.hemicycle_sit = mp["place_en_hemicycle"]
        _mp.active = True
    else:
        _mp.hemicycle_sit = 0
        _mp.active = False
    update_personal_informations(_mp, mp)
    update_group_info(_mp, mp)
    get_department_and_circo(mp, _mp)
    _mp.save()
    #get_new_emails(mp, _mp)

    #_mp.save()
    print "MP created !"
    return _mp
Exemplo n.º 2
0
def index(request):
    mps = MP.view('mps/all')
    context = {
        'mps': mps,
    }
    return direct_to_template(request, 'mps/index.html', context)
Exemplo n.º 3
0
def detail(request, mp_id):
    mps = MP.view('mps/by_id', key=mp_id)
    context = {
        'mp': mps.first(),
    }
    return direct_to_template(request, 'mps/detail.html', context)