[Fixed]-Filling model fields using both data from form and other sources

1👍

if form.is_valid():
    account = form.save(commit=False)
    account.user = request.user
    account.current_balance = form.cleaned_data.get('initial_balance')
    account.save()
    return redirect('index')
👤nik_m

Leave a comment