Skip to content

Commit 109bcca

Browse files
authored
Merge pull request #1899 from raffaellasuardini/master
Removed old manual import in the shell
2 parents 71c4c3d + 58531da commit 109bcca

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

en/django_orm/README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,6 @@ You're now in Django's interactive console. It's just like the Python prompt, bu
3434

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

37-
{% filename %}command-line{% endfilename %}
38-
```python
39-
>>> Post.objects.all()
40-
Traceback (most recent call last):
41-
File "<console>", line 1, in <module>
42-
NameError: name 'Post' is not defined
43-
```
44-
45-
Oops! An error showed up. It tells us that there is no Post. It's correct – we forgot to import it first!
46-
47-
{% filename %}command-line{% endfilename %}
48-
```python
49-
>>> from blog.models import Post
50-
```
51-
52-
We import the model `Post` from `blog.models`. Let's try displaying all posts again:
53-
5437
{% filename %}command-line{% endfilename %}
5538
```python
5639
>>> Post.objects.all()

0 commit comments

Comments
 (0)