Issue #3 resolved

Iterative example code doesn't work

Sakartu
created an issue

I have tried connecting to a mysql database, iterating over the rows of a table as shown in the example code:

import sqlsoup
db = sqlsoup.SQLSoup("mysql://phpbb_readonly:test1234@localhost:3306/phpbb3")

for post in db.phpbb_posts:
    print "title", post.post_subject

But this gives me a non-iterable error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'TableClassType' object is not iterable

It does work when calling the .all() function (for post in db.phpbb_posts.all()).

My sqlsoup version is:

>>> sqlsoup.__version__
'0.9.0'

Comments (2)

  1. Log in to comment