12345678910111213141516171819202122232425262728293031323334353637 |
- from __future__ import division
- from django.db import transaction
- from django_logit import logit
- from django_response import response
- from paginator import pagination
- from logs.models import ComplementCodeLogInfo
- @logit(res=True)
- def complement_code(request):
- user_id = request.POST.get('user_id', '')
- log_id = request.POST.get('log_id', '')
- name = request.POST.get('name', '')
- phone = request.POST.get('phone', '')
- model_id = request.POST.get('model_id', '')
- model_name = request.POST.get('model_name', '')
- sn = request.POST.get('sn', '')
- shot_path = request.POST.get('shot_path', '')
- invoice_path = request.POST.get('invoice_path', '')
- log, _ = ComplementCodeLogInfo.objects.update_or_create(user_id=user_id, log_id=log_id, defaults={
- 'name': name,
- 'phone': phone,
- 'model_id': model_id,
- 'model_name': model_name,
- 'sn': sn,
- 'shot_image': shot_path,
- 'invoice_image': invoice_path,
- })
- return response(data={
- 'log_id': log.log_id,
- })
|