Questions tagged [flask-admin]

Flask-Admin is an extension for the Flask framework. It can be used for building admin interfaces easily, with model scaffolding support for many existing python ORMs. Use this tag for questions related to this extension only, and not for general 'admin' functionalities in Flask.

Flask-Admin is an advanced, extensible and simple to use 'administrative interface building' extension for the Flask framework.

It comes with batteries included: model scaffolding for SQLAlchemy, MongoEngine, pymongo and Peewee ORMs, a simple file management interface and a lot of usage examples.

You are not limited by the default functionality - instead of providing simple scaffolding for the ORM models, Flask-Admin provides tools that can be used to construct administrative interfaces of any complexity, using a consistent look and feel.

Documentation: https://flask-admin.readthedocs.io/en/latest/

GitHub: https://github.com/flask-admin/flask-admin

Issue tracker: https://github.com/flask-admin/flask-admin/issues

692 questions
0
votes
1 answer

how do i change flask-admin's locale?

I wanner change the locale, like: locale='zh_CN' not admin's application's locale, I need change flask-admin's locale code.
Shirley
  • 81
  • 1
  • 3
0
votes
2 answers

How can I override/customise the default formatting of a (native) object in a Jinja2 template?

I want to change the default way dates are presented to me in the flask admin, to give it a specific timezone and display it in a more human-readable format. There are a number of ways of going about this (filters, __html__, __str__, Babel, etc),…
bryhoyt
  • 273
  • 3
  • 10
0
votes
1 answer

Flask-admin : flask.ext.admin.contrib.sqla - ModelView - form_columns

first of all, I'm not python proof. I'm not sure to really understand the following sentence about the ModelView in the doc (http://flask-admin.readthedocs.org/en/latest/api/mod_contrib_sqla/) : Class inherits configuration options from…
Youpsla
  • 159
  • 2
  • 13
0
votes
1 answer

Inheritance causes InvalidRequestError in Flask

After running the code without any error the following code will causes an InvalidRequestError when pushing the "Edit record" or "Delete record" button in the User tab. This error is raised when using inheritance as demonstrated in code. I think…
met1366
  • 3
  • 1
  • 3
0
votes
0 answers

How to make flask-admin display using chinese?

I found from changelog that from 1.0.6 flask-admin begins to support chinese language. But after i checked through the document, i still don't get how to do it. I want the menu displayed using chinese.
Frank Cheng
  • 5,928
  • 9
  • 52
  • 80
0
votes
1 answer

Unicode error while creating directory in Flask-Admin

I'm getting UnicodeDecodeError error with FileAdmin module (included in Flask-Admin library for Flask): UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 5: ordinal not in range(128) Whenever I create a directory which has has…
mannaia
  • 860
  • 2
  • 11
  • 27
0
votes
1 answer

Flask-admin field not shown

I have simple user-roles models pair, each has __repr__ method: class User: ........... def __repr__(self): return ''.format(self.username) class Role: ........... def __repr__(self): return '
Alex G.P.
  • 9,609
  • 6
  • 46
  • 81
-1
votes
1 answer

Flask-admin not recognising current_user in model View

I created my ModelView in flask-admin and want to give role choices to user such that only admin can create user with role manager,admin or user. And user shouldn't have choice to give admin privilidges or as such. I am trying this code but it's…
-1
votes
1 answer

I have created a variable is_admin which is false by default and admin page is accessible only when is_admin is true

My error is :-AttributeError: 'AnonymousUserMixin' object has no attribute 'is_admin' I have been assigned a task of user and admin in flask framework . is _admin variable is defined in class as a boolean field and when it is true it will allow a…
-1
votes
1 answer

I want to implement manager class. So when we create user, we can define manager and under that defined manager we will create user

roles users = db.Table( 'roles_users', db.Column('user_id', db.Integer(), db.ForeignKey('user.id')), db.Column('role_id', db.Integer(), db.ForeignKey('role.id')) ) Above mentioned code is for roles_users table class Role(db.Model,…
-1
votes
1 answer

Flask-Admin returns "ValueError: Invalid format string" on clicking create for any model

I have an existing Flask project which uses SQLAlchemy and I wanted to interate an Admin dashboard. Everything worked fine, I managed to enable authentication by using the ModelView Class however if I try to edit or if I try to create a new object…
-1
votes
1 answer

Exception: Cannot assign two Admin() instances with same URL and subdomain to the same application

I am trying to restrict access to admin panel using flask-admin but i am getting error. I have also tried changing url name but then it throws 404 error. When using flask-admin with ModelView getting the following error: Exception: Cannot assign…
gujaratiraja
  • 371
  • 2
  • 19
-1
votes
2 answers

Formatting data in table

Currently using flask-admin, my data is quite long per column, i'm wondering how to format it so each line goes underneath after a certain length. So instead of FirstName johndoeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee transform it into this…
kmnflask
  • 175
  • 1
  • 12
-1
votes
1 answer

flask admin : sqlalchemy.exc.InterfaceError(Error binding parameter 8)

I was trying to save a project's reviewer using below, and the select field shows correct: # Query the user with Role.id == 4 as reviewer def reviewer_choices(): return User.query.join(User.roles).filter(Role.id == 4) # Build a select…
Samoth
  • 716
  • 15
  • 34
-1
votes
1 answer

How to allow Flask-Admin to accept JSON for record creation

I would like to know if it is possible to use Flask-Admin with the python requests library to create new records in the database from a script. An example would be as such: import requests new_userdata = {'username': 'testuser', 'confirmed_at':…
themantalope
  • 1,040
  • 11
  • 42
1 2 3
46
47