``` words = Words.objects.filter( Q(word__icontains=query) | Q(translation__icontains=query) ).order_by(Length('word'), Length('translation')) author_filter = dict(author=None) if words_type == 'own_words': author_filter['author'] = request.user words = words.filter(**author_filter) ```
спасибо
Обсуждают сегодня