There is nice example: https://github.com/facundobatista/kilink/blob/master/kilink/backend.py#L72 how to handle model and backend class.