jrief / django-admin-sortable2

Generic drag-and-drop ordering for objects in the Django admin interface
https://django-admin-sortable2.readthedocs.io/en/latest/
Other
753 stars 179 forks source link

Unable to see sort column (no pads) v2.1.9 #372

Closed halessi closed 11 months ago

halessi commented 1 year ago

Django 4.1

Minimal replication:

Models.py:


class testLesson(models.Model):
    title = models.CharField(max_length=200)

    def __str__(self):
        return self.title

class testCell(models.Model):
    my_order = models.PositiveIntegerField(default=0, blank=False, null=False)
    lesson = models.ForeignKey(testLesson, on_delete=models.CASCADE)
    content = models.TextField()

    class Meta:
        ordering = ['my_order']

    def __str__(self):
        return self.content[:50]   

Admin.py:

from .models import testCell, testLesson
from adminsortable2.admin import SortableTabularInline, SortableAdminBase

class testCellInline(SortableTabularInline):
    model = testCell
    extra = 1

@admin.register(testLesson)
class testLessonAdmin(SortableAdminBase, admin.ModelAdmin):
    inlines = [testCellInline]

View in admin portal:

image

halessi commented 1 year ago

Note that I can un-hide the "my_order" field in the DOM? But there are still no pads.

image

lsmith77 commented 1 year ago

seems like I am encountering the same issue on Django 4.2 https://github.com/jrief/django-admin-sortable2/issues/374

jrief commented 11 months ago

Sorry I don't understand what you mean.