Created
June 28, 2022 06:16
-
-
Save Glukhoff/39fee4b24a57b9b38c48e9a5857c1b16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@admin.register(models.OwnersDetails) | |
class OwnersDetailsAdmin(admin.ModelAdmin): | |
list_filter = ("name_organization",) | |
search_fields = ["name_organization", "inn_organization"] | |
list_display = ["get_sn", "inn_organization", "name_organization", "first_name", "last_name"] | |
inlines = [DeviceInline, RepairOrderInline] | |
@display(ordering='device__serial_number', description='Device') | |
def get_sn(self, obj): | |
return obj.device.serial_number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment