Jezzy Grey

Generation

translateFri, 17 Feb 2023

class BookInstance(models.Model): book = models.ForeignKey('Book', on_delete=models.SET_NULL, null=True) id = models.UUIDField(primary_key=True, default=uuid.uuid4, help_text="Unique ID for this particular book across " "whole library") imprint = models.CharField(max_length=200) due_back = models.DateField(null=True, blank=True) LOAN_STATUS = ( ('m', 'Maintenance'), ('o', 'On loan'), ('a', 'Available'), ('r', 'Reserved'), ) status = models.CharField(max_length=1, choices=LOAN_STATUS, blank=True, default='m', help_text='Book availability') class Meta: ordering = ["due_back"] def __str__(self): return '%s' % (self.book.title)

public class BookInstance { public int BookInstanceID { get; set; } public int BookID { get; set; } public Guid Id { get; set; } public String Imprint { get; set; } public DateTime DueBack { get; set; } public String Status { get; set; } public virtual Book Book { get; set; } }

Questions about programming?Chat with your personal AI assistant