Skip to content

Joined columns in SortableInlineAdminMixin #282

@tfeldmann

Description

@tfeldmann

See the screenshot, the amount column is joined into the part column. Any clues?

Bildschirmfoto 2021-09-06 um 18 30 50

My definitions:

class BOMPartInline(SortableInlineAdminMixin, admin.TabularInline):
    model = BOMPart
    fields = ("order", "amount", "part", "notice")
    autocomplete_fields = ("part",)
    formfield_overrides = {
        models.DecimalField: {"widget": forms.NumberInput(attrs={"step": 1})}
    }
    extra = 0
class BOMPart(models.Model):
    created_at = models.DateTimeField(auto_now_add=True, editable=False)
    order = models.PositiveIntegerField(default=0, blank=False, null=False)

    amount = models.DecimalField(max_digits=15, decimal_places=3)
    notice = models.CharField(max_length=200, blank=True)

    bom = models.ForeignKey(
        BOM,
        on_delete=models.CASCADE,
        related_name="parts",
    )
    part = models.ForeignKey(
        Part,
        on_delete=models.RESTRICT,
        null=True,
        blank=True,
    )

    class Meta:
        ordering = ["order"]

Activity

tfeldmann

tfeldmann commented on Sep 6, 2021

@tfeldmann
Author

I'm using Django 3.2.6 with django-admin-sortable2 1.0 from pypi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @tfeldmann

        Issue actions

          Joined columns in SortableInlineAdminMixin · Issue #282 · jrief/django-admin-sortable2