Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrading to Cookiecutter template and Morepath0.14
- Loading branch information
1 parent
e9b5e8e
commit 59066ca
Showing
19 changed files
with
166 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
.installed.cfg | ||
.mr.developer.cfg | ||
parts | ||
src | ||
bin | ||
develop-eggs | ||
contents/* | ||
# Byte-compiled / optimized | ||
__pycache__/ | ||
*.py[co] | ||
|
||
# Distribution / packaging | ||
env/ | ||
build/ | ||
dist/ | ||
*.egg-info/ | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
|
||
# Sphinx documentation | ||
docs/_build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
language: python | ||
|
||
cache: pip | ||
env: | ||
- TOXENV=pep8 | ||
before_install: | ||
- pip install --upgrade pip setuptools | ||
install: | ||
- pip install tox | ||
script: | ||
- tox -e $TOXENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CHANGES | ||
******* | ||
|
||
0.1 (unreleased) | ||
================ | ||
|
||
- Initial public release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Copyright (c) 2014-2016, Morepath Developers | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of the <organization> nor the | ||
names of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL FANSTATIC DEVELOPERS BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
recursive-include morepath_batching * | ||
include *.txt | ||
include *.rst | ||
include *.ini | ||
include LICENSE | ||
global-exclude *.pyc | ||
global-exclude *.pyo | ||
global-exclude __pycache__/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Morepath SQLAlchemy Demo | ||
======================== | ||
|
||
Show how to create a server web application with Morepath that integrates | ||
a database based on SQLAlchemy. | ||
It uses the more.transaction plugin. | ||
|
||
See also more.transaction on Github: | ||
|
||
https://github.com/morepath/more.transaction | ||
|
||
Installation | ||
------------ | ||
|
||
You can use pip in a virtual env:: | ||
|
||
$ virtualenv env | ||
$ source env/bin/activate | ||
$ env/bin/pip install -e . | ||
|
||
Then to run the web server:: | ||
|
||
$ env/bin/morepath_sqlalchemy | ||
|
||
You can now access the application through http://localhost:5000 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# flake8: noqa | ||
|
||
from morepath_sqlalchemy.app import App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from more.transaction import TransactionApp | ||
|
||
|
||
class App(TransactionApp): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from .model import Document | ||
from .main import Session | ||
from .run import Session | ||
|
||
|
||
MAX_LIMIT = 20 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
Column, | ||
Integer, | ||
Text, | ||
) | ||
) | ||
from sqlalchemy.ext.declarative import declarative_base | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
import morepath | ||
import sqlalchemy | ||
from more.transaction import TransactionApp | ||
from sqlalchemy.orm import scoped_session, sessionmaker | ||
from zope.sqlalchemy import register | ||
from .model import Base | ||
from .app import App | ||
|
||
|
||
Session = scoped_session(sessionmaker()) | ||
register(Session) | ||
|
||
|
||
class App(TransactionApp): | ||
pass | ||
|
||
|
||
def main(): | ||
def run(): # pragma: no cover | ||
engine = sqlalchemy.create_engine('sqlite:///morepath_sqlalchemy.db') | ||
Session.configure(bind=engine) | ||
Base.metadata.create_all(engine) | ||
Base.metadata.bind = engine | ||
|
||
morepath.autosetup() | ||
morepath.autoscan() | ||
morepath.run(App()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
testpaths = morepath_sqlalchemy |
Oops, something went wrong.