Skip to content
Snippets Groups Projects
Commit 2989de41 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[common][utils] annotate_full_name on query rather than starting on class

This will allow the use of model managers.
parent 2a28ae0f
No related branches found
No related tags found
1 merge request!327Refactor update creation api
......@@ -149,13 +149,13 @@ def py3_cmp(a, b):
return (a > b) - (a < b)
def annotate_full_name(db_class):
def annotate_full_name(query):
"""
Annotate a query with the asset full name so that it can be more easily
filtered.
"""
return db_class.objects.annotate(
return query.annotate(
full_name=Concat(
"author__username",
V("/"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment