Re: Importing the user.id in form.

2013-06-15 Thread shashank sandela
That worked. Thanks alot. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-

Re: User authentication with either username or email.

2013-06-15 Thread shashank sandela
This helped alot and solved the issue. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, s

Importing the user.id in form.

2013-06-15 Thread shashank sandela
Hi, I defined a model which has a 'ForeignKey' to the 'User' . models.py : *class Design(models.Model):* * title = models.CharField(max_length=100)* * designer=models.ForeignKey(User) * * description = models.TextField(null = True)* * def __unicode__(self):* * return self.title* * * forms.py :

Re: User authentication with either username or email.

2013-06-14 Thread shashank sandela
Sorry. The error was: AttributeError at /authentication/ 'User' object has no attribute 'backend' -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users

Re: User authentication with either username or email.

2013-06-14 Thread shashank sandela
As you can see in the views.py I did import the class * EmailOrUsernameModelBackend.* * * Now when I used " *user = EmailOrUsernameModelBackend().authenticate(username=username, password=password) *" It gave an error saying: AttributeError at /tangle/auth/ 'User' object has no attribute 'backen

User authentication with either username or email.

2013-06-14 Thread shashank sandela
Hi, I created a backends.py in my project folder. backends.py :: *from django.conf import settings* *from django.contrib.auth.models import User* * * *class EmailOrUsernameModelBackend(object):* *def authenticate(self, username=None, password=None):* *if '@' in username:* *