-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Alembic support from alchemy cookiecutter #3307
Conversation
- Adjust linenos in defining models step - Update package version numbers to latest
- This is not complete. I don't know what I did wrong, but the script does not run.
@mmerickel I took a stab at merging the cookiecutter's default script with the tutorial's script from the I'm not sure whether the script is correct and I should wait until I fix the views in the next step to get it to run, or the script is wrong. Will $ env/bin/initialize_tutorial_db development.ini
Traceback (most recent call last):
File "env/bin/initialize_tutorial_db", line 11, in <module>
load_entry_point('tutorial', 'console_scripts', 'initialize_tutorial_db')()
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/tutorial/scripts/initialize_db.py", line 40, in main
env = bootstrap(config_uri)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/pyramid/paster.py", line 107, in bootstrap
app = get_app(config_uri, options=options)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/pyramid/paster.py", line 28, in get_app
return loader.get_wsgi_app(name, options)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/plaster_pastedeploy/__init__.py", line 131, in get_wsgi_app
global_conf=defaults)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/paste/deploy/util.py", line 55, in fix_call
val = callable(*args, **kw)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/tutorial/__init__.py", line 11, in main
config.scan()
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/pyramid/config/__init__.py", line 1043, in scan
ignore=ignore)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/env/lib/python3.5/site-packages/venusian/__init__.py", line 230, in scan
__import__(modname)
File "/Users/stevepiercy/projects/hack-on-pyramid/tutorial/tutorial/views/default.py", line 6, in <module>
from ..models import MyModel
ImportError: cannot import name 'MyModel' |
from pyramid.paster import bootstrap, setup_logging | ||
from sqlalchemy.exc import OperationalError | ||
|
||
from ..models import Page, User |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use from .. import models
and use models.Page
etc down below
- Synch up emphasize-lines to new script changes - Update output examples
@mmerickel ready for final review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @stevepiercy.
WIP. Should be backported to
1.9-branch
only upon completion.See #1597 and Pylons/pyramid-cookiecutter-alchemy#7