ponder-lab / Imperative-DL-Study-Web-App

0 stars 0 forks source link

Categorizations form not inserting #21

Closed tatianacv closed 3 years ago

tatianacv commented 3 years ago

Getting a SQL error for inserting the form

khatchad commented 3 years ago

Please add the erroneous SQL statement and the error message.

tatianacv commented 3 years ago

'Cannot add or update a child row: a foreign key constraint fails (heroku_4ac11fb2946b4e7.categorizations, CONSTRAINT categorizations_ibfk_7 FOREIGN KEY (sha) REFERENCES commits (sha))')

khatchad commented 3 years ago

@tatianacv please capture the SQL statement that is causing this error. Django has an ORM that translates OO code into SQL. It should have a debug option to output any generated SQL statements.

khatchad commented 3 years ago

https://stackoverflow.com/questions/1074212/how-can-i-see-the-raw-sql-queries-django-is-running

khatchad commented 3 years ago

Per our recent discussion, the route for this form would be as follows:

http://app/categorizations/add?commit=5

Add a categorization for commit with ID 5

khatchad commented 3 years ago

Per recent discussion, remove the commit entry form element from this form because it will be (instead) a query parameter as above.

khatchad commented 3 years ago
tatianacv commented 3 years ago

Fixed insertion to form in commit e75faa16f891dd6d0280d1ba7b1a9a126a841a5a

tatianacv commented 3 years ago

Remove the sha from the categorizations form in commit 1f9e246c5f481574b3fd20ac9bca24dd64bf86e3