Skip to content

Commit

Permalink
try to add fa.bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
gawel committed Oct 19, 2011
1 parent 39a3b5a commit e3b8af1
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "fa.extjs"]
path = fa.extjs
url = [email protected]:FormAlchemy/fa.extjs.git
[submodule "fa.bootstrap"]
path = fa.bootstrap
url = [email protected]:FormAlchemy/fa.bootstrap.git
4 changes: 3 additions & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[buildout]
newest = false
parts = eggs supervisor
develop = . formalchemy fa.jquery fa.extjs pyramid_formalchemy pyramid_formalchemy/pyramidapp
develop = . formalchemy fa.jquery fa.extjs fa.bootstrap pyramid_formalchemy pyramid_formalchemy/pyramidapp

[eggs]
recipe = z3c.recipe.scripts
Expand All @@ -10,9 +10,11 @@ eggs =
Pygments
formalchemy
fa.jquery
fa.bootstrap
fa.extjs
Pylons
pyramid_formalchemy
pyramid_tm
fanstatictemplate
pyramidapp
ipython
Expand Down
17 changes: 15 additions & 2 deletions development.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use = egg:Paste#urlmap
/fa.jquery = fa.jquery
/jquery = egg:fa.jquery
/demo = demo
/fa.bootstrap = bootstrap
/ = docs

[app:pyramid_formalchemy]
Expand Down Expand Up @@ -53,13 +54,25 @@ default_locale_name = fr
available_languages = fr en pt_BR
available_themes = *


[pipeline:demo]
pipeline =
egg:WebError#evalerror
egg:repoze.tm2#tm
pyramid

[app:bootstrap]
use = egg:formalchemy_project#bootstrap
reload_templates = true
debug_authorization = false
debug_notfound = false
debug_routematch = false
debug_templates = true
default_locale_name = en
sqlalchemy.url = sqlite:///%(here)s/demo.db
default_locale_name = fr
available_languages = fr en pt_BR
available_themes = *


[server:main]
use = egg:Paste#http
host = 0.0.0.0
Expand Down
1 change: 1 addition & 0 deletions fa.bootstrap
Submodule fa.bootstrap added at 1919fd
1 change: 1 addition & 0 deletions formalchemy_project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def main(global_config, **settings):
engine = engine_from_config(settings, 'sqlalchemy.')
models.initialize_sql(engine)
config = Configurator(settings=settings)
config.include('pyramid_tm')
config.add_translation_dirs('formalchemy_project:locale/')

# pyramid_formalchemy's configuration
Expand Down
25 changes: 25 additions & 0 deletions formalchemy_project/fa_bootstrap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from pyramid.config import Configurator
from sqlalchemy import engine_from_config

from formalchemy_project import models

def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
engine = engine_from_config(settings, 'sqlalchemy.')
models.initialize_sql(engine)
config = Configurator(settings=settings)
config.include('pyramid_tm')
config.add_translation_dirs('formalchemy_project:locale/')

# pyramid_formalchemy's configuration
config.include('pyramid_formalchemy')
config.include('fa.bootstrap')
config.include('fa.extjs')

# Admin UI (Used for the demo. Not really useful here...)
config.formalchemy_admin('/admin', package='formalchemy_project', view='fa.bootstrap.views.ModelView')

return config.make_wsgi_app()


2 changes: 1 addition & 1 deletion formalchemy_project/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ def initialize_sql(engine):
Base.metadata.create_all(engine)
try:
populate()
except IntegrityError, e:
except:
DBSession.rollback()
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
entry_points = """\
[paste.app_factory]
main = formalchemy_project:main
bootstrap = formalchemy_project.fa_bootstrap:main
""",
paster_plugins=['pyramid'],
)
Expand Down

0 comments on commit e3b8af1

Please sign in to comment.