def get_url(self, action='detail'):
    kwargs = {}
    if (action != 'list'):
        kwargs = self.get_identifying_fields()
        described_object = self.get_described_object()
        for (field, value) in described_object.get_identifying_fields().items():
            kwargs[f'{self.described_object_field.name}__{field}'] = value
    try:
        return reverse(f'{self.get_url_pattern_name_prefix()}-ui-{action}', kwargs=kwargs)
    except NoReverseMatch:
        return
def get_url(self, action='detail'):
    kwargs = {}
    if (action != 'list'):
        kwargs = self.get_identifying_fields()
        described_object = self.get_described_object()
        for (field, value) in described_object.get_identifying_fields().items():
            kwargs[f'{self.described_object_field.name}__{field}'] = value
    try:
        return reverse(f'{self.get_url_pattern_name_prefix()}-ui-{action}', kwargs=kwargs)
    except NoReverseMatch:
        return