diff --git a/.gitignore b/.gitignore index ea06e23c..47acf0c4 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ dist/ *egg*/ docs/_build .project +.pydevproject +.settings/ diff --git a/flask_restless/helpers.py b/flask_restless/helpers.py index 15e33ba8..7a18be84 100644 --- a/flask_restless/helpers.py +++ b/flask_restless/helpers.py @@ -213,6 +213,7 @@ def primary_key_names(model): """Returns all the primary keys for a model.""" return [key for key, field in inspect.getmembers(model) if isinstance(field, QueryableAttribute) + and hasattr(field, 'property') and isinstance(field.property, ColumnProperty) and field.property.columns[0].primary_key]