> On 23 Sep 2015, at 20:37, Sebastian M Cheung
> wrote:
>
> posts = User.query.all()
> row = posts.select().execute().fetchone()
> print row[-1]
> return row.activation_code
>
> doesnt work
Why are you doing this? Instead of, for example:
posts =
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()})
You should share your SqlAlchemy model along with an executable script that
illustrates the query and others can comment-on or fix.
You are simply showing a mixture of raw data and random results that are
without any context.
--
You received this message because you are subscribed to the
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
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