1. Your code is obviously not standardized. There is a dotted line at the end. You don’t break the line and continue writing. This is very unpythonic;
> 其他人看这样的代码,瞟一眼就不会想继续看的
2. I have used pycharm for so long, and I have never encountered it automatically wrapping lines unless it is automatically formatted; 3. Please be familiar with using Ctrl+Alt+F to format code;
Like the following line of code, if there is no line break, then when someone uses vim to read the code, they have to scroll a few screens to finish reading this line?
objects_data = Task \
.objects.filter(state=0)\
.filter(asset__in=assets)\
.filter(Q(name__icontains=q) |
Q(user__username__icontains=q) |
Q(app_version__name__icontains=q) |
Q(asset__hostname__icontains=q)).all() \
if q is not None else \
Task.objects.filter(state=0).filter(asset__in=assets).all()
1. Your code is obviously not standardized. There is a dotted line at the end. You don’t break the line and continue writing. This is very unpythonic;
2. I have used pycharm for so long, and I have never encountered it automatically wrapping lines unless it is automatically formatted;
3. Please be familiar with using Ctrl+Alt+F to format code;
Like the following line of code, if there is no line break, then when someone uses vim to read the code, they have to scroll a few screens to finish reading this line?