Skip to content

Commit

Permalink
Fix Django BookInstance.book model to have null default value (#2798)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishwillee committed Mar 8, 2021
1 parent d94cc67 commit 75ff165
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion files/en-us/learn/server-side/django/models/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ <h3 id="BookInstance_model">BookInstance model</h3>
class BookInstance(models.Model):
"""Model representing a specific copy of a book (i.e. that can be borrowed from the library)."""
id = models.UUIDField(primary_key=True, default=uuid.uuid4, help_text='Unique ID for this particular book across whole library')
book = models.ForeignKey('Book', on_delete=models.RESTRICT)
book = models.ForeignKey('Book', on_delete=models.RESTRICT, null=True)
imprint = models.CharField(max_length=200)
due_back = models.DateField(null=True, blank=True)

Expand Down

0 comments on commit 75ff165

Please sign in to comment.