On 11/15/06, Pander <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm trying to get blogtutorial working with sqlite but for this url:
>   http://localhost:5000/blog/list
> I get the following error:
>
> File
> '/home/sander/workspace/pylons-tutorial/blogtutorial/blogtutorial/controllers/blog.py',
> line 11 in list
>   c.blogPosts = list(model.BlogPosts.select())
> File '/usr/lib/python2.4/site-packages/sqlobject/sresults.py', line 149
> in __iter__
>   return iter(list(self.lazyIter()))
> File '/usr/lib/python2.4/site-packages/sqlobject/sresults.py', line 156
> in lazyIter
>   conn = self._getConnection()
> File '/usr/lib/python2.4/site-packages/sqlobject/sresults.py', line 38
> in _getConnection
>   return self.ops.get('connection') or self.sourceClass._connection
> File
> '/usr/lib/python2.4/site-packages/Pylons-0.9.3-py2.4.egg/pylons/database.py',
> line 104 in __get__
>   return self.hub.__get__(obj, type)
> File '/usr/lib/python2.4/site-packages/sqlobject/dbconnection.py', line
> 848 in __get__
>   return self.getConnection()
> File '/usr/lib/python2.4/site-packages/sqlobject/dbconnection.py', line
> 860 in getConnection
>   raise AttributeError(
> AttributeError: No connection has been defined for this thread or
> process
>
> The only lines edited in development.ini is:
>   sqlobject.dburi = sqlite:///data/blogtutorial
> And when I do a dump of this database with:
>   sqlite3 /data/blogtutorial .dump
> I get:
>
> BEGIN TRANSACTION;
> CREATE TABLE blog_posts ( id INTEGER UNSIGNED NOT NULL,headline
> VARCHAR(255) NOT NULL DEFAULT '',text TEXT NOT NULL DEFAULT
> '',timestamp TIMESTAMP NOT NULL DEFAULT 0,  PRIMARY KEY(id));
> COMMIT;
>
> (Note that the AUTO_INCEMENT as described in the tutorial is not
> present, but that is another question. Is it okay like this for
> blogtutorial and in general with pylons and sqlite? With no auto
> increment the id will be incorrect, how to fix this?)
>
> Does anyone know how I can fix the error listed above:
>   AttributeError: No connection has been defined for this thread or
> process

That error message sounds like it might have to do with thread-local
sessions, which we've moved away from.  I haven't even read that
tutorial, so I can't say more.

Good Luck,
-jj

-- 
http://jjinux.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to