Pylons / pyramid_tutorials

Tutorials for Pyramid
https://docs.pylonsproject.org/projects/pyramid/en/latest/
89 stars 63 forks source link

Step 8 of quick_traversal falls over with database error #57

Closed agmartin closed 8 years ago

agmartin commented 10 years ago

In step 7, we bootstrap the sqlite database and populate it with a root object.

In step 8, when you add the sqltraversal file, that database is no longer what's expected.

initialize_db.py has to be altered and re-run.

Lines 12-17 should be: from .sqltraversal import ( DBSession, Base, )

from .models import Folder

And then Lines 37-39 can be changed to this: with transaction.manager: rootnode = Folder(id=1, name='root') DBSession.add(rootnode)

agmartin commented 10 years ago

Actually, this does not completely solve the problem. The page loads the root resource with the above bootstrap, but the program does nothing when you try to add folders or documents. I'm not sure what the problem is there.

EDIT: I do not believe that this is related to the database issue above. I will submit a PR for this issue later, but I'm opening a new issue for this item.

stevepiercy commented 10 years ago

@agmartin please provide an URL of the tutorial in question.

agmartin commented 10 years ago

Sure thing: http://docs.pylonsproject.org/projects/pyramid-tutorials/en/latest/quick_traversal/sqladdcontent.html

agmartin commented 10 years ago

The problem here is that the root node of the traversal hierarchy cannot have a title. That is what messes up the generated links. I will update the database bootstrap script and submit a pull request.

stevepiercy commented 8 years ago

@agmartin I fixed this issue in PR #122. There were a whole bunch of errors.