Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:01:27+00:00 2026-06-14T21:01:27+00:00

I have model like this: class User(db.Model): __tablename__ = ‘users’ __table_args__ = {‘mysql_engine’ :

  • 0

I have model like this:

class User(db.Model):
    __tablename__ = 'users'
    __table_args__ = {'mysql_engine' : 'InnoDB', 'mysql_charset' : 'utf8'}
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(80), unique=True)
    email = db.Column(db.String(120), unique=True)
    _password = db.Column('password', db.String(80))

    def __init__(self, username = None, email = None, password = None):
        self.username = username
        self.email = email
        self._set_password(password)

    def _set_password(self, password):
        self._password = generate_password_hash(password)

    def _get_password(self):
        return self._password

    def check_password(self, password):
        return check_password_hash(self._password, password)

    password = db.synonym("_password", descriptor=property(_get_password, _set_password))

    def __repr__(self):
        return '<User %r>' % self.username

I have ModelView:

class UserAdmin(sqlamodel.ModelView):
    searchable_columns = ('username', 'email')
    excluded_list_columns = ['password']
    list_columns = ('username', 'email')
    form_columns = ('username', 'email', 'password')

But no matter what i do, flask admin didn’t show password field when i’m editing user info. Is there any way ? Even just to edit hash code.

UPDATE: https://github.com/mrjoes/flask-admin/issues/78

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:01:28+00:00Added an answer on June 14, 2026 at 9:01 pm

    Reason why it did not work – Flask-Admin was not able to figure out what to do with SynonymProperty, so it failed to generate form field.

    There’s a way you can have it working right now:

    class UserAdmin(sqlamodel.ModelView):
        searchable_columns = ('username', 'email')
        excluded_list_columns = ['password']
        list_columns = ('username', 'email')
        form_columns = ('username', 'email')
    
        def scaffold_form(self):
            form_class = super(UserAdmin, self).scaffold_form()
            form_class.password = wtf.TextField('Password')
            return form_class
    

    I pushed simple fix which adds support for the SynonymProperty, so it will work even without form customization. Unfortunately, I’m in process of adding MongoDB backend, so I won’t be able to release new version any time soon.

    Just in case, SynonymProperty was superseded by hybrid properties in SQLAlchemy 0.7 and onward, which should be supported by the Flask-Admin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple model like this: class User < ActiveRecord::Base serialize :preferences end
I have a model like this: class Users(db.Model): email = db.EmailProperty(required=True, indexed=True) user_name =
I have a model class like this: class Note(models.Model): author = models.ForeignKey(User, related_name='notes') content
I have a model.py like this: class EventTypeCategory(models.Model): name = models.CharField(max_length=50, verbose_name=Name) user =
I have a model that looks like this: class Invite(models.Model): user = models.ForeignKey(User) event
I have a model, smth like this: class Action(models.Model): def can_be_applied(self, user): #whatever return
I have a model defined like this: class UserDetail(models.Model): user = models.ForeignKey(User, db_index=True, unique=True,
I have a large and complicated User model that looks something like this: class
I have a user model like this: class User < ActiveRecord::Base validates :password, :presence
Say I have a model like this: class Book(models.Model): user = models.ForeignKey(User) book_isbn =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.