[sqlalchemy] Re: How to get specific attribute from last row?

2015-09-24 Thread Sebastian M Cheung
class User(db.Model): id = db.Column(db.Integer, primary_key=True) mobile = db.Column(db.String(20), unique=False, nullable=False, info={'validators': InputRequired()}) activation_code = db.Column(db.String(6), unique=False, nullable=False, info={'validators': InputRequired()})

[sqlalchemy] Re: How to get specific attribute from last row?

2015-09-23 Thread Sebastian M Cheung
for v in posts: for column, value in v.items(): print '{0}: {1}'.format(column, value) Also doesn't work -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an emai

[sqlalchemy] Re: How to get specific attribute from last row?

2015-09-23 Thread Sebastian M Cheung
posts = User.query.all() row = posts.select().execute().fetchone() print row[-1] return row.activation_code doesnt work -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an e

[sqlalchemy] How to get specific attribute from last row?

2015-09-23 Thread Sebastian M Cheung
This is my example, how to get the activation_code from my row? Thanks [ { "activation_code": "840896", "id": 1, "mobile": "447533345452" }, { "activation_code": "947721", "id": 2, "mobile": "447533345452" }, { "activation_code": "335548", "id": 3,