12 | | >>> MyModel(geom=Geometry('POINT(10 10)'),num=1).save() |
13 | | >>> my_objs = MyModel.objects.defer('geom').all() |
14 | | >>> print my_objs |
15 | | >>> [] |
| 13 | Here's how to raise it: |
| 14 | {{{ |
| 15 | >>> MyModel.objects.create(num=5.0, name='Foobar') |
| 16 | <MyModel: MyModel object> |
| 17 | >>> qs = MyModel.objects.defer('num') |
| 18 | >>> print qs |
| 19 | Traceback (most recent call last): |
| 20 | File "<ipython console>", line 1, in <module> |
| 21 | File "C:\Python25\lib\site-packages\IPython\Prompts.py", line 552, in __call__ |
| 22 | manipulated_val = self.display(arg) |
| 23 | File "C:\Python25\lib\site-packages\IPython\Prompts.py", line 578, in _display |
| 24 | return self.shell.hooks.result_display(arg) |
| 25 | File "C:\Python25\lib\site-packages\IPython\hooks.py", line 141, in __call__ |
| 26 | ret = cmd(*args, **kw) |
| 27 | File "C:\Python25\lib\site-packages\IPython\hooks.py", line 171, in result_display |
| 28 | out = pformat(arg) |
| 29 | File "C:\Python25\lib\pprint.py", line 111, in pformat |
| 30 | self._format(object, sio, 0, 0, {}, 0) |
| 31 | File "C:\Python25\lib\pprint.py", line 129, in _format |
| 32 | rep = self._repr(object, context, level - 1) |
| 33 | File "C:\Python25\lib\pprint.py", line 195, in _repr |
| 34 | self._depth, level) |
| 35 | File "C:\Python25\lib\pprint.py", line 207, in format |
| 36 | return _safe_repr(object, context, maxlevels, level) |
| 37 | File "C:\Python25\lib\pprint.py", line 292, in _safe_repr |
| 38 | rep = repr(object) |
| 39 | File "C:\django\trunk\django\db\models\query.py", line 61, in __repr__ |
| 40 | data = list(self[:REPR_OUTPUT_SIZE + 1]) |
| 41 | File "C:\django\trunk\django\db\models\query.py", line 76, in __len__ |
| 42 | self._result_cache.extend(list(self._iter)) |
| 43 | File "C:\django\trunk\django\db\models\query.py", line 261, in iterator |
| 44 | for row in self.query.results_iter(): |
| 45 | File "C:\django\trunk\django\db\models\sql\query.py", line 292, in results_iter |
| 46 | row = self.resolve_columns(row, fields) |
| 47 | File "C:\django\trunk\django\db\backends\oracle\query.py", line 54, in resolve_columns |
| 48 | values.append(self.convert_values(value, field)) |
| 49 | File "C:\django\trunk\django\db\backends\oracle\query.py", line 74, in convert_values |
| 50 | value = float(value) |
| 51 | ValueError: invalid literal for float(): Foobar |