y "The chapter belongs to a
single book" with a foreign key:
class Book(models.Model):
title = models.CharField(max_length=250)
class Chapters(models.Model):
title = models.CharField(max_length=250)
text = models.TextField()
book = models.ForeignKey(Book)
Now a chapt
ok" with a foreign key:
class Book(models.Model):
title = models.CharField(max_length=250)
class Chapters(models.Model):
title = models.CharField(max_length=250)
text = models.TextField()
book = models.ForeignKey(Book)
Now a chapter can belong only to a book.
On Thu, Aug 9, 2018 at 4
Hi,
I'm Germano from Italy. I'm new of django.
Probably this discussion has many many examples, but I can't find
my situation.
I have two models, Book and Chapters.
These are simple models, I need them only for educational purpose.
class Book(models.Model):
title=models.CharField(max_length=2
3 matches
Mail list logo