콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
4466 화면

Hi I'm trying to import lines from a CSV, but I can't handle type errors.
For example, if you insert a line in a datetime field, I get this error in the create:

psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block

Despite handling errors with

try:
  my_module.create ()
exception Except:
  pass

  How can I check the values before I get to create or at least handle the error and take other actions. For the moment if I insert a field that is not present on a selection, I manage with try catch but I can't for data types

아바타
취소

override create method and check the field

작성자

@Sehrish And? This is the question. How do I check the type of field where I am going to write the value?

관련 게시물 답글 화면 활동
1
2월 24
1514
0
2월 23
1883
2
12월 23
14790
0
10월 23
33
3
10월 23
788