Skip to content

Instantly share code, notes, and snippets.

@Glukhoff
Created June 28, 2022 06:16
Show Gist options
  • Save Glukhoff/39fee4b24a57b9b38c48e9a5857c1b16 to your computer and use it in GitHub Desktop.
Save Glukhoff/39fee4b24a57b9b38c48e9a5857c1b16 to your computer and use it in GitHub Desktop.
@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