baverman/supplement — Issue #17: AttributeError: 'DynScope' object has no attribute 'function'
Author: baverman
Created: 2012-02-28 10:33:17+00:00
State: open

from django.forms import forms

from sms.models import EDITABLE_TEMPLATES

class TemplateEditForm(forms.Form):
def __init__(self, *args, **kwargs):
super(TemplateEditForm, self).__init__(*args, **kwargs)

for name, verbose in EDITABLE_TEMPLATES:
for ftype in ('sms', 'email'):
self.fields['{}_{}'.format(ftype, name)] = forms.|

def app_index(request):
return {'form': TemplateEditForm()}
------------------------------------
Scope - BaseForm.__init__ - /home/bobrov/.virtualenvs/logibox/lib/python2.7/site-packages/django/forms/forms.py
{'col_offset': 22, 'starargs': None, 'args': [<_ast.Attribute object at 0x97d69ec>], 'lineno': 92, 'func': <_ast.Name object at 0x97d6acc>, 'kwargs': None, 'keywords': [], '_evaluating': True}
{'ctx': <_ast.Load object at 0xb6fe384c>, 'id': 'deepcopy', 'col_offset': 22, 'lineno': 92}
{}
{'col_offset': 31, 'ctx': <_ast.Load object at 0xb6fe384c>, 'attr': 'base_fields', 'value': <_ast.Name object at 0x97d6a4c>, 'lineno': 92}
{'ctx': <_ast.Load object at 0xb6fe384c>, 'id': 'self', 'col_offset': 31, 'lineno': 92}
{}
{}
>>>>>>>>>>
File "/usr/lib/python2.7/site-packages/supplement/evaluator.py", line 147, in visit_Call
self.push(func.op_call(args))
File "/usr/lib/python2.7/site-packages/supplement/common.py", line 57, in op_call
return self.get_object().op_call(args)
File "/usr/lib/python2.7/site-packages/supplement/objects.py", line 73, in op_call
return scope.function.op_call(args)
AttributeError: 'DynScope' object has no attribute 'function'