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

WIP admin: added flask-admin modelviews #30

Closed
wants to merge 5 commits into from

Conversation

krzysztof
Copy link
Member

  • Added Flask-Admin model views registration

@@ -155,6 +155,11 @@ def get(cls, pid_type, pid_value, pid_provider='', provider=None):
#
# Instance methods
#
def __repr__(self):
"""Text representation of the object."""
return '<PID: Type:{0}, Value:{1}, Provider:{2}, Status:{3}>'.format(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative formatting:

return ('<PID: Type:{0.pid_type}, Value:{0.pid_value}, Provider:{0.pid_provider}, '
        'Status:{0.status}>'.format(self))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, looks much better. Thanks!

@jirikuncar jirikuncar added this to the v1.0.0 milestone Nov 4, 2015
@@ -136,6 +136,9 @@ def run_tests(self):
'invenio_base.apps': [
'invenio_pidstore = invenio_pidstore:InvenioPIDStore',
],
'invenio_admin.register': [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jirikuncar How should this entry point group be named ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go for invenio_admin.apps or invenio_admin.views

WDYT @lnielsen ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm..... not sure - I agree invenio_admin.register is not the best.

Alternatives:

invenio_admin.init_admins
invenio_admin.init
invenio_admin.admins
invenio_admin.exts

The entry point specifies callables that initialise the admin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps invenio_admin.init_modelviews would be the most accurate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to avoid a verb in entry point group name, hence invenio_admin.modelviews is fine, however one can create admin views without a SQLAlchemy model too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll go with invenio_admin.views then.

@jirikuncar
Copy link
Member

@krzysztof it's fine if the WIP is only in PR title and not commit message.

def __repr__(self):
"""Text representation of the PidLog."""
return '<PidLog (Id:{0.id}): IdPID:{0.id_pid}, Action:{0.action}, ' \
'Msg:{0.message}, Time:{0.timestamp}>'.format(self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing )?

@lnielsen lnielsen assigned lnielsen and unassigned krzysztof Nov 10, 2015
lnielsen and others added 3 commits November 19, 2015 09:36
* INCOMPATIBLE Major rewrite of PIDStore in order to fix performance
  issues and clean up programmatic API. (closes inveniosoftware#21) (closes inveniosoftware#20)
  (closes inveniosoftware#19) (closes inveniosoftware#9) (closes inveniosoftware#4) (closes inveniosoftware#1)

* Adds support for redirecting persistent identifiers.

* Adds support for integer record identifier minting.

Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
Signed-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>
Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>
@lnielsen
Copy link
Member

@krzysztof Will you update this PR to the latest version of PIDStore.

* Adds datacite and invenio_db as known third parties to .editorconfig

Signed-off-by: Krzysztof Nowak <k.nowak@cern.ch>
@lnielsen
Copy link
Member

Sorry, can I get you to rebase on top of latest master (I merged #35 before this one). Also, since you are anyway rebasing, please add a dot at the end of the commit message sentence in the bullet: * Adds Flask-Admin model views registration.

@krzysztof
Copy link
Member Author

Can we turn on the coveralls.io for PRs as well ?

@krzysztof
Copy link
Member Author

Don't merge this yet, I'll modify it once this: inveniosoftware/invenio-admin#7 is merged.

* Adds Flask-Admin model views registration.

Signed-off-by: Krzysztof Nowak <k.nowak@cern.ch>
@krzysztof
Copy link
Member Author

I have to PR to another branch of invenio-pidstore as next seems to be outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants