Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions en/django_orm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,6 @@ You're now in Django's interactive console. It's just like the Python prompt, bu

Let's try to display all of our posts first. You can do that with the following command:

{% filename %}command-line{% endfilename %}
```python
>>> Post.objects.all()
Traceback (most recent call last):
File "<console>", line 1, in <module>
NameError: name 'Post' is not defined
```

Oops! An error showed up. It tells us that there is no Post. It's correct – we forgot to import it first!

{% filename %}command-line{% endfilename %}
```python
>>> from blog.models import Post
```

We import the model `Post` from `blog.models`. Let's try displaying all posts again:

{% filename %}command-line{% endfilename %}
```python
>>> Post.objects.all()
Expand Down
Loading