Generic Relations and Primary Keys not being of type int

This references #204.

Here is my patch fwiw.
why ``user_model`` is used instead of ``group_model`` here?