Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
WIP(managers): Add docstrings #57
Browse files Browse the repository at this point in the history
  • Loading branch information
imAsparky committed May 5, 2023
1 parent 222f1b6 commit 51416c9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tag_fields/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ def __init__(self, alias, col, content_types):
self.content_types = content_types

def as_sql(self, compiler, connection):
"""Returns content_types and a string.
PARAMETERS
==========
:param: compiler
Returned string is in the format `'alias.col = %s'` for one
content_type or 'alias.col IN (%s%s%s)' for multiple content types.
"""
qn = compiler.quote_name_unless_alias
if len(self.content_types) == 1:
extra_where = f"{qn(self.alias)}.{qn(self.col)} = %s"
Expand Down

0 comments on commit 51416c9

Please sign in to comment.