MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / _is_django_render_call

Function _is_django_render_call

pydevd_plugins/django_debug.py:181–208  ·  view source on GitHub ↗
(frame)

Source from the content-addressed store, hash-verified

179
180
181def _is_django_render_call(frame):
182 try:
183 name = frame.f_code.co_name
184 if name != "render":
185 return False
186
187 if "self" not in frame.f_locals:
188 return False
189
190 cls = frame.f_locals["self"].__class__
191
192 inherits_node = _inherits(cls, "Node")
193
194 if not inherits_node:
195 return False
196
197 clsname = cls.__name__
198 if IS_DJANGO19:
199 # in Django 1.9 we need to save the flag that there is included template
200 if clsname == "IncludeNode":
201 if "context" in frame.f_locals:
202 context = frame.f_locals["context"]
203 context._has_included_template = True
204
205 return clsname not in _IGNORE_RENDER_OF_CLASSES
206 except:
207 pydev_log.exception()
208 return False
209
210
211def _is_django_context_get_call(frame):

Callers 5

can_skipFunction · 0.85
cmd_step_intoFunction · 0.85
cmd_step_overFunction · 0.85
get_breakpointFunction · 0.85

Calls 2

_inheritsFunction · 0.85
exceptionMethod · 0.80

Tested by

no test coverage detected