Skip to content

Tag: sqlite

Sort a QuerySet by ManyToManyField in Django

I have a model like this: I want to get all Objects of my_model sorted by the number of objects in the foo field. In this Question A friendly Guy from russia says, that you should use django-annontation. I tried the following: and it works fine. Is there any reason I should go the longer way with annotations?…

no such table: wagtailcore_site

I’m hosting two websites on ubuntu server and both having postgresql, the first one is working prefect but the second give me this error no such table: wagtailcore_site Request Method: GET Django Version: 2.2.10 Exception Type: OperationalError Exception Value: no such table: wagtailcore_site Exception …

Comparing multiple tables in Sqlite 3 using python

I am quite new to SQLITE3 as well as python. I a complete beginner in SQLite. I don’t understand much. I am right now learning as a go for my project.I am working on a project where I have one database with about 20 tables inside of it. One table is for user input and the other tables are pre-loaded

sqlite cursor fetchone() returns ‘NoneType’?

I want to build a function that returns the lowest row count from all tables if the two scores scor1 and scor2 are not both 0 : This is the result of the print statement: and this is the error: Answer After executing a query with execute, the query results will be available in a query result set, which you

sqlite3.OperationalError python

so what i’am basically trying to do is getting data from a from developed with pyqt and insert it into a database, the problem is with my ID column,this is the code i’am using to insert the data to the database : i always get this error : when i enter a query to insert into the table directly from