def initial(self, request, user_id, *args, **kwargs): if user_id == 'mine': self.user = request.user self.user_id = str(request.user.id) self.mine = True else: self.user_id = user_id self.user = User.get(user_id) self.mine = False self.set_owner(str(self.user.id)) super(UserBaseView, self).initial(request, *args, **kwargs)
def get_author(self): from people.models import User return User.get(self.author_id)