Get the related field name when it doesn't use a primary key for relatio...

add_related_count fails when the ref model is linked by a non-primary key. This patch fixes this issue.