Error when using backwards relation in query.

When a backwards relation is used in expressions, query fails because get_field() returns a RelatedObject instead of a field, now field is an attribute of the object.

'RelatedObject' object has no attribute 'attname'

I added a test for this.