Skip to content
Snippets Groups Projects
Unverified Commit 63dae809 authored by Steven Loria's avatar Steven Loria Committed by GitHub
Browse files

Merge pull request #279 from zhongdai/master

remove the db. by using the alias
parents 791a31ec 4adebd33
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ class SurrogatePK(object):
__table_args__ = {'extend_existing': True}
id = db.Column(db.Integer, primary_key=True)
id = Column(db.Integer, primary_key=True)
@classmethod
def get_by_id(cls, record_id):
......@@ -70,6 +70,6 @@ def reference_col(tablename, nullable=False, pk_name='id', **kwargs):
category_id = reference_col('category')
category = relationship('Category', backref='categories')
"""
return db.Column(
return Column(
db.ForeignKey('{0}.{1}'.format(tablename, pk_name)),
nullable=nullable, **kwargs)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment