There are views.py :
def view(request): ... InfoMessage.createinfo('self',request.user, 3) ...
And model
class InfoMessage(models.Model): to_view=models.BooleanField(default=True) choice=models.CharField(max_length=1, choices=INFO_MESSAGE_CHOICES) user=models.ForeignKey(CustomUser) def createinfo(self, user, choice): obj=super(InfoMessage, self).objects.create(user=user, choice=choice) obj.save()
As a result, I get
unbound method create info () must be called with InfoMessage instance as first argument (got str instance instead)
How to fix it?