Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: entrypoint_name parameter renaming #16

Merged
merged 1 commit into from
Nov 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions invenio_db/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def init_app(self, app, **kwargs):
app.extensions['invenio-db'] = self
app.cli.add_command(db_cmd)

def init_db(self, app, entrypoint_name='invenio_db.models', **kwargs):
def init_db(self, app, entry_point_group='invenio_db.models', **kwargs):
"""Initialize Flask-SQLAlchemy extension."""
# Setup SQLAlchemy
app.config.setdefault(
Expand All @@ -64,8 +64,9 @@ def init_db(self, app, entrypoint_name='invenio_db.models', **kwargs):
db.init_app(app)

# Initialize model bases
if entrypoint_name:
for base_entry in pkg_resources.iter_entry_points(entrypoint_name):
if entry_point_group:
for base_entry in pkg_resources.iter_entry_points(
entry_point_group):
base_entry.load()

sa.orm.configure_mappers()
2 changes: 1 addition & 1 deletion tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_init():
'SQLALCHEMY_DATABASE_URI', 'sqlite:///test.db'
)
FlaskCLI(app)
InvenioDB(app, entrypoint_name=False)
InvenioDB(app, entry_point_group=False)

class Demo(db.Model):
__tablename__ = 'demo'
Expand Down