Groups
Groups
Sign in
Groups
Groups
Django users
Conversations
About
Send feedback
Help
Get a filed2 value in Table1 based on Foreign key in Table2
15 views
Skip to first unread message
Dragan Mestrovik
unread,
Feb 17, 2018, 1:57:21 AM
2/17/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi,
Model1: ID, M1Name
Model2: ID,MID, M2Name
I want to to write a custom model method in Model2 that returns M1Name based on MID.
If you want, i will share my code here.
Thanks in advance.
Dragan Mestrovik
unread,
Feb 17, 2018, 2:36:37 AM
2/17/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
I am able to solve this by referring
https://stackoverflow.com/questions/14130174/django-foreign-key-value-in-a-list-display-admin?rq=1
https://stackoverflow.com/questions/163823/can-list-display-in-a-django-modeladmin-display-attributes-of-foreignkey-field
Reply all
Reply to author
Forward
0 new messages