Skip to content

Commit 4620931

Browse files
authored
Python3-ify quickstart.rst
1 parent 2988362 commit 4620931

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/quickstart.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ But they are not yet in the database, so let's make sure they are::
6060
Accessing the data in database is easy as a pie::
6161

6262
>>> User.query.all()
63-
[<User u'admin'>, <User u'guest'>]
63+
[<User 'admin'>, <User 'guest'>]
6464
>>> User.query.filter_by(username='admin').first()
65-
<User u'admin'>
65+
<User 'admin'>
6666

6767
Note how we never defined a ``__init__`` method on the ``User`` class?
6868
That's because SQLAlchemy adds an implicit constructor to all model
@@ -143,8 +143,8 @@ load all categories and their posts, you could do it like this::
143143
>>> from sqlalchemy.orm import joinedload
144144
>>> query = Category.query.options(joinedload('posts'))
145145
>>> for category in query:
146-
... print category, category.posts
147-
<Category u'Python'> [<Post u'Hello Python!'>, <Post u'Snakes'>]
146+
... print(category, category.posts)
147+
<Category 'Python'> [<Post 'Hello Python!'>, <Post 'Snakes'>]
148148

149149

150150
If you want to get a query object for that relationship, you can do so

0 commit comments

Comments
 (0)