You have to pass request.user from some view to the apropiate save method.
views.py:
def save_human(reqiest):
# do some stuff
human.save(request.user)
models.py:
class Human(Model):
# ...
def save(self, user):
# do something with user
Hello all!
Is it possible to find out current user id form "myapp/models.py" file
so i can customize the way it is saved from the admin interface?
I'd like to do something like
class Myapp(models.Model):
...
...
def save(self):
if user.is_superuser:
dosomethingher
2 matches
Mail list logo