Skip to content

Instantly share code, notes, and snippets.

View ByteJuggler's full-sized avatar

Walter Prins ByteJuggler

  • TFG Labs
  • South Africa
View GitHub Profile
@ByteJuggler
ByteJuggler / test_email_validation.py
Last active October 1, 2016 14:31
Py.Test test cases for email validation (& CodeEval challenge 35)
#!/usr/bin/env python
# -*- coding: windows-1252 -*-
# Copyright © 2016 Walter Prins. All rights reserved.
# Created: 2016-10-01
# Updated: 2016-10-01
"""Test cases for a hypothetical module called "email_validation" and a Python
callable (class) that will tell you if a given email is valid or not. My own
implementation is ultimately based on the RFC's and a state machine,
and passes against the below test suite. It also passes the CodeEval challenge
5d14acf63dd9b40f745da7a7d5f1c2098fee8973
sqlacodegen/codegen.py | 6 +++---
sqlacodegen/main.py | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/sqlacodegen/codegen.py b/sqlacodegen/codegen.py
index cf36410..a10a3dd 100644
--- a/sqlacodegen/codegen.py
+++ b/sqlacodegen/codegen.py
@@ -527,7 +527,7 @@ class CodeGenerator(object):
@ByteJuggler
ByteJuggler / sqa_so_q35849727.py
Created August 19, 2016 17:42
StackOverflow question 35849727 response gist to jcrudy
# The original gist at
# https://gist.github.com/jcrudy/fb30f079dfcf29fc6e3bd97b037eee1a
# which is in response to
# http://stackoverflow.com/questions/35849727/sqlalchemy-automap-data-and-override-some-columns/38191497#38191497
# does not appear to work as implied. That is to say overiding classes as in the
# original gist fails to cause them to appear under Base.classes.
# This gist demonstrates that. Caveat emptor, I am new to SQLAlchemy, so perhaps
# my expectations are wrong. I'd like clarification which is why I put together
# this gist.