1 |
|
---|
2 | OperationalError at /
|
---|
3 | no such column: count
|
---|
4 | Request Method: GET
|
---|
5 | Request URL: http://localhost:4050/
|
---|
6 | Exception Type: OperationalError
|
---|
7 | Exception Value: no such column: count
|
---|
8 | Exception Location: c:\checkout\dev_sandbox\django\django\db\backends\sqlite3\base.py in execute, line 92
|
---|
9 | Template error
|
---|
10 |
|
---|
11 | In template templates/index.html, error at line 1
|
---|
12 | Caught an exception while rendering: no such column: count
|
---|
13 | 1 {{ object_list.count }}
|
---|
14 | Traceback (innermost last)
|
---|
15 | Switch to copy-and-paste view
|
---|
16 |
|
---|
17 | * c:\checkout\dev_sandbox\django\django\template\__init__.py in render_node
|
---|
18 | 711.
|
---|
19 | 712. def render_node(self, node, context):
|
---|
20 | 713. return(node.render(context))
|
---|
21 | 714.
|
---|
22 | 715. class DebugNodeList(NodeList):
|
---|
23 | 716. def render_node(self, node, context):
|
---|
24 | 717. try:
|
---|
25 | 718. result = node.render(context) ...
|
---|
26 | 719. except TemplateSyntaxError, e:
|
---|
27 | 720. if not hasattr(e, 'source'):
|
---|
28 | 721. e.source = node.source
|
---|
29 | 722. raise
|
---|
30 | 723. except Exception, e:
|
---|
31 | 724. from sys import exc_info
|
---|
32 | ? Local vars
|
---|
33 | Variable Value
|
---|
34 | context
|
---|
35 | [{'object_list': [], 'params': {}}, {'LANGUAGES': (('ar', 'Arabic'), ('bn', 'Bengali'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fi', 'Finnish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'en-us'}, {}, {'perms': <django.core.context_processors.PermWrapper object at 0x01503A10>, 'messages': [], 'user': <django.contrib.auth.models.AnonymousUser object at 0x01503990>}, {}]
|
---|
36 | e
|
---|
37 | <pysqlite2.dbapi2.OperationalError instance at 0x01506B98>
|
---|
38 | exc_info
|
---|
39 | <built-in function exc_info>
|
---|
40 | node
|
---|
41 | <Variable Node: object_list.count>
|
---|
42 | self
|
---|
43 | [<Variable Node: object_list.count>]
|
---|
44 | wrapped
|
---|
45 | <django.template.TemplateSyntaxError instance at 0x01506C60>
|
---|
46 | * c:\checkout\dev_sandbox\django\django\template\__init__.py in render
|
---|
47 | 761. def render(self, context):
|
---|
48 | 762. output = self.filter_expression.resolve(context)
|
---|
49 | 763. return self.encode_output(output)
|
---|
50 | 764.
|
---|
51 | 765. class DebugVariableNode(VariableNode):
|
---|
52 | 766. def render(self, context):
|
---|
53 | 767. try:
|
---|
54 | 768. output = self.filter_expression.resolve(context) ...
|
---|
55 | 769. except TemplateSyntaxError, e:
|
---|
56 | 770. if not hasattr(e, 'source'):
|
---|
57 | 771. e.source = self.source
|
---|
58 | 772. raise
|
---|
59 | 773. return self.encode_output(output)
|
---|
60 | 774.
|
---|
61 | ? Local vars
|
---|
62 | Variable Value
|
---|
63 | context
|
---|
64 | [{'object_list': [], 'params': {}}, {'LANGUAGES': (('ar', 'Arabic'), ('bn', 'Bengali'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fi', 'Finnish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'en-us'}, {}, {'perms': <django.core.context_processors.PermWrapper object at 0x01503A10>, 'messages': [], 'user': <django.contrib.auth.models.AnonymousUser object at 0x01503990>}, {}]
|
---|
65 | self
|
---|
66 | <Variable Node: object_list.count>
|
---|
67 | * c:\checkout\dev_sandbox\django\django\template\__init__.py in resolve
|
---|
68 | 554. upto = match.end()
|
---|
69 | 555. if upto != len(token):
|
---|
70 | 556. raise TemplateSyntaxError, "Could not parse the remainder: %s" % token[upto:]
|
---|
71 | 557. self.var, self.filters = var, filters
|
---|
72 | 558.
|
---|
73 | 559. def resolve(self, context, ignore_failures=False):
|
---|
74 | 560. try:
|
---|
75 | 561. obj = resolve_variable(self.var, context) ...
|
---|
76 | 562. except VariableDoesNotExist:
|
---|
77 | 563. if ignore_failures:
|
---|
78 | 564. obj = None
|
---|
79 | 565. else:
|
---|
80 | 566. if settings.TEMPLATE_STRING_IF_INVALID:
|
---|
81 | 567. return settings.TEMPLATE_STRING_IF_INVALID
|
---|
82 | ? Local vars
|
---|
83 | Variable Value
|
---|
84 | context
|
---|
85 | [{'object_list': [], 'params': {}}, {'LANGUAGES': (('ar', 'Arabic'), ('bn', 'Bengali'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fi', 'Finnish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'en-us'}, {}, {'perms': <django.core.context_processors.PermWrapper object at 0x01503A10>, 'messages': [], 'user': <django.contrib.auth.models.AnonymousUser object at 0x01503990>}, {}]
|
---|
86 | ignore_failures
|
---|
87 | False
|
---|
88 | self
|
---|
89 | <django.template.FilterExpression object at 0x01503C50>
|
---|
90 | * c:\checkout\dev_sandbox\django\django\template\__init__.py in resolve_variable
|
---|
91 | 639. elif path[0] in ('"', "'") and path[0] == path[-1]:
|
---|
92 | 640. current = path[1:-1]
|
---|
93 | 641. else:
|
---|
94 | 642. current = context
|
---|
95 | 643. bits = path.split(VARIABLE_ATTRIBUTE_SEPARATOR)
|
---|
96 | 644. while bits:
|
---|
97 | 645. try: # dictionary lookup
|
---|
98 | 646. current = current[bits[0]] ...
|
---|
99 | 647. except (TypeError, AttributeError, KeyError):
|
---|
100 | 648. try: # attribute lookup
|
---|
101 | 649. current = getattr(current, bits[0])
|
---|
102 | 650. if callable(current):
|
---|
103 | 651. if getattr(current, 'alters_data', False):
|
---|
104 | 652. current = settings.TEMPLATE_STRING_IF_INVALID
|
---|
105 | ? Local vars
|
---|
106 | Variable Value
|
---|
107 | bits
|
---|
108 | ['count']
|
---|
109 | context
|
---|
110 | [{'object_list': [], 'params': {}}, {'LANGUAGES': (('ar', 'Arabic'), ('bn', 'Bengali'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_AR', 'Argentinean Spanish'), ('fi', 'Finnish'), ('fr', 'French'), ('gl', 'Galician'), ('hu', 'Hungarian'), ('he', 'Hebrew'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('pl', 'Polish'), ('pt-br', 'Brazilian'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sr', 'Serbian'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'en-us'}, {}, {'perms': <django.core.context_processors.PermWrapper object at 0x01503A10>, 'messages': [], 'user': <django.contrib.auth.models.AnonymousUser object at 0x01503990>}, {}]
|
---|
111 | current
|
---|
112 | []
|
---|
113 | path
|
---|
114 | 'object_list.count'
|
---|
115 | * c:\checkout\dev_sandbox\django\django\db\models\query.py in __getitem__
|
---|
116 | 141.
|
---|
117 | 142. if k.step is None:
|
---|
118 | 143. return self._clone(_offset=offset, _limit=limit)
|
---|
119 | 144. else:
|
---|
120 | 145. return list(self._clone(_offset=offset, _limit=limit))[::k.step]
|
---|
121 | 146. else:
|
---|
122 | 147. try:
|
---|
123 | 148. return list(self._clone(_offset=k, _limit=1))[0] ...
|
---|
124 | 149. except self.model.DoesNotExist, e:
|
---|
125 | 150. raise IndexError, e.args
|
---|
126 | 151. else:
|
---|
127 | 152. return self._result_cache[k]
|
---|
128 | 153.
|
---|
129 | 154. def __and__(self, other):
|
---|
130 | ? Local vars
|
---|
131 | Variable Value
|
---|
132 | k
|
---|
133 | 'count'
|
---|
134 | self
|
---|
135 | []
|
---|
136 | * c:\checkout\dev_sandbox\django\django\db\models\query.py in __iter__
|
---|
137 | 100. def __repr__(self):
|
---|
138 | 101. return repr(self._get_data())
|
---|
139 | 102.
|
---|
140 | 103. def __len__(self):
|
---|
141 | 104. return len(self._get_data())
|
---|
142 | 105.
|
---|
143 | 106. def __iter__(self):
|
---|
144 | 107. return iter(self._get_data()) ...
|
---|
145 | 108.
|
---|
146 | 109. def __getitem__(self, k):
|
---|
147 | 110. "Retrieve an item or slice from the set of results."
|
---|
148 | 111. assert (not isinstance(k, slice) and (k >= 0)) \
|
---|
149 | 112. or (isinstance(k, slice) and (k.start is None or k.start >= 0) and (k.stop is None or k.stop >= 0)), \
|
---|
150 | 113. "Negative indexing is not supported."
|
---|
151 | ? Local vars
|
---|
152 | Variable Value
|
---|
153 | self
|
---|
154 | Error in formatting:no such column: count
|
---|
155 | * c:\checkout\dev_sandbox\django\django\db\models\query.py in _get_data
|
---|
156 | 448. if (self._order_by is not None and len(self._order_by) > 0) and \
|
---|
157 | 449. (combined._order_by is None or len(combined._order_by) == 0):
|
---|
158 | 450. combined._order_by = self._order_by
|
---|
159 | 451. return combined
|
---|
160 | 452.
|
---|
161 | 453. def _get_data(self):
|
---|
162 | 454. if self._result_cache is None:
|
---|
163 | 455. self._result_cache = list(self.iterator()) ...
|
---|
164 | 456. return self._result_cache
|
---|
165 | 457.
|
---|
166 | 458. def _get_sql_clause(self):
|
---|
167 | 459. opts = self.model._meta
|
---|
168 | 460.
|
---|
169 | 461. # Construct the fundamental parts of the query: SELECT X FROM Y WHERE Z.
|
---|
170 | ? Local vars
|
---|
171 | Variable Value
|
---|
172 | self
|
---|
173 | Error in formatting:no such column: count
|
---|
174 | * c:\checkout\dev_sandbox\django\django\db\models\query.py in iterator
|
---|
175 | 173. raise StopIteration
|
---|
176 | 174.
|
---|
177 | 175. # self._select is a dictionary, and dictionaries' key order is
|
---|
178 | 176. # undefined, so we convert it to a list of tuples.
|
---|
179 | 177. extra_select = self._select.items()
|
---|
180 | 178.
|
---|
181 | 179. cursor = connection.cursor()
|
---|
182 | 180. cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + ",".join(select) + sql, params) ...
|
---|
183 | 181. fill_cache = self._select_related
|
---|
184 | 182. index_end = len(self.model._meta.fields)
|
---|
185 | 183. while 1:
|
---|
186 | 184. rows = cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)
|
---|
187 | 185. if not rows:
|
---|
188 | 186. raise StopIteration
|
---|
189 | ? Local vars
|
---|
190 | Variable Value
|
---|
191 | cursor
|
---|
192 | <django.db.backends.util.CursorDebugWrapper object at 0x01503CB0>
|
---|
193 | extra_select
|
---|
194 | []
|
---|
195 | params
|
---|
196 | []
|
---|
197 | select
|
---|
198 | ['"testapp_article"."id"', '"testapp_article"."text"']
|
---|
199 | self
|
---|
200 | Error in formatting:no such column: count
|
---|
201 | sql
|
---|
202 | ' FROM "testapp_article" LIMIT 1 OFFSET count '
|
---|
203 | * c:\checkout\dev_sandbox\django\django\db\backends\util.py in execute
|
---|
204 | 5. def __init__(self, cursor, db):
|
---|
205 | 6. self.cursor = cursor
|
---|
206 | 7. self.db = db
|
---|
207 | 8.
|
---|
208 | 9. def execute(self, sql, params=()):
|
---|
209 | 10. start = time()
|
---|
210 | 11. try:
|
---|
211 | 12. return self.cursor.execute(sql, params) ...
|
---|
212 | 13. finally:
|
---|
213 | 14. stop = time()
|
---|
214 | 15. # If params was a list, convert it to a tuple, because string
|
---|
215 | 16. # formatting with '%' only works with tuples or dicts.
|
---|
216 | 17. if not isinstance(params, (tuple, dict)):
|
---|
217 | 18. params = tuple(params)
|
---|
218 | ? Local vars
|
---|
219 | Variable Value
|
---|
220 | params
|
---|
221 | ()
|
---|
222 | self
|
---|
223 | <django.db.backends.util.CursorDebugWrapper object at 0x01503CB0>
|
---|
224 | sql
|
---|
225 | 'SELECT "testapp_article"."id","testapp_article"."text" FROM "testapp_article" LIMIT 1 OFFSET count '
|
---|
226 | start
|
---|
227 | 1171920114.546
|
---|
228 | stop
|
---|
229 | 1171920114.546
|
---|
230 | * c:\checkout\dev_sandbox\django\django\db\backends\sqlite3\base.py in execute
|
---|
231 | 85. """
|
---|
232 | 86. Django uses "format" style placeholders, but pysqlite2 uses "qmark" style.
|
---|
233 | 87. This fixes it -- but note that if you want to use a literal "%s" in a query,
|
---|
234 | 88. you'll need to use "%%s".
|
---|
235 | 89. """
|
---|
236 | 90. def execute(self, query, params=()):
|
---|
237 | 91. query = self.convert_query(query, len(params))
|
---|
238 | 92. return Database.Cursor.execute(self, query, params) ...
|
---|
239 | 93.
|
---|
240 | 94. def executemany(self, query, param_list):
|
---|
241 | 95. query = self.convert_query(query, len(param_list[0]))
|
---|
242 | 96. return Database.Cursor.executemany(self, query, param_list)
|
---|
243 | 97.
|
---|
244 | 98. def convert_query(self, query, num_params):
|
---|
245 | ? Local vars
|
---|
246 | Variable Value
|
---|
247 | params
|
---|
248 | []
|
---|
249 | query
|
---|
250 | 'SELECT "testapp_article"."id","testapp_article"."text" FROM "testapp_article" LIMIT 1 OFFSET count '
|
---|
251 | self
|
---|
252 | <django.db.backends.sqlite3.base.SQLiteCursorWrapper object at
|
---|
253 | 0x015014F8>
|
---|