On Wed, May 11, 2011 at 09:58:14PM -0700, Gabe wrote:
> I am using built-in Django admin. In my models.py file password field
> is defined:
> 
>     password = models.CharField(max_length=64)
> 
> I just can`t see password type field for models.

It is hard for us to guess what you're actually trying to achieve.
Here are my guesses:

1) You created your own model which has nothing to do with the admin
   infrastructure (i. e. the auth infrastructure used by the admin is
   the default one bundled with Django). This model includes a
   CharField that you want to represent in the admin using a
   PasswordWidget.

   In this case you'll just want to override the widget for this
   specific field. (I don't know the specifics, you can look it up in
   the tutorial or reference.)

2) You created a model replacing the default User model bundled in the
   auth framework and are having issues with the admin login screen
   using a regular TextInput for the password. This would be possible
   if you specified a custom login_form to the AdminSite.

   In this case you'll also want to override the widget used for this
   form field to a PasswordInput.

I don't know if I guessed right but I hope it was at least a little
bit useful.

Michal Petrucha

Attachment: signature.asc
Description: Digital signature

Reply via email to