aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'grumpy/models.py')
-rw-r--r--grumpy/models.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/grumpy/models.py b/grumpy/models.py
index c3f0b71..85683fb 100644
--- a/grumpy/models.py
+++ b/grumpy/models.py
@@ -13,6 +13,7 @@ from . import app
from datetime import datetime
from flaskext.sqlalchemy import SQLAlchemy
from sqlalchemy.sql import func
+from sqlalchemy.orm.collections import column_mapped_collection
import json, random, string, time
@@ -36,7 +37,8 @@ class Category(db.Model):
category = db.Column('category', db.String, nullable=False, unique=True)
packages = db.relationship("Package", backref='category', \
- cascade='all, delete, delete-orphan')
+ cascade='all, delete, delete-orphan', \
+ collection_class=column_mapped_collection(db.text('packages.pkg_cat')))
def __init__(self, category):
self.category = category