I create in my model the Authors

class Author(User):
  """ An Author is someone more of less identified """
  # TODO : Ensure that in fact the users are FK to the Django user
management code
  gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
  persistance = models.ForeignKey(PersistanceDuration)

  def __unicode__(self):
    return u'%s %s --> user-id : %s (%s)' % (self.first_name,
self.last_name, self.username, self.email)

  class Admin:
    list_display = ( 'username', 'email', 'first_name', 'last_name',
'gender', 'date_joined', 'last_login')
    list_filter = ( 'username', 'email', 'first_name', 'last_name',
'gender')
    ordering = ('username',)
    search_fields = ( 'username', 'email', 'first_name', 'last_name',
'gender')

  class Meta:
    ordering = ['username']

****************************

In the admin console I see Author I created and they are active.
However when I try to authenticate with the following code (either in
a django-shell or in the View):

def login(request):
  logging.fatal ('def login(request):')
  if (request.method== 'POST'):
    user = None
    username = request.POST['username']
    email = request.POST['email']
    pwd = request.POST['password']
    logging.fatal('Value received :\n\tusername : %s\n\te-mail : %s\n
\tpassword : %s' % (username, email, pwd))

    if username is not None :
      user = authenticate(username=username, password=pwd)
      ...

********************************************
The user is always "None"...

What do I do wrong ... ?
It seems to me that everything is OK but the authenticate keeps on
returning None !


\T,









-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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