예제 #1
0
 def test_exclude_keys(self):
     exclude_keys = ['one']
     key_values = {'one': 1, 'two': 2}
     new_keys = utils.exclude(key_values, *exclude_keys)
     self.assertEqual(len(new_keys), 1)
     self.assertEqual(new_keys, {'two': 2})
예제 #2
0
 def _extract_required_params(self, params, model_name):
     params = params or {}
     model_params = params.get(model_name, {})
     return utils.stringify_keys(utils.exclude(model_params,
                                               *self.exclude_attr))
예제 #3
0
 def test_empty_exclude(self):
     self.assertEqual(utils.exclude(None), None)
예제 #4
0
파일: wsgi.py 프로젝트: jcru/reddwarf_lite
 def _extract_required_params(self, params, model_name):
     params = params or {}
     model_params = params.get(model_name, {})
     return utils.stringify_keys(utils.exclude(model_params,
                                               *self.exclude_attr))
예제 #5
0
 def test_exclude_keys(self):
     exclude_keys = ['one']
     key_values = {'one': 1, 'two': 2 }
     new_keys = utils.exclude(key_values, *exclude_keys)
     self.assertEqual(len(new_keys), 1)
     self.assertEqual(new_keys, {'two': 2 })
예제 #6
0
 def test_empty_exclude(self):
     self.assertEqual(utils.exclude(None), None)
예제 #7
0
    def update(self, **values):
        attrs = utils.exclude(values, *self._auto_generated_attrs)
        self.merge_attributes(attrs)
        result = self.save()
#        self._notify_fields("update")
        return result