This file contains hidden or 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
| [application.main] | |
| filter-with = "pony" | |
| use = "egg:webtest#debug" | |
| [filter.pony] | |
| use = "egg:paste#pony" | |
| [server.main] | |
| use = "egg:waitress" | |
| host = "127.0.0.1" |
This file contains hidden or 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
| [logging.main] | |
| version = 1 | |
| [logging.main.formatters.generic] | |
| "()" = "formatter.JSONFormatter" | |
| [logging.main.handlers.console] | |
| formatter = "generic" | |
| class = "logging.StreamHandler" | |
| stream = "ext://sys.stdout" |
This file contains hidden or 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
| # Needs JS/CSS from https://github.com/yesmeck/jquery-jsonview/ | |
| from pyramid_debugtoolbar.panels import DebugPanel | |
| class JSONRPCPanel(DebugPanel): | |
| name = 'jsonrpc' | |
| template = 'fnordapp:templates/jsonrpc_panel.dbtmako' | |
| title = 'JSON-RPC calls' | |
| nav_title = 'JSON-RPC' |
This file contains hidden or 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
| # sqlacodegen with --noclasses produces tables that look like this: | |
| t_match_matchrelationship = Table( | |
| 'match_matchrelationship', metadata, | |
| Column('id', BigInteger, primary_key=True, server_default=text("nextval('match_matchrelationship_id_seq'::regclass)")), | |
| Column('created_on', DateTime(True), nullable=False, index=True), | |
| Column('opportunity_id', ForeignKey(u'opportunities_opportunity.id'), nullable=False, index=True), | |
| Column('transaction_profile_id', ForeignKey(u'transaction_profile.transaction_data_id'), index=True), | |
| Column('score', BigInteger, nullable=False), | |
| Column('sent_date', DateTime(True), index=True), | |
| Column('pursued_on', DateTime(True)), |
This file contains hidden or 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
| from sqlalchemy import ( | |
| Column, | |
| Index, | |
| Integer, | |
| Text, | |
| ) | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy import engine_from_config |
This file contains hidden or 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
| from pyramid.config import Configurator | |
| from sqlalchemy import engine_from_config | |
| from .models import ( | |
| DBSession, | |
| Base, | |
| ) | |
| def main(global_config, **settings): |
This file contains hidden or 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
| from pyramid.response import Response | |
| from pyramid.view import view_config | |
| from sqlalchemy.exc import DBAPIError | |
| from .models import ( | |
| DBSession, | |
| MyModel, | |
| ) |
This file contains hidden or 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
| from sqlalchemy import ( | |
| Column, | |
| Index, | |
| Integer, | |
| Text, | |
| ) | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import ( |
This file contains hidden or 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
| jon@astyanax:~$ python | |
| Python 2.7.9 (default, Dec 10 2014, 23:46:04) | |
| [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> import urllib | |
| >>> urllib.urlopen('https://coveralls.io/r/inklesspen/montague') | |
| Traceback (most recent call last): | |
| File "<stdin>", line 1, in <module> | |
| File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 87, in urlopen | |
| return opener.open(url) |
This file contains hidden or 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
| >>> markupsafe.escape(u"Hello {tag}there{end}").format(tag="<a href='...'>", end="</a>") | |
| Markup('Hello <a href='...'>there</a>') | |
| >>> markupsafe.escape(u"Hello {tag}there{end}").format(tag=markupsafe.Markup("<a href='...'>"), end=markupsafe.Markup("</a>")) | |
| Markup("Hello <a href='...'>there</a>") |