This is the error when I tried to run python manage.py makemigrations
in command line
ERRORS:
asking.Question: (models.E020) The 'Question.check()' class method is currently overridden by <function BaseManager.check at 0x7f0f104889d8>.
This is Question
class in models.py
:
class Question(BaseModel):
content = models.CharField(max_length=250)
answer = models.TextField("answer", blank=True, null=True)
answerer = models.ForeignKey(
User,
on_delete=models.CASCADE,
related_name="questions"
)
def __str__(self):
return self.content
And this is BaseModel class:
from django.db import models
from model_utils.models import SoftDeletableManager, TimeStampedModel
class BaseModel(SoftDeletableManager, TimeStampedModel, models.Model):
class Meta:
abstract = True
I am using Django version 2.0.5
eran :
I think the problem is that your BaseModel derives from SoftDeletableManager and not SoftDeletableModel.\n\ne.g change to:\n\nclass BaseModel(SoftDeletableModel, TimeStampedModel, models.Model):\n\n class Meta:\n abstract = True\n",
2018-06-03T12:58:17