I have a table called family, you can see the models.py below. My partner told me that he wanted the relationship to change to this kind 1,Father 2,Mother 3,Husband 4,Wife 5,Son 6,Daughter 7,Aunt 8,Uncle 9,Nephew 10,Niece 11,Others
This is where he will sent me the id (eg:5) and i will save that 5 into relationship field and display Son My way of thinking is creating a new table call relationship and hardcode each relationship 1 by 1 (all 11 of it) Then change the relationship field in Family into this : relationship = models.ForeignKey(Relationship) But i have a feeling this is a very troublesome way to do it. Can anyone help me on what way it will be easier ? This is the model: class Family(models.Model): userId = models.ForeignKey(MyUser, related_name='user_family') relationship = models.CharField(max_length=100) first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) gender = models.CharField(max_length=6, blank=True, null=True) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/275c600e-1e9a-4529-8ee1-3c7b4e2d8b60%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.