First of all thx for all replies.

For now I don`t use auth.User model I would like to create my own. So
I have written model class Users:

class Users(models.Model):
    login =
models.CharField(max_length=64,error_messages={'required':'Podanie
loginu jest obowiązkowe','unique':'Podany login już istnieje. Wybierz
inny.'},help_text='Wybierz login do pracy w systemie.',unique=True)
    password =
models.CharField(max_length=64,error_messages={'min_length':'Hasło
musi zawierać od 8 do 64 znaków','required':'Podanie hasła jest
wymagane'},help_text='Wprowadź hasło.')
    email = models.EmailField(help_text='Podaj adres e-mail. Będzie on
używany do kontaktu z Tobą przez
administratora.',error_messages={'required':'Podanie e-maila jest
wymagane','invalid':'Format adresu jest niepoprawny'})
    isActive = models.BooleanField(default=False)
    priviledge = models.OneToOneField(Priviledges,blank=True)
    activation_code = models.CharField(max_length=64,blank=True)

    def __unicode__(self):
        return self.login

Then I have registered it in admin panel by editing admin.py among
with another models:

from django.contrib import admin
from dgcmsUser.models import Users
from dgcmsUser.models import Priviledges
from dgcmsUser.models import UsersProfiles

admin.site.register(Users)
admin.site.register(UsersProfiles)
admin.site.register(Priviledges)


Then when I add user using autogenerated admin panel the password
field is <input type="text" /> not <input type="password" /> which I
would like it to be.

I haven`t done any other file editions.


Gabe

On 12 Maj, 13:52, Michal Petrucha <michal.petru...@ksp.sk> wrote:
> 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
>
>  signature.asc
> < 1KWyświetlPobierz

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to