-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor views to use new get_filtered_tags()
- Loading branch information
1 parent
3eafff7
commit 237c83d
Showing
12 changed files
with
372 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
Utilities for tagging and taxonomy models | ||
""" | ||
|
||
from django.db.models.expressions import Func | ||
|
||
|
||
class ConcatNull(Func): # pylint: disable=abstract-method | ||
""" | ||
Concatenate two arguments together. Like normal SQL but unlike Django's | ||
"Concat", if either argument is NULL, the result will be NULL. | ||
""" | ||
|
||
function = "CONCAT" | ||
|
||
def as_sqlite(self, compiler, connection, **extra_context): | ||
""" SQLite doesn't have CONCAT() but has a concatenation operator """ | ||
return super().as_sql( | ||
compiler, | ||
connection, | ||
template="%(expressions)s", | ||
arg_joiner=" || ", | ||
**extra_context, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.