sehmaschine / django-grappelli

A jazzy skin for the Django Admin-Interface (official repository).
http://www.grappelliproject.com
Other
3.77k stars 657 forks source link

drag&drop fails due to validation rule on empty element #1033

Closed lsmith77 closed 8 months ago

lsmith77 commented 1 year ago

Django Admin always adds an empty element to my list of relationships (ie. the one with the - at the end in the below screenshot).

image

The problem is that when I save now, the validation rule triggers because of the ordering property being filled.

How can I prevent this?

I would also be fine if I could figure out how to prevent this default empty element from being added to the list of relationships.

lsmith77 commented 1 year ago

ok figured out I can just set extra = 0 but would still be nice if grappelli would handle this better out of the box (ie. with extra > 0)

sehmaschine commented 11 months ago

are you sure it's because of the ordering field (because that should not be the case). other fields can be excluded with sortable_excludes.

lsmith77 commented 11 months ago

I cannot definitively say so but I tried to quickly reproduce the issue on an inline model without ordering and I was unable to.

sehmaschine commented 8 months ago

closing this for now. please reopen, if the issue still exists.