Skip to content

Add request: Request argument to column formatter function #1015

@ycuk

Description

@ycuk

Checklist

  • There are no similar issues or pull requests for this yet.

Is your feature related to a problem? Please describe.

Cant get request.url_for() to make link to another table

Describe the solution you would like.

from starlette.requests import Request

def formatter(
    model,
    attribute,
    request: Request, # this is new argument
):
    # `model` is model instance
    # `attribute` is a Union[ColumnProperty, RelationshipProperty]
    request.url_for('admin:details', identity='sometable', pk=some_id)

Describe alternatives you considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting-for-feedbackWaiting feedback/answer/updates from contributor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions