from django.db import models


class Post(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    title = models.CharField(max_length=100, blank=True, default='')
    body = models.TextField(blank=True, default='')
    owner = models.ForeignKey('auth.User', related_name='posts', on_delete=models.CASCADE)
    # it's auth.User not just User 

    def __str__(self):
      return self.title

    class Meta:
        ordering = ['created']


class Comment(models.Model):
  created = models.DateTimeField(auto_now_add=True)
  body = models.TextField()
  owner = models.ForeignKey('auth.User', related_name='comments', on_delete=models.CASCADE)
  post = models.ForeignKey('Post',related_name='comments', on_delete=models.CASCADE)

  def __str__(self):
    return self.body

  class Meta:
    ordering = ['created']

class Category(models.Model):
  name = models.CharField(max_length=255)
  owner = models.ForeignKey('auth.User', related_name='categories',on_delete=models.CASCADE)
  post = models.ManyToManyField('Post', related_name='categories',blank=True, null=True,)

  def __str__(self):
    return self.name


  class Meta:
    verbose_name_plural = 'categories'


fd5dba343055e7397085856ea1d950ed13f062dd
<mask token>


class Post(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>


    class Meta:
        ordering = ['created']


class Comment(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    body = models.TextField()
    owner = models.ForeignKey('auth.User', related_name='comments',
        on_delete=models.CASCADE)
    post = models.ForeignKey('Post', related_name='comments', on_delete=
        models.CASCADE)

    def __str__(self):
        return self.body


    class Meta:
        ordering = ['created']


class Category(models.Model):
    name = models.CharField(max_length=255)
    owner = models.ForeignKey('auth.User', related_name='categories',
        on_delete=models.CASCADE)
    post = models.ManyToManyField('Post', related_name='categories', blank=
        True, null=True)

    def __str__(self):
        return self.name


    class Meta:
        verbose_name_plural = 'categories'

<mask token>


class Post(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __str__(self):
        return self.title


    class Meta:
        ordering = ['created']


class Comment(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    body = models.TextField()
    owner = models.ForeignKey('auth.User', related_name='comments',
        on_delete=models.CASCADE)
    post = models.ForeignKey('Post', related_name='comments', on_delete=
        models.CASCADE)

    def __str__(self):
        return self.body


    class Meta:
        ordering = ['created']


class Category(models.Model):
    name = models.CharField(max_length=255)
    owner = models.ForeignKey('auth.User', related_name='categories',
        on_delete=models.CASCADE)
    post = models.ManyToManyField('Post', related_name='categories', blank=
        True, null=True)

    def __str__(self):
        return self.name


    class Meta:
        verbose_name_plural = 'categories'

<mask token>


class Post(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    title = models.CharField(max_length=100, blank=True, default='')
    body = models.TextField(blank=True, default='')
    owner = models.ForeignKey('auth.User', related_name='posts', on_delete=
        models.CASCADE)

    def __str__(self):
        return self.title


    class Meta:
        ordering = ['created']


class Comment(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    body = models.TextField()
    owner = models.ForeignKey('auth.User', related_name='comments',
        on_delete=models.CASCADE)
    post = models.ForeignKey('Post', related_name='comments', on_delete=
        models.CASCADE)

    def __str__(self):
        return self.body


    class Meta:
        ordering = ['created']


class Category(models.Model):
    name = models.CharField(max_length=255)
    owner = models.ForeignKey('auth.User', related_name='categories',
        on_delete=models.CASCADE)
    post = models.ManyToManyField('Post', related_name='categories', blank=
        True, null=True)

    def __str__(self):
        return self.name


    class Meta:
        verbose_name_plural = 'categories'

from django.db import models


class Post(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    title = models.CharField(max_length=100, blank=True, default='')
    body = models.TextField(blank=True, default='')
    owner = models.ForeignKey('auth.User', related_name='posts', on_delete=
        models.CASCADE)

    def __str__(self):
        return self.title


    class Meta:
        ordering = ['created']


class Comment(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    body = models.TextField()
    owner = models.ForeignKey('auth.User', related_name='comments',
        on_delete=models.CASCADE)
    post = models.ForeignKey('Post', related_name='comments', on_delete=
        models.CASCADE)

    def __str__(self):
        return self.body


    class Meta:
        ordering = ['created']


class Category(models.Model):
    name = models.CharField(max_length=255)
    owner = models.ForeignKey('auth.User', related_name='categories',
        on_delete=models.CASCADE)
    post = models.ManyToManyField('Post', related_name='categories', blank=
        True, null=True)

    def __str__(self):
        return self.name


    class Meta:
        verbose_name_plural = 'categories'

from django.db import models


class Post(models.Model):
    created = models.DateTimeField(auto_now_add=True)
    title = models.CharField(max_length=100, blank=True, default='')
    body = models.TextField(blank=True, default='')
    owner = models.ForeignKey('auth.User', related_name='posts', on_delete=models.CASCADE)
    # it's auth.User not just User 

    def __str__(self):
      return self.title

    class Meta:
        ordering = ['created']


class Comment(models.Model):
  created = models.DateTimeField(auto_now_add=True)
  body = models.TextField()
  owner = models.ForeignKey('auth.User', related_name='comments', on_delete=models.CASCADE)
  post = models.ForeignKey('Post',related_name='comments', on_delete=models.CASCADE)

  def __str__(self):
    return self.body

  class Meta:
    ordering = ['created']

class Category(models.Model):
  name = models.CharField(max_length=255)
  owner = models.ForeignKey('auth.User', related_name='categories',on_delete=models.CASCADE)
  post = models.ManyToManyField('Post', related_name='categories',blank=True, null=True,)

  def __str__(self):
    return self.name


  class Meta:
    verbose_name_plural = 'categories'

