In one of my Django models, I override the save function. I do this to get the user's username. But that keeps failing.
this is what i did:
def save(self, *args, **kwargs):
self.slug = slugify('%s' % (self.question))
if not self.id:
self.publish_date = datetime.datetime.now()
self.publisher = self.request.user
self.modification_date = datetime.datetime.now()
self.modifier = self.request.user
super(Faq, self).save(*args, **kwargs) # Call the "real" save() method
This fails with: 'Faq' object has no attribute 'request'
Thanks.