I have a model called *Team*, which has a ForeignKey relationship with 
*User* (a team can have many users, but a user can only be part of one 
team).

A user can create a team, and that user will automatically become a *Team 
Leader* (a group, not a model).  The team leader can query the database for 
other users and send invitations to other users join his team.  Users who 
receive an invitation can either accept or decline the invitation; if a 
user accepts an invitation, he joins the team as as a *Team Member*

My question is, how do I go about designing the invitation system?  After 
the team leader clicks the 'Send Invitation' button, the receiving-user 
should see a special invitation message on his dashboard, which he can 
either accept or decline.

My current thinking tells me I should create a model called *Invitation* 
which has a OneToOne relationship with User.  When an invitation is sent, 
an instance of Invitation is created which is assigned to the 
receiving-user.  The invitation instance will be deleted when the 
receiving-user accepts or declines the invitation.

Another method I can think of is to send an Email to the receiving-user.  
The Email will be like an account activation Email, except the activation 
link adds the receiving-user to the team and marks the receiving-user as a 
*team 
member.*

Pointers and guidance welcome.  I feel like both my methods are clumsy and 
maybe there is a built-in feature in Django which I missed which could 
solve this problem much easier.

-- 
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/029d4382-fdb2-4fc5-8832-337e1f870e24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to