

def get_extra(self, request, obj=None, **kwargs):
    extra = 2
    if obj:
        return (extra - obj.binarytree_set.count())
    return extra

dataset/ETHPy150Open django/django/tests/admin_inlines/admin.py BinaryTreeAdmin.get_extra/original