これは私の見解であり、フォームで呼び出します。フォームを送信すると、「'tuple' object has no attribute 'id'」というメッセージが表示されます
@login_required
def _login_save(request, form):
if request.method == 'POST':
form = LoginSaveForm(request.POST)
if form.is_valid():
# Create or get login.
login1 = login.objects.get_or_create(
id=1 #this is for testing reasons to get a specific record
)
login1.name=form.cleaned_data['name']
login1.loginUrl = form.cleaned_data['url']
login1.password = form.cleaned_data['password']
login1.login_username = form.cleaned_data['Login_username']
login1.notes = form.cleaned_data['notes']
login1.save()
return login1