Jezzy Grey

Generation

generate functionSat, 18 Feb 2023

Class for models, class name book, model for django framework, includes variables: name, author, short description, genre and language. Class for models, class name language, model for django framework, includes language variable. Variable with type many to many. Also includes a function that returns a string in string format.

class book(models.Model): name = models.CharField(max_length=400) author = models.CharField(max_length=400) short_description = models.TextField() genre = models.CharField(max_length=400) language = models.ManyToManyField(language) def __str__(self): return self.name

Questions about programming?Chat with your personal AI assistant