How to access the object user and its attributes after a join ?
This is my query
Idea.objects.select_related("user").values("author_id").annotate(
qtd=Count('author_id'))
Example of a result:
<QuerySet [{'author...
I've seen cases where the developer does the import of a module within a function, some cases mainly in the documentation of Django, why it was not very clear to me, if anyone can help me thank you.
I have an input file in txt with data type the following:
7 6 8
4 8 5
0 1 2
1 0 3
2 3 0
This file is about 3 students from a school. The first line is the age of these 3 students (the first column could be student1, the second...
I made this little program to try to simulate the methods 'split' and 'rsplit' of Python , but when I run it it does not print the last sentence of the string. For example, if in the string I type 'pao ou açucar ou café'...
I'm trying to remove empty rows from a csv document:
Document:
sentence, lingua
., pt
., in
., in
., it
., en
., pt
., pt
., en
., pt
., pt
"it's not expensive", in
...
I'm having the following problem, I have a class letter and I use the magic methods eq , ne , le , lt , gt to be able to compare the value of two cards and also to be able to use the sort function, and this works the way I expected but whe...
I need to enter into a folder called / users , where inside it to several folder and copy the name of all folders, follow the example.
I wanted to be able to get the name of these folders and save them to a list in python.
Good morning, friends. I'm having trouble removing a child. I wrote a code to collect all the prices of the products of a website (it is a list of products, not a page for each one). On this with no problems, the code works well. It turns out th...
This is my first code that does not involve my course classes. My goal is to put together a code that asks that any chemical symbol be inserted and this will tell your group. Very simple concept, but I'm having difficulties in it.
elemento = s...