Use OneToOneField instead of a ForeignKey with unique=True.

This commit is contained in:
Roberto Rosario
2016-01-22 04:01:15 -04:00
parent fbb22affaa
commit 5ec3025120
2 changed files with 20 additions and 3 deletions

View File

@@ -24,9 +24,7 @@ class DocumentCheckout(models.Model):
"""
Model to store the state and information of a document checkout
"""
document = models.ForeignKey(
Document, unique=True, verbose_name=_('Document')
)
document = models.OneToOneField(Document, verbose_name=_('Document'))
checkout_datetime = models.DateTimeField(
auto_now_add=True, verbose_name=_('Check out date and time')
)