Repository: django-cms/django-filer

Issue:
fix: directory listing with svg image
## Description

[fa385bd2b4b3022f54499bbb3c603d463f4baf2e](https://github.com/django-cms/django-filer/commit/fa385bd2b4b3022f54499bbb3c603d463f4baf2e) removed the `_view` suffix from url name

## Related resources

<!--
Add here links to existing issues or conversation from GitHub
or any other resource.
-->

* #...
* #...

## Checklist

<!--
Please check the following items before submitting, otherwise,
your pull request will be closed.
Use 'x' to check each item: [x] I have ...
-->

* [x] I have opened this pull request against ``master``
* [ ] I have added or modified the tests when changing logic
* [x] I have followed [the conventional commits guidelines](https://www.conventionalcommits.org/) to add meaningful information into the changelog
* [x] I have read the [contribution guidelines ](https://github.com/django-cms/django-filer/blob/master/docs/development.rst#contributing) and I have joined #workgroup-pr-review on 
[Slack](https://www.django-cms.org/slack) to find a “pr review buddy” who is going to review my pull request.

Field verbose_name should use gettext_lazy
Hi, 
model field verbose_names should use gettext_lazy, because it creates migrations based on user language settings. 

https://github.com/django-cms/django-filer/blob/master/filer/models/foldermodels.py#L9

This is migration generated after upgrade to django-filer 3.0
![image](https://github.com/django-cms/django-filer/assets/10236315/f3cdd97e-dcfe-449b-a928-a574976417da)

Thanks.


Discussion:

Or maybe I am just wrong and it doesn't help, just a guess.
@mihalikv No, you're right.

As a general rule;

`gettext_lazy()` should be used for anything loaded at runtime:
* `models.py` (fields, `verbose_name`, `help_text`, function `short_description`);
* `forms.py` (`labels`, `help_text`, `empty_label`);
* `apps.py` (`verbose_name`).

`gettext()`should be used for any modules that are executed during the request process, such as `views.py`

Resolving patch:
diff --git a/filer/models/filemodels.py b/filer/models/filemodels.py
--- a/filer/models/filemodels.py
+++ b/filer/models/filemodels.py
@@ -344,19 +344,24 @@ def has_generic_permission(self, request, permission_type):
         else:
             return False
 
-    def get_admin_change_url(self):
+    def get_admin_url(self, action):
         return reverse(
-            'admin:{}_{}_change'.format(
+            'admin:{}_{}_{}'.format(
                 self._meta.app_label,
                 self._meta.model_name,
+                action
             ),
             args=(self.pk,)
         )
 
+    def get_admin_change_url(self):
+        return self.get_admin_url("change")
+
+    def get_admin_expand_view_url(self):
+        return self.get_admin_url("expand")
+
     def get_admin_delete_url(self):
-        return reverse(
-            f'admin:{self._meta.app_label}_{self._meta.model_name}_delete',
-            args=(self.pk,))
+        return self.get_admin_url("delete")
 
     @property
     def url(self):


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -8,20 +8,13 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        python-version: ['3.8', '3.9', '3.10', '3.11']
+        python-version: ['3.10', '3.11', '3.12']
         requirements-file: [
-          django-3.2.txt,
-          django-4.0.txt,
-          django-4.1.txt,
           django-4.2.txt,
           django-5.0.txt,
+          django-main.txt,
         ]
         custom-image-model: [false, true]
-        exclude:
-          - requirements-file: django-5.0.txt
-            python-version: 3.8
-          - requirements-file: django-5.0.txt
-            python-version: 3.9
         os: [
           ubuntu-20.04,
         ]
diff --git a/tests/requirements/django-main.txt b/tests/requirements/django-main.txt
new file mode 100644
--- /dev/null
+++ b/tests/requirements/django-main.txt
@@ -0,0 +1,4 @@
+-r base.txt
+
+git+https://github.com/django/django@main#egg=Django
+django_polymorphic>=3.1
diff --git a/tests/test_admin.py b/tests/test_admin.py
--- a/tests/test_admin.py
+++ b/tests/test_admin.py
@@ -375,6 +375,7 @@ def test_image_expand_view(self):
 
         response = self.client.get(url)
 
+        self.assertEqual(url, self.file_object.get_admin_expand_view_url())
         self.assertContains(
             response,
             f"""<img id="img" src="{original_url}" onclick="this.classList.toggle('zoom')"/>"""