Handle one to one relationships

One-to-one relationships do not have the attribute 'all'.
For a one-to-one relationship, `getattr(obj, rel)` returns the object itself.