docs formatting bug: unescaped <>, python statements erroneously bundled with SQL output

Issue #1366 resolved
Former user created an issue

In http://www.sqlalchemy.org/docs/05/ormtutorial.html#returning-lists-and-scalars the eagerload() example has two Python statements hidden inside the collapsed SQL thing, with the output of those two statements invisible since the < and > characters aren't escaped.

This is what one sees with the SQL collapsed:

>>> from sqlalchemy.orm import eagerload

>>> jack = session.query(User).options(eagerload('addresses')).filter_by(name='jack').one()

and this is what one sees with the SQL expanded:

SELECT anon_1.users_id AS anon_1_users_id, anon_1.users_name AS
anon_1_users_name, anon_1.users_fullname AS anon_1_users_fullname,
anon_1.users_password AS anon_1_users_password, addresses_1.id AS
addresses_1_id, addresses_1.email_address AS addresses_1_email_address,
addresses_1.user_id AS addresses_1_user_id FROM (SELECT users.id AS users_id,
users.name AS users_name, users.fullname AS users_fullname, users.password AS
users_password FROM users WHERE users.name = ? LIMIT 2 OFFSET 0) AS anon_1 LEFT
OUTER JOIN addresses AS addresses_1 ON anon_1.users_id = addresses_1.user_id
ORDER BY addresses_1.id ['jack']('jack')

>>> jack


>>> jack.addresses
[, ]

Comments (2)

  1. Log in to comment