Re: 'self' is not define

2015-08-19 Thread Florian Schweikert
On 19/08/15 13:25, Remaze Vs wrote: > username=self.request.user.username What do you want to accomplish with this line? This cannot work. Where should self and self.request come from? You probably want to us a ForeignKey to the User model. (user = models.ForeignKey(User)) Afterwards you have to

'self' is not define

2015-08-19 Thread Remaze Vs
I am new in Django I am trying to insert session login username in database.but facing this error. my model.py file class Product(models.Model): title = models.CharField(max_length=120) description = models.TextField(null=True, blank=True) category = models.ManyToManyField(Category, null=True,