def process_request(self, request): # It attaches the db tracker signals. attach_db_track_signals() # It processes a request. request_info = RequestInfo() for field in RequestInfo._meta.fields: if request.META.has_key(field.name): setattr(request_info, field.name, request.META[field.name]) request_info.save()
def test_model_log(self): userinfo = UserInfo.objects.get(pk=1) userinfo.last_name = 'last_name changed' userinfo.save() self.check_last_log_entry_for_action(userinfo, ModelLog.ACTION_UPDATE) request = RequestInfo(path='/hello/hello', method='GET') request.save() self.check_last_log_entry_for_action(request, ModelLog.ACTION_CREATE) request.delete() self.check_last_log_entry_for_action(request, ModelLog.ACTION_DELETE)
def process_request(self, request): request_info = RequestInfo() for field in RequestInfo._meta.fields: if request.META.has_key(field.name): setattr(request_info, field.name, request.META[field.name]) request_info.save()
def process_request(self, request): method = request.META['REQUEST_METHOD'] path = request.path if path != '/requests/': r = RequestInfo(method=method, path=path) r.save()
def process_request(self, request): method = request.META['REQUEST_METHOD'] path = request.path if path != reverse('requests'): r = RequestInfo(method=method, path=path) r.save()