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.
9 lines
318 B
Python
9 lines
318 B
Python
from django.db.models.fields.related import ForeignKey
|
|
|
|
|
|
class SortableForeignKey(ForeignKey):
|
|
"""
|
|
Field simply acts as a flag to determine the class to sort by.
|
|
This field replaces previous functionality where `sortable_by` was definied as a model property
|
|
that specified another model class.
|
|
"""
|