mirror of
https://github.com/jazzband/django-admin-sortable.git
synced 2026-03-17 06:20:33 +00:00
Refactored how the sortable_by properties get populated by looping over the model fields until we get to the SortableForeignKey, then grabbing properties from the field and its related data.
56 lines
1.1 KiB
JSON
56 lines
1.1 KiB
JSON
[
|
|
{
|
|
"pk": 1,
|
|
"model": "app.category",
|
|
"fields": {
|
|
"order": 1,
|
|
"title": "Test 1"
|
|
}
|
|
},
|
|
{
|
|
"pk": 2,
|
|
"model": "app.category",
|
|
"fields": {
|
|
"order": 2,
|
|
"title": "Test 2"
|
|
}
|
|
},
|
|
{
|
|
"pk": 3,
|
|
"model": "app.category",
|
|
"fields": {
|
|
"order": 3,
|
|
"title": "Test 3"
|
|
}
|
|
},
|
|
{
|
|
"pk": 1,
|
|
"model": "app.project",
|
|
"fields": {
|
|
"category": 1,
|
|
"description": "Test",
|
|
"order": 1,
|
|
"title": "Test Project 1"
|
|
}
|
|
},
|
|
{
|
|
"pk": 2,
|
|
"model": "app.project",
|
|
"fields": {
|
|
"category": 1,
|
|
"description": "Test",
|
|
"order": 2,
|
|
"title": "Test Project 2"
|
|
}
|
|
},
|
|
{
|
|
"pk": 3,
|
|
"model": "app.project",
|
|
"fields": {
|
|
"category": 2,
|
|
"description": "Test",
|
|
"order": 3,
|
|
"title": "Test Project 3"
|
|
}
|
|
}
|
|
]
|