The important to me idea is to use a natural primary key.

I would happily replace the not-quite-a-urn cnxuser: and convert to either the domain-less or full URL (/folder/1234-12344) as the primary key

I would still however perform the same lookups and kludgy work as I am passing in as paremetes all the model needs

for example other syntax might be

def klass_from_URI(id, SCRIPT_NAME):
    
but the effect would be the same (except the cnxuser: would go)