When i reconfigure, list.html, edit_row.html change pattern urls, views, models, etc. I got in situation, that everithing is working, but when i double click on the row it opens prefiled fields, cancel button is working, but when i hit save button in edit_row.html i get error. I tried to find the error but i cannot find it. Can anyone help me with this?
the error:
Request body: b'task_id=3046.002&task_name=Djorjde&creation_date=2023-05-09&realization_date=2023-06-01&status=Ongoing&task_id=&task_name=&creation_date=&realization_date=&status='
Form data: <QueryDict: {'task_id': ['3046.002', ''], 'task_name': ['Djorjde', ''], 'creation_date': ['2023-05-09', ''], 'realization_date': ['2023-06-01', ''], 'status': ['Ongoing', '']}>
Form errors:
- task_id
- task_name
- creation_date
- realization_date
- status
this is from console after i put some debug console logs in views.py
....
def update_instance(self, request, pk, is_urlencode=False):
task = self.get_object(pk)
form_data = QueryDict(request.body) if is_urlencode else request.POST
print("Request body:", request.body)
print("Form data:", form_data)
form = TaskForm(form_data, instance=task)
# print(form_data)
if form.is_valid():
form.save()
if not is_urlencode:
messages.success(request, 'Transaction saved successfully')
return True, 'Transaction saved successfully'
else:
print("Form errors:", form.errors)
if not is_urlencode:
messages.warning(request, 'Error Occurred. Please try again.')
return False, 'Error Occurred. Please try again.'
Everithing else is functioning, like edit button in row of volt in drop down and saving changes etc.
When i reconfigure, list.html, edit_row.html change pattern urls, views, models, etc. I got in situation, that everithing is working, but when i double click on the row it opens prefiled fields, cancel button is working, but when i hit save button in edit_row.html i get error. I tried to find the error but i cannot find it. Can anyone help me with this?
the error:
Request body: b'task_id=3046.002&task_name=Djorjde&creation_date=2023-05-09&realization_date=2023-06-01&status=Ongoing&task_id=&task_name=&creation_date=&realization_date=&status='
Form data: <QueryDict: {'task_id': ['3046.002', ''], 'task_name': ['Djorjde', ''], 'creation_date': ['2023-05-09', ''], 'realization_date': ['2023-06-01', ''], 'status': ['Ongoing', '']}>
Form errors:
This field is required.
this is from console after i put some debug console logs in views.py
....
def update_instance(self, request, pk, is_urlencode=False):
task = self.get_object(pk)
form_data = QueryDict(request.body) if is_urlencode else request.POST
Everithing else is functioning, like edit button in row of volt in drop down and saving changes etc.