biosustain / potion

Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine
http://potion.readthedocs.io
Other
488 stars 51 forks source link

Known uses of Potion? #104

Closed deeplook closed 7 years ago

deeplook commented 7 years ago

I'm trying to use Potion more, but stumble a bit over its permission system. For example, there is no example using PrincipalMixin (the one in the README is only a fragment).

When looking for third party projects using Potion I've found exactly zero, which is maybe also due to the double meanings of works like flask and potion, leading to search results including lots of stuff like elixir, etc...

So I wonder if the README maybe (or any other place for that purpose) could include a section about known use cases, ideally with pointers to repositories using Potion?

lyschoening commented 7 years ago

That would be nice, sure, but I don't know how that would best be done. As far as I know there are a handful of production projects that use Flask-Potion. At DTU Biosustain we are running a few internally and there are contributors from a few other companies. I do not know how many people use Flask-Potion without contributing.

One issue is that we're not listed as an official Flask extension, which is due to the stagnant Flask extension registry rewrite that has meant a freeze on the addition of new extensions to the registry. The development of Flask more generally has been pretty much stagnant for the last two or so years, as a result of which most Flask extensions are quite inactive. Maybe with Flask 1.0 there will be renewed interest.

I do not quite understand the problem you are having with the Principals extension. It is built on top of a Flask extension called Flask-Principal and is intended for users of that extension. To activate it, all you have to do is decorate your manager class with flask_potion.contrib.principals.principals(). At that point, no additional configuration should be required beyond what is usually done to set up Flask-Principal and the permissions configuration that is described on the documentation page.

class BookResource(ModelResource):
    class Meta:
        manager = principals(SQLAlchemyManager)
        permissions = {
            'create': 'editor'
        }
deeplook commented 7 years ago

Brief follow-up: after searching for "flask_potion" I've found a handful of forks and exactly one toy example on github, https://github.com/sgalkina/todo_api, and zero on bitbucket.

lyschoening commented 7 years ago

See my comment above.

deeplook commented 7 years ago

I did, and it's entirely valid. Just wanted to provide more data.

lyschoening commented 7 years ago

I guess the takeaway message is the library isn't used much in open source projects at this time.