Ticket #1796: transcript.txt

File transcript.txt, 3.0 KB (added by curtis.thompson@…, 18 years ago)

Problem transcript

Line 
1C:\tmp\djt\mysite>manage shell
2Could not open file <shell> for safe execution.
3Python 2.4 (#60, Feb 9 2005, 19:03:27) [MSC v.1310 32 bit (Intel)]
4Type "copyright", "credits" or "license" for more information.
5
6IPython 0.7.1.fix1 -- An enhanced Interactive Python.
7? -> Introduction to IPython's features.
8%magic -> Information about IPython's 'magic' % functions.
9help -> Python's own help system.
10object? -> Details about 'object'. ?object also works, ?? prints more.
11
12In [1]: from mytest.models import *
13
14In [2]: m = mymodel.objects.get(id=1)
15
16In [3]: m
17Out[3]: <mymodel: mymodel object>
18
19In [4]: m.submodel.count()
20---------------------------------------------------------------------------
21exceptions.TypeError Traceback (most recent ca
22 last)
23
24C:\tmp\djt\mysite\<ipython console>
25
26C:\Python24\lib\site-packages\django\db\models\manager.py in count(self)
27 52
28 53 def count(self):
29---> 54 return self.get_query_set().count()
30 55
31 56 def dates(self, *args, **kwargs):
32
33C:\Python24\lib\site-packages\django\db\models\query.py in count(self)
34 184 counter._limit = None
35 185 counter._select_related = False
36--> 186 select, sql, params = counter._get_sql_clause()
37 187 cursor = connection.cursor()
38 188 if self._distinct:
39
40C:\Python24\lib\site-packages\django\db\models\query.py in _get_sql_clause(sel
41
42 407
43 408 # Convert self._filters into SQL.
44--> 409 tables2, joins2, where2, params2 = self._filters.get_sql(opts)
45 410 tables.extend(tables2)
46 411 joins.update(joins2)
47
48C:\Python24\lib\site-packages\django\db\models\query.py in get_sql(self, opts)
49 538 tables, joins, where, params = [], SortedDict(), [], []
50 539 for val in self.args:
51--> 540 tables2, joins2, where2, params2 = val.get_sql(opts)
52 541 tables.extend(tables2)
53 542 joins.update(joins2)
54
55C:\Python24\lib\site-packages\django\db\models\query.py in get_sql(self, opts)
56 587
57 588 def get_sql(self, opts):
58--> 589 return parse_lookup(self.kwargs.items(), opts)
59 590
60 591 class QNot(Q):
61
62C:\Python24\lib\site-packages\django\db\models\query.py in parse_lookup(kwarg_it
63ems, opts)
64 695 raise TypeError, "Cannot parse keyword query %r" % kwarg
65
66 696
67--> 697 tables2, joins2, where2, params2 = lookup_inner(path, clause
68, value, opts, opts.db_table, None)
69 698 tables.extend(tables2)
70 699 joins.update(joins2)
71
72C:\Python24\lib\site-packages\django\db\models\query.py in lookup_inner(path, cl
73ause, value, opts, table, column)
74 798 raise
75 799 else: # No match found.
76--> 800 raise TypeError, "Cannot resolve keyword '%s' into field" % name
77
78 801
79 802 # Check to see if an intermediate join is required between current_t
80able
81
82TypeError: Cannot resolve keyword 'mymodel' into field
83
Back to Top