def get_base_schema(self):
        '''
        Retrieves base schema, taking into account dynamic typing
        '''
        schema = self.admin.model
        if schema._meta.typed_field:
            field = schema._meta.fields[schema._meta.typed_field]
            if self.request.GET.get(schema._meta.typed_field, False):
                key = self.request.GET[schema._meta.typed_field]
                try:
                    schema = field.schemas[key]
                except __HOLE__:
                    #TODO emit a warning
                    pass
            else:
                if self.temporary_document_id():
                    obj = self.get_temporary_store()
                else:
                    obj = self.object
                if obj:
                    try:
                        schema = field.schemas[obj[schema._meta.typed_field]]
                    except KeyError:
                        #TODO emit a warning
                        pass
            #KeyErrors cause the base schema to return, this should cause needs_typed_selection to return true
        return schema
dataset/ETHPy150Open zbyte64/django-dockit/dockit/admin/views.py/DocumentProxyView.get_base_schema