Пример #1
0
def registrar_add(request):
    baseform = BaseForm(request.POST)
    if baseform.is_valid():
        baseform.save()
    return render(request,
        'base/base-to-compatriota.html',
        {'base' : baseform.instance,})
Пример #2
0
def registrar(request):
    baseform = BaseForm()
    if request.method == 'POST':
        baseform = BaseForm(request.POST)
        if baseform.is_valid():
            baseform.save()
            return redirect('/base/registrar/')
    return render(request,
        'base/base.html',
        {'baseform' : baseform,'auth':request.user,})