Skip to content

formatter

Module contains functionality for formatting PQL objects as PQL string.

PQLColumnFormatter

Class to format PQLColumn as string.

format

format(column)

Formats given PQLColumn.

Parameters:

Returns:

  • str

    String containing formatted column.

OrderByColumnFormatter

Class to format OrderByColumn as string.

format

format(column)

Formats given OrderByColumn.

Parameters:

Returns:

  • str

    String containing formatted column.

PQLFormatter

PQLFormatter(
    pql_column_formatter=None,
    order_by_column_formatter=None,
)

Class to format PQL query as string.

Parameters:

  • pql_column_formatter (Optional[PQLColumnFormatter], default: None ) –

    Formatter to use for PQLColumn.

  • order_by_column_formatter (Optional[OrderByColumnFormatter], default: None ) –

    Formatter to use for OrderByColumn.

pql_column_formatter instance-attribute

pql_column_formatter = (
    pql_column_formatter or PQLColumnFormatter()
)

order_by_column_formatter instance-attribute

order_by_column_formatter = (
    order_by_column_formatter or OrderByColumnFormatter()
)

format

format(query)

Formats PQL query.

Parameters:

  • query (PQL) –

    Query to format.

Returns:

  • List[str]

    Formatted PQL query as list of strings.