librelist archives

« back to archive

Flask-admin: problemi with custom field (re-password) immediatly after password field

Flask-admin: problemi with custom field (re-password) immediatly after password field

From:
Massimiliano Dal Cero
Date:
2013-07-19 @ 18:05
Hi to all
I'm new here and also new Flask developer :)


My question:

I use Flask with Mongoengine + Flask-Admin

In Flask-Admin I have need to add a "custom field" to the user model.
This custom field is need for "re password", and it don't need to save in
DB.


class User(db.Document, UserMixin):
        username=db.StringField(None,255,0)
        email=db.EmailField(max_length=255, required=True)
        password=db.StringField(None,255,0)
        confirmed_at = db.DateTimeField()


Now I use "scaffold_form" in custom Model View ( class
UserModelView(ModelView) )

def scaffold_form(self):
   form_class = super(UserModelView, self).scaffold_form()
   form_class.re_password = PasswordField('Re Password')
   return form_class


Ok ... now re_password is added, but is added to end ... but I need to
place it immediatly after "password" field


I tried with:
form_columns = ( username, email, 'password', 're_password', 'email',
'confirmed_at')

without success :(


Somebody can help me ? :)



Thanks

Max

Re: [flask] Flask-admin: problemi with custom field (re-password) immediatly after password field

From:
Serge S. Koval
Date:
2013-07-19 @ 18:52
Please open issue on bug tracker, I will try to help.


On Fri, Jul 19, 2013 at 9:05 PM, Massimiliano Dal Cero <max@yattaweb.it>wrote:

> Hi to all
> I'm new here and also new Flask developer :)
>
>
> My question:
>
> I use Flask with Mongoengine + Flask-Admin
>
> In Flask-Admin I have need to add a "custom field" to the user model.
> This custom field is need for "re password", and it don't need to save in
> DB.
>
>
> class User(db.Document, UserMixin):
>         username=db.StringField(None,255,0)
>         email=db.EmailField(max_length=255, required=True)
>         password=db.StringField(None,255,0)
>         confirmed_at = db.DateTimeField()
>
>
> Now I use "scaffold_form" in custom Model View ( class
> UserModelView(ModelView) )
>
> def scaffold_form(self):
>    form_class = super(UserModelView, self).scaffold_form()
>    form_class.re_password = PasswordField('Re Password')
>    return form_class
>
>
> Ok ... now re_password is added, but is added to end ... but I need to
> place it immediatly after "password" field
>
>
> I tried with:
> form_columns = ( username, email, 'password', 're_password', 'email',
> 'confirmed_at')
>
> without success :(
>
>
> Somebody can help me ? :)
>
>
>
> Thanks
>
> Max
>
>

Re: [flask] Flask-admin: problemi with custom field (re-password) immediatly after password field

From:
Massimiliano Dal Cero
Date:
2013-07-19 @ 20:13
​Okay :)

Where add issue ? in GitHub of Flask (
https://github.com/mitsuhiko/flask/issues) or Flask-admin (
https://github.com/mrjoes/flask-admin/issues ) ?

Thanks for your reply :)

Max​



On Fri, Jul 19, 2013 at 8:52 PM, Serge S. Koval <serge.koval@gmail.com>wrote:

> Please open issue on bug tracker, I will try to help.
>




-- 
Ridentem dicere verum: quid vetat?


>_<

Re: [flask] Flask-admin: problemi with custom field (re-password) immediatly after password field

From:
dorian i
Date:
2013-07-20 @ 19:30
Open it on flask-admin


On Fri, Jul 19, 2013 at 10:13 PM, Massimiliano Dal Cero <max@yattaweb.it>wrote:

> Okay :)
>
> Where add issue ? in GitHub of Flask (
> https://github.com/mitsuhiko/flask/issues) or Flask-admin (
> https://github.com/mrjoes/flask-admin/issues ) ?
>
> Thanks for your reply :)
>
> Max
>
>
>
> On Fri, Jul 19, 2013 at 8:52 PM, Serge S. Koval <serge.koval@gmail.com>wrote:
>
>> Please open issue on bug tracker, I will try to help.
>>
>
>
>
>
> --
> Ridentem dicere verum: quid vetat?
>
>
> >_<
>