You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📝 Add docstrings to feature/parameterize-namespace
Docstrings generation was requested by @KommuSoft.
* #1 (comment)
The following files were modified:
* `django_adminlink/admin.py`
* `django_adminlink/static/js/single_admin_action.js`
Copy file name to clipboardExpand all lines: django_adminlink/admin.py
+37Lines changed: 37 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,11 @@ class LinkFieldAdminMixin:
11
11
admin_url_namespace="admin"
12
12
13
13
def_convert_list_display_item(self, field_name):
14
+
"""
15
+
Converts a list display field name to a callable that renders a link for ForeignKey fields.
16
+
17
+
If the specified field is a ForeignKey, returns a callable that displays the related object as a clickable link to its admin change page. Otherwise, returns the original field name.
Copy file name to clipboardExpand all lines: django_adminlink/static/js/single_admin_action.js
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
/**
2
+
* Selects a single item in a Django admin list and triggers the specified admin action for that item.
3
+
*
4
+
* Retrieves the primary key and action from the provided element's data attributes, updates the action selector, unchecks all other items, checks the targeted item, and submits the form to perform the action on that item only.
5
+
*
6
+
* @param {Element} e - The element containing `data-pk` and `data-action` attributes for the target item and action.
0 commit comments