What would be the best way to insert a variable into a field in django, similar to insert element into a list in python.
I am not trying to update a record field "first_name" in the database but rather "insert" or "add" a second "first_name" from someone else in the database that share the same last name.
Ex:
First Name Last Name
Alan Smith
Eric Jones
Inna Smith
Result:
First Name Last Name
Alan, Inna Smith, Smith
Eric Jones
I am using PostgreSQL as database.
Any help would be much appreciated. Thank you.
This is what I came up with. Hope it helps.