Add the "to=" keyword argument to all ForeignKey, ManayToMany and OneToOne Fields.

Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
Michael Price
2018-04-01 20:49:04 -04:00
committed by Roberto Rosario
parent 038cd30960
commit 53239385ae
20 changed files with 176 additions and 174 deletions
+3 -3
View File
@@ -25,7 +25,7 @@ class DocumentCheckout(models.Model):
Model to store the state and information of a document checkout
"""
document = models.OneToOneField(
Document, on_delete=models.CASCADE, verbose_name=_('Document')
on_delete=models.CASCADE, to=Document, verbose_name=_('Document')
)
checkout_datetime = models.DateTimeField(
auto_now_add=True, verbose_name=_('Check out date and time')
@@ -37,7 +37,7 @@ class DocumentCheckout(models.Model):
verbose_name=_('Check out expiration date and time')
)
user = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE,
on_delete=models.CASCADE, to=settings.AUTH_USER_MODEL,
verbose_name=_('User')
)
block_new_version = models.BooleanField(
@@ -96,7 +96,7 @@ class DocumentCheckout(models.Model):
class NewVersionBlock(models.Model):
document = models.ForeignKey(
Document, on_delete=models.CASCADE, verbose_name=_('Document')
on_delete=models.CASCADE, to=Document, verbose_name=_('Document')
)
objects = NewVersionBlockManager()