Saturday, 31 August 2013

flask-admin queryset analog from django-admin

flask-admin queryset analog from django-admin

I'm using SQLAlchemy ModelView
Well, I'm trying to manage per-item permissions in my admin. So, users can
change only that model instances, they created.
I can add column "author" with relation to "User" table.
After that, in django-admin typically we use
def queryset:
qs = super(...
qs = qs.filter(author = request.user)
return qs
So, how to do this in flask-admin. Mb, it's definitely another way, and
maybe there is "queryset" analog?

No comments:

Post a Comment