hi to all
I asked myself to play a little with users and groups of Django for educational purposes
the essence of the idea is as follows:
the user is registered at the same time choosing the type of registration (user type) for example the group “G1” and the group “G2”
after registration, each user gets access to a personal account, which differs (different data) depending on who he is “G1” or “G2”; BUT, in the personal account “G1” there is a button to send a message and then when a user creates a message (from G1), it should go to all users from the “G2” group, and those in their personal account either delete the message or reply to it to the sender from G1 - the answer is as if private.
Now about the models, by analogy with the blog, I think so:
- Group model (analogy with categories) is the user type “G1” or “G2”
- Profile1 model (analogy with posts) in which OneToOne with a user model and Foreignkey with a group is for users from “G1”
- Profile2 model (analogy with posts) in which OneToOne with a user model and Foreignkey with a group is for users from “G2”
- Messages model (analogy with comments) in which Foreignkey with Profile1
please tell me is this the right approach or not?