Skip to content

Commit

Permalink
Merge pull request #436 from fin-q/donkopotamus-patch-collection-name
Browse files Browse the repository at this point in the history
Infer collection_name from __table__ instead of __tablename__
  • Loading branch information
jfinkels committed Feb 4, 2016
2 parents 02e0864 + 507bdc9 commit 553c0b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flask_restless/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def create_api_blueprint(self, name, model, methods=READONLY_METHODS,
msg = 'Collection name must be nonempty'
raise IllegalArgumentError(msg)
if collection_name is None:
collection_name = model.__tablename__
collection_name = model.__table__.name
# convert all method names to upper case
methods = frozenset((m.upper() for m in methods))
# the name of the API, for use in creating the view and the blueprint
Expand Down

0 comments on commit 553c0b6

Please sign in to comment.