Developing Django apps using an IDE called Pycharm (jetbrains).
You will be warned about the error
Duplicated code fragment (5 lines long)
The corresponding code is as follows.
for question in questions: question.votes = 0 question.answer_counts = Answer.objects.filter (question = question) .count () question.access_counts = QuestionAccess.objects.filter (question = question) .count () question.title = translate (question.title, lang) question.content = translate (question.content, lang) question.access_counts = QuestionAccess.objects.filter (question = question) .count ()
It seems that the code is duplicated, but I don't know how to fix it.
Can you tell me if you understand?
Answer # 1
question.access_counts = QuestionAccess.objects.filter (question = question) .count ()
I think that the error will disappear if one of them is deleted.
- python - shuffle a few lines of pandas for weekdays and holidays
- python - i want to extract lines containing a specific string with pandas
- read a python text file and get n lines from the line starting with the specified string
- python - i want to delete all lines that contain a pandas string
- python - when combining different lines for each mode, switching the mode will change the whole
- python - draw a specified number of straight lines at equal intervals
- python 3x - i want to add the contents like "a": -> "a": [1,3] of the duplicated key in python3 as fol
- python - i want to extract only the matching lines in two csv and output a new csv
- about auxiliary lines and axis scales of python heatmap
- i want to read excel data with python and output duplicate lines as csv or excel data
- i want to output multiple lines of html code using python
- python - how can i place the grid lines of a bar chart behind the bars in matplotlib?
- how to erase ruled lines in excel file using python
- python - shuffle a few lines of dataframes together using pandas
- python - how to break every 5 lines in the list
- python - avoid processing when duplicated
- python - i want to find the intersection of the lines of the least squares method when the button is pressed
- exclude even and odd lines in python csv
- python - unable to import packages installed in virtual environment with anaconda
- python - can't get json from url
- python - i want to remodel line is there a line version of the google extension?
- python - about vscode formatter settings (django)
- python - conditional statement when dictionary type data is not passed in django
- python - problem that css is not loaded in html and cannot be displayed during web application creation
- python - [ajax] i want to get and send the value of the button element in the form
- python - exception value erorr catch location
- python - i don't know what's wrong with an error in serialize on the django rest framework
- python - django form i want to write a little smarter