M
M
Maxim Maximov2020-02-10 16:20:25
Django
Maxim Maximov, 2020-02-10 16:20:25

An error in the model. Specify where?

Model.

from django.db import models
  
class Post(models.Model):
    
   title = models.CharField(max_length=120)

   text = models.TextField()

def __str__(self):
    return self.title

Error:
In [1]: from pages.models import Post

In [2]: Post.objects.all()
Out[2]: , ]>

In [3]: Post.objects.cereate(title='Title 2. ..', text='Text 2!')
-------------------------------------- -------------------------------------
AttributeError Traceback (most recent call last)
in
---- > 1 Post.objects.cereate(title='Title 2...', text='Text 2!')

AttributeError: 'Manager' object has no attribute 'cereate'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2020-02-11
@ulkoart

typo in "cereate" but you need to create

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question