This is a pretty simple Django question, but I can\'t find the answer in the Django docs, despite lots of hunting!
How do I check whether an object already exists, and o
If you're using a recent version of Django, you can use the unique_together option to the UserToUserRole model, and then use the get_or_create() method Joe Holloway showed. This will guarantee that you can't get a duplicate.