Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

return the actual related object instead the id #308

Merged
merged 2 commits into from
Jul 22, 2017

Conversation

mgaitan
Copy link

@mgaitan mgaitan commented Jul 21, 2017

if the field is a ForeignKey, field.get_attname() return the name of the column instead of the actual field (ie, for a fk named medio, it returns "medio_id"). Then, the pk of the related object is returned instead of the actual object, and it looks like this in the detail view.

captura de pantalla de 2017-07-21 17-24-43

With this change the object is returned, thus its __str__ is used to display it.

captura de pantalla de 2017-07-21 17-24-13

@kmmbvnr kmmbvnr merged commit 933b193 into viewflow:master Jul 22, 2017
@kmmbvnr
Copy link
Collaborator

kmmbvnr commented Jul 22, 2017

Thanks!

See also #194

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants