def lock_for(self, user, hard_lock=False):
        logger.info("Attempting to initiate a lock for user `%s`" % user)

        if not isinstance(user, auth.User):
            raise ValueError("You should pass a valid auth.User to lock_for.")
        
        if self.lock_applies_to(user):
            raise ObjectLockedError("This object is already locked by another user. \
                May not override, except through the `unlock` method.")
        else:
            self._locked_at = datetime.today()
            self._locked_by = user
            self._hard_lock = self.__init_hard_lock = hard_lock
            date = self.locked_at.strftime("%H:%M:%S")
            # an administrative toggle, to make it easier for devs to extend `django-locking`
            # and react to locking and unlocking
            self._state.locking = True
            logger.info("Initiated a %s lock for `%s` at %s" % (self.lock_type, self.locked_by, self.locked_at))
Together with ``unlock_for`` this is probably the most important method 
dataset/ETHPy150Open debrouwere/django-locking/locking/models.py/LockableModel.lock_for