Skip to content

Commit

Permalink
App Datenmanagement: Verbesserung der Darstellung von Links auf Fremd…
Browse files Browse the repository at this point in the history
…schlüssel-Elemente in Tabellen
  • Loading branch information
gdmhrogut committed Nov 7, 2023
1 parent c13e23e commit 27c3564
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions datenmanagement/views/views_list_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,14 @@ def prepare_results(self, qs):
foreign_model = value._meta.label
foreign_model_primary_key = value._meta.pk.name
foreign_model_title = self.columns.get(column)
foreign_model_attribute_for_text = self.columns_with_foreign_key.get(column)
data = '<a href="' + reverse(
'datenmanagement:' + foreign_model.replace(
value._meta.app_label + '.',
''
) + '_change',
args=[getattr(value, foreign_model_primary_key)]
) + '" target="_blank" rel="noopener noreferrer" class="required" title="'\
+ foreign_model_title + ' ansehen oder bearbeiten">' + str(
getattr(value, foreign_model_attribute_for_text)) + '</a>'
+ foreign_model_title + ' ansehen oder bearbeiten">' + str(value) + '</a>'
# take all foreign key values as they are
else:
data = escape(value)
Expand Down

0 comments on commit 27c3564

Please sign in to comment.