imwilsonxu/fbone

Can't add any pk ids to the followers

sh4nks opened this issue · 0 comments

Hey,

I have been playing a bit with your fbone and figured out that your DenormalizedText type doesn't work :/

>>> user = User.query.filter_by(id=1).first()
2013-11-27 18:43:57,552 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)
2013-11-27 18:43:57,555 INFO sqlalchemy.engine.base.Engine SELECT users.password AS users_password, users.id AS users_id, users.name AS users_name, users.email AS users_email, users.openid AS users_openid, users.activation_key AS users_activation_key, users.created_time AS users_created_time, users.avatar AS users_avatar, users.role_code AS users_role_code, users.status_code AS users_status_code, users.user_detail_id AS users_user_detail_id, users.followers AS users_followers, users.following AS users_following 
FROM users 
WHERE users.id = ?
 LIMIT ? OFFSET ?
2013-11-27 18:43:57,555 INFO sqlalchemy.engine.base.Engine (1, 1, 0)
>>> user.followers.add(1)
>>> user.followers
set([1])
>>> db.session.add(user) # normally you don't need to do this.. but I want to be sure that everything is added 
>>> db.session.commit()
2013-11-27 18:46:23,833 INFO sqlalchemy.engine.base.Engine COMMIT
>>> user.followers
2013-11-27 18:46:35,899 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)
2013-11-27 18:46:35,902 INFO sqlalchemy.engine.base.Engine SELECT users.password AS users_password, users.id AS users_id, users.name AS users_name, users.email AS users_email, users.openid AS users_openid, users.activation_key AS users_activation_key, users.created_time AS users_created_time, users.avatar AS users_avatar, users.role_code AS users_role_code, users.status_code AS users_status_code, users.user_detail_id AS users_user_detail_id, users.followers AS users_followers, users.following AS users_following 
FROM users 
WHERE users.id = ?
2013-11-27 18:46:35,902 INFO sqlalchemy.engine.base.Engine (1,)
set([])
>>> user = User.query.filter_by(id=1).first()
2013-11-27 18:46:44,414 INFO sqlalchemy.engine.base.Engine SELECT users.password AS users_password, users.id AS users_id, users.name AS users_name, users.email AS users_email, users.openid AS users_openid, users.activation_key AS users_activation_key, users.created_time AS users_created_time, users.avatar AS users_avatar, users.role_code AS users_role_code, users.status_code AS users_status_code, users.user_detail_id AS users_user_detail_id, users.followers AS users_followers, users.following AS users_following 
FROM users 
WHERE users.id = ?
 LIMIT ? OFFSET ?
2013-11-27 18:46:44,414 INFO sqlalchemy.engine.base.Engine (1, 1, 0)
>>> user.followers
set([])
>>> 

Or am I doing something wrong?