text: from django.db import models
  
  
  # Examples from:
  # https://docs.djangoproject.com/en/1.11/topics/db/queries/#making-queries
  
  class Blog(models.Model):
      name = models.CharField(max_length=100)
      tagline = models.TextField()
  
      def __str__(self):
          return self.name
  
  
  class Author(models.Model):
      name = models.CharField(max_length=200)
      email = models.EmailField()
  
      def __str__(self):
          return self.name
  
  
  class Entry(models.Model):
      blog = models.ForeignKey(Blog, on_delete=models.CASCADE)
      headline = models.CharField(max_length=255)
      body_text = models.TextField()
      pub_date = models.DateField()
      mod_date = models.DateField()
      authors = models.ManyToManyField(Author)
      n_comments = models.IntegerField()
      n_pingbacks = models.IntegerField()
      rating = models.IntegerField()
  
      def __str__(self):
          return self.headline
  