This is my code :
from django.db import models
from django.contrib.auth.models import User
class Post(models.Model):
STATUS_CHOICES = (
('draft','Draft'),
('published','Published'),
)
title = models.CharField(max_length=100)
slug = models.SlugField(max_length=120)
author = models.ForeignKey(User, related_name='chat_posts')
body = models.TextField()
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
status = models.CharField(max_length=10, choices=STATUS_CHOICES, default='draft')
def __str__(self):
return self.title
and the problem is with
File "C:--------------------------\models.py", line 20 def str(self):
IndentationError: unindent does not match any outer indentation level for str
Can someone help me with this?