Skip to content

How to order comment list by num of likedit #349

@tian-yan

Description

@tian-yan

I want to order comment list of an article by num of likedit in descending manner.
I tried Query Expression,

in settings.py
COMMENTS_XTD_LIST_ORDER = (Length('likedit_users'), '-submit_date')

but failed with error Exception Value: | Cannot resolve keyword 'likedit_users' into field.
It seems that the only way out is adding an extra field (num_of_likes for example) to the Comment model.

Before I customize the django-comments-xtd package by modifying the source code locally, I want to double confirm if there is any other easy ways to achieve the requirement without source code modifying?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions