ASKBOT / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
1.56k stars 627 forks source link

using OneToOneField #834

Closed shubhamc183 closed 5 years ago

shubhamc183 commented 5 years ago

Because Foreign key implicitly means unique = True.

Django suggests using models.OneToOneField

django_authopenid.UserPasswordQueue.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.

shubhamc183 commented 5 years ago

@martin-bts @evgenyfadeev made changes here instead of PR: 777.

Thanks