سؤال

Hey guys I have created a messanging app in django in which i have User.auth,Profile and message app which works fine. Now i need is to add contact category in every user accounts. So they can add contacts like email with there firstname and last name?

هل كانت مفيدة؟

المحلول

You should be able to update your Profile model to include a many-to-many relationship with other Users. Then you can access the related user models for a given profile's contacts through that profile. In the profile model:

contacts = models.ManyToManyField(User)

Set blank/null as is appropriate.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top