Closed dco5 closed 7 years ago
Hello, The "id" column should be handled automatically by Django - Photologue does not modify this. Which table is causing the error message?
This is the only SQL I could find in the Traceback u'INSERT INTO "photologue_photo_sites" ("photo_id", "site_id") VALUES (%s, %s)' u'INSERT INTO "photologue_photo_sites" ("photo_id", "site_id") VALUES (181, 1)'
I maybe it has something to do with photologue_photo_sites table?
Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
Exception Type: IntegrityError at /admin/photologue/photo/add/ Exception Value: null value in column "id" violates not-null constraint DETAIL: Failing row contains (null, 182, 1).
Thank you for the extra information - it's very strange. There's on insert into table photologue_photo_sites; the id column value is not specified. On my system that does not matter: I am using a PostgreSQL database, and the ID column is defined to auto-insert a sequence number. Are you using MySQL? I am not familiar with that database - can you check if for table 'photologue_photo_sites' the ID column is automatically populated?
I am using Postgresql, so that is very weird then. I will check the table definition and see what it says.
Hi @dco5 - did you manage to resolve this bug?
Hello, I am getting: null value in column "id" violates not-null constraint DETAIL: Failing row contains (null, 182, 1).
I have not been able to figure out why this happening? Django is suppose to take care of the ID, so I dunno why it would be NULL, does photologue changes how ID is generated?
I am using cairocffi==0.7.2 CairoSVG==1.0.22 cffi==1.7.0 chardet==2.3.0 cssselect==0.9.2 Cython==0.24.1 Django==1.8.13 django-braces==1.9.0 django-contrib-comments==1.7.1 django-debug-toolbar==1.4 django-filebrowser-no-grappelli==3.6.2 django-photologue==3.5.1 django-recaptcha2==1.0.0 django-sortedm2m==1.3.2 django-widget-tweaks==1.4.1 ExifRead==2.1.2 gunicorn==19.6.0 html5lib==0.999999999 lxml==3.6.1 MySQL-python==1.2.5 Pillow==3.2.0 psycopg2==2.6.1 pycparser==2.14 Pyphen==0.9.4 requests==2.10.0 six==1.10.0 sorl-thumbnail==12.3 sqlparse==0.1.19 ssh-import-id==5.5 tinycss==0.3 unicodecsv==0.14.1 Unipath==1.1 urllib3==1.16 WeasyPrint==0.30 webencodings==0.5