Skip to content

Instantly share code, notes, and snippets.

@Rojuvaxan
Created December 10, 2020 11:30
Show Gist options
  • Save Rojuvaxan/901ef266a114081ed5f38349daa5a0cf to your computer and use it in GitHub Desktop.
Save Rojuvaxan/901ef266a114081ed5f38349daa5a0cf to your computer and use it in GitHub Desktop.
def verificar_emprestimo(request):
# Recebo o numero do equipamento, verifica se esta emprestado ou nao
numero_equipamento = request.POST.get('numero_equipamento')
query = EquipamentosEmprestados.objects.get(numero_equipamento=numero_equipamento, motivo_baixa='')
try:
if query:
status = serializers.serialize("json", [query])
return HttpResponse(status)
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment