Can't get why, but in Pyramid, the same code works, but generate on more 
UPDATE statement

report = session.query(TripReport).get(id)
user = session.query(User).filter_by(username='sector119').one()
comment = TripReportComment(content=form.content.data, user=user)
report.comments.append(comment)
session.add(report)


2011-11-09 13:36:35 EET LOG:  statement: BEGIN
2011-11-09 13:36:35 EET LOG:  statement: SELECT trip_reports.id AS 
trip_reports_id, trip_reports.title AS trip_reports_title, 
trip_reports.content AS trip_reports_content, trip_reports.route AS 
trip_reports_route, trip_reports.date_start AS trip_reports_date_start, 
trip_reports.date_end AS trip_reports_date_end, trip_reports.type_id AS 
trip_reports_type_id, trip_reports.user_id AS trip_reports_user_id, 
trip_reports.schedule_id AS trip_reports_schedule_id, 
trip_reports.create_date AS trip_reports_create_date, 
trip_reports.comments_count AS trip_reports_comments_count
        FROM trip_reports
        WHERE trip_reports.id = '7'
2011-11-09 13:36:35 EET LOG:  statement: SELECT users.password AS 
users_password, users.id AS users_id, users.username AS users_username, 
users.first_name AS users_first_name, users.last_name AS users_last_name, 
users.birthday AS users_birthday, users.sex AS users_sex, users.email AS 
users_email, users.organization AS users_organization, users.website AS 
users_website, users.signature AS users_signature, users.subscribed AS 
users_subscribed, users.create_date AS users_create_date, users.last_login 
AS users_last_login, users.disabled AS users_disabled
        FROM users
        WHERE users.username = 'sector119'
2011-11-09 13:36:35 EET LOG:  statement: INSERT INTO trip_report_comments 
(content, user_id, report_id) VALUES ('test3', 6, NULL) RETURNING 
trip_report_comments.id
2011-11-09 13:36:35 EET LOG:  duration: 1.014 ms
2011-11-09 13:36:35 EET LOG:  statement: SELECT trip_report_comments.id AS 
trip_report_comments_id, trip_report_comments.content AS 
trip_report_comments_content, trip_report_comments.create_date AS 
trip_report_comments_create_date, trip_report_comments.user_id AS 
trip_report_comments_user_id, trip_report_comments.report_id AS 
trip_report_comments_report_id
        FROM trip_report_comments
        WHERE 7 = trip_report_comments.report_id ORDER BY 
trip_report_comments.id


### HERE IS UPDATE :/

2011-11-09 13:36:35 EET LOG:  statement: UPDATE trip_report_comments SET 
report_id=7 WHERE trip_report_comments.id = 18



2011-11-09 13:36:35 EET LOG:  statement: COMMIT

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/yUYRzTS3JuMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to