Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2014-08-19 10:05:38.275515)
- Working directory: /opt/noc
- <class 'mongoengine.queryset.InvalidQueryError'>
- Cannot resolve field "is_builtin"
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 639)
- Function: _lookup_field
- 632 if field_name in document._fields:
- 633 field = document._fields[field_name]
- 634 elif document._dynamic:
- 635 from fields import DynamicField
- 636 field = DynamicField(db_field=field_name)
- 637 else:
- 638 raise InvalidQueryError('Cannot resolve field "%s"'
- 639 ==> % field_name)
- 640 else:
- 641 from mongoengine.fields import ReferenceField, GenericReferenceField
- 642 if isinstance(field, (ReferenceField, GenericReferenceField)):
- 643 raise InvalidQueryError('Cannot perform join in mongoDB: %s' % '__'.join(parts))
- 644 if hasattr(getattr(field, 'field', None), 'lookup_member'):
- 645 new_field = field.field.lookup_member(field_name)
- Variables:
- fields = []
- field = None
- parts = ['is_builtin']
- document = <class 'noc.fm.models.alarmclass.AlarmClass'>
- field_name = 'is_builtin'
- cls = <class 'mongoengine.queryset.QuerySet'>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 701)
- Function: _transform_query
- 694 negate = False
- 695 if parts[-1] == 'not':
- 696 parts.pop()
- 697 negate = True
- 698
- 699 if _doc_cls:
- 700 # Switch field names to proper names [set in Field(name='foo')]
- 701 ==> fields = QuerySet._lookup_field(_doc_cls, parts)
- 702 parts = []
- 703
- 704 cleaned_fields = []
- 705 for field in fields:
- 706 append_field = True
- 707 if isinstance(field, basestring):
- Variables:
- mongo_query = {}
- _field_operation = False
- geo_operators =
- ['within_distance',
- 'within_spherical_distance',
- 'within_box',
- 'within_polygon',
- 'near',
- 'near_sphere']
- match_operators =
- ['contains',
- 'icontains',
- 'startswith',
- 'istartswith',
- 'endswith',
- 'iendswith',
- 'exact',
- 'iexact']
- p = 'is_builtin'
- i = 0
- operators =
- ['ne',
- 'gt',
- 'gte',
- 'lt',
- 'lte',
- 'in',
- 'nin',
- 'mod',
- 'all',
- 'size',
- 'exists',
- 'not']
- parts = ['is_builtin']
- value = True
- indices = []
- _doc_cls = <class 'noc.fm.models.alarmclass.AlarmClass'>
- part = 'is_builtin'
- cls = <class 'mongoengine.queryset.QuerySet'>
- key = 'is_builtin'
- negate = False
- query = {'is_builtin': True}
- custom_operators = ['match']
- op = None
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 162)
- Function: visit_query
- 155 if combination.operation == combination.OR:
- 156 return {'$or': combination.children}
- 157 elif combination.operation == combination.AND:
- 158 return self._mongo_query_conjunction(combination.children)
- 159 return combination
- 160
- 161 def visit_query(self, query):
- 162 ==> return QuerySet._transform_query(self.document, **query.query)
- 163
- 164 def _mongo_query_conjunction(self, queries):
- 165 """Merges Mongo query dicts - effectively &ing them together.
- 166 """
- 167 combined_query = {}
- 168 for query in queries:
- Variables:
- query = <mongoengine.queryset.Q object at 0x681fd90>
- self = <mongoengine.queryset.QueryCompilerVisitor object at 0x681fe10>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 270)
- Function: accept
- 263 query structures.
- 264 """
- 265
- 266 def __init__(self, **query):
- 267 self.query = query
- 268
- 269 def accept(self, visitor):
- 270 ==> return visitor.visit_query(self)
- 271
- 272 @property
- 273 def empty(self):
- 274 return not bool(self.query)
- 275
- 276
- Variables:
- visitor = <mongoengine.queryset.QueryCompilerVisitor object at 0x681fe10>
- self = <mongoengine.queryset.Q object at 0x681fd90>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 205)
- Function: to_query
- 198
- 199 AND = 0
- 200 OR = 1
- 201
- 202 def to_query(self, document):
- 203 query = self.accept(SimplificationVisitor())
- 204 query = query.accept(QueryTreeTransformerVisitor())
- 205 ==> query = query.accept(QueryCompilerVisitor(document))
- 206 return query
- 207
- 208 def accept(self, visitor):
- 209 raise NotImplementedError
- 210
- 211 def _combine(self, other, operation):
- Variables:
- query = <mongoengine.queryset.Q object at 0x681fd90>
- self = <mongoengine.queryset.Q object at 0x681fd90>
- document = <class 'noc.fm.models.alarmclass.AlarmClass'>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 379)
- Function: _query
- 372 setattr(c, prop, copy.deepcopy(val))
- 373
- 374 return c
- 375
- 376 @property
- 377 def _query(self):
- 378 if self._mongo_query is None:
- 379 ==> self._mongo_query = self._query_obj.to_query(self._document)
- 380 if self._class_check:
- 381 self._mongo_query.update(self._initial_query)
- 382 return self._mongo_query
- 383
- 384 def ensure_index(self, key_or_list, drop_dups=False, background=False,
- 385 **kwargs):
- Variables:
- self = repr() failed
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 583)
- Function: _cursor
- 576 cursor_args['fields'] = self._loaded_fields.as_dict()
- 577 return cursor_args
- 578
- 579 @property
- 580 def _cursor(self):
- 581 if self._cursor_obj is None:
- 582
- 583 ==> self._cursor_obj = self._collection.find(self._query,
- 584 **self._cursor_args)
- 585 # Apply where clauses to cursor
- 586 if self._where_clause:
- 587 self._cursor_obj.where(self._where_clause)
- 588
- 589 # apply default ordering
- Variables:
- self = .. queryset mid-iteration ..
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 997)
- Function: count
- 990 self._cursor.rewind()
- 991
- 992 def count(self):
- 993 """Count the selected elements in the query.
- 994 """
- 995 if self._limit == 0:
- 996 return 0
- 997 ==> return self._cursor.count(with_limit_and_skip=True)
- 998
- 999 def __len__(self):
- 1000 return self.count()
- 1001
- 1002 def map_reduce(self, map_f, reduce_f, output, finalize_f=None, limit=None,
- 1003 scope=None):
- Variables:
- self = .. queryset mid-iteration ..
- ------------------------------------------------------------------------
- File: /opt/noc/fm/apps/reportrulesetsummary/views.py (Line: 20)
- Function: get_count
- 13
- 14 class ReportRulesetSummary(SimpleReport):
- 15 title = "Ruleset Summary"
- 16
- 17 def get_data(self, **kwargs):
- 18 def get_count(m):
- 19 total = m.objects.count()
- 20 ==> builtin = m.objects.filter(is_builtin=True).count()
- 21 local = total - builtin
- 22 return [builtin, local, total]
- 23
- 24 data = [
- 25 ["Alarm Classes"] + get_count(AlarmClass),
- 26 ["Event Classies"] + get_count(EventClass),
- Variables:
- total = 111
- m = <class 'noc.fm.models.alarmclass.AlarmClass'>
- ------------------------------------------------------------------------
- File: /opt/noc/fm/apps/reportrulesetsummary/views.py (Line: 25)
- Function: get_data
- 18 def get_count(m):
- 19 total = m.objects.count()
- 20 builtin = m.objects.filter(is_builtin=True).count()
- 21 local = total - builtin
- 22 return [builtin, local, total]
- 23
- 24 data = [
- 25 ==> ["Alarm Classes"] + get_count(AlarmClass),
- 26 ["Event Classies"] + get_count(EventClass),
- 27 ["Classification Rules"] + get_count(EventClassificationRule)
- 28 ]
- 29
- 30 return self.from_dataset(title=self.title,
- 31 columns=["",
- Variables:
- get_count = <function get_count at 0x667c230>
- self =
- <noc.fm.apps.reportrulesetsummary.views.ReportRulesetSummary object at 0x60b85d0>
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/simplereport.py (Line: 635)
- Function: report_html
- 628 """
- 629 return Report()
- 630
- 631 def report_html(self, **kwargs):
- 632 """
- 633 Render HTML
- 634 """
- 635 ==> return self.get_data(**kwargs).to_html()
- 636
- 637 def report_csv(self, **kwargs):
- 638 """
- 639 Render CSV
- 640 """
- 641 return self.get_data(**kwargs).to_csv()
- Variables:
- self =
- <noc.fm.apps.reportrulesetsummary.views.ReportRulesetSummary object at 0x60b85d0>
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/reportapplication.py (Line: 81)
- Function: view_report
- 74 else:
- 75 form = form_class()
- 76 # No POST or error - render form
- 77 if not query:
- 78 return self.render(request, "report_form.html",
- 79 form=form, app=self, is_report=True)
- 80 # Build result
- 81 ==> rdata = getattr(self, "report_%s" % format)(**query)
- 82 # Render result
- 83 if format == "html":
- 84 return self.render(request, "report.html",
- 85 data=rdata, app=self, is_report=True)
- 86 else:
- 87 return self.render_response(rdata,
- Variables:
- query = {}
- self =
- <noc.fm.apps.reportrulesetsummary.views.ReportRulesetSummary object at 0x60b85d0>
- request =
- <WSGIRequest
- path:/fm/reportrulesetsummary/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': 'itfUJgzKyDtYuTD8T2KaQUMfzuLQzMk1',
- 'sessionid': '90caf5ab9e145adcafbe3b624d91e1b0'},
- META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,lzma,sdch',
- 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=90caf5ab9e145adcafbe3b624d91e1b0; csrftoken=itfUJgzKyDtYuTD8T2KaQUMfzuLQzMk1',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_REFERER': 'http://192.168.192.145/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 OPR/23.0.1522.75',
- 'PATH_INFO': u'/fm/reportrulesetsummary/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'GET',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '127.0.0.1',
- 'SERVER_PORT': '8000',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x321adb0>,
- 'wsgi.input': <_io.BytesIO object at 0x6747dd0>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- form_class = None
- format = 'html'
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/site.py (Line: 233)
- Function: inner
- 226 for k, v in request.POST.lists())
- 227 elif request.method == "GET":
- 228 a = dict((k, v[0] if len(v) == 1 else v)
- 229 for k, v in request.GET.lists())
- 230 logging.debug("API %s %s %s" % (request.method,
- 231 request.path, a))
- 232 # Call handler
- 233 ==> r = v(request, *args, **kwargs)
- 234 # Dump SQL statements
- 235 if self.log_sql_statements:
- 236 from django.db import connections
- 237 tsc = 0
- 238 sc = defaultdict(int)
- 239 for conn in connections.all():
- Variables:
- args = ()
- view_map =
- {'DELETE': <bound method ReportRulesetSummary.view_report of <noc.fm.apps.reportrulesetsummary.views.ReportRulesetSummary object at 0x60b85d0>>,
- 'GET': <bound method ReportRulesetSummary.view_report of <noc.fm.apps.reportrulesetsummary.views.ReportRulesetSummary object at 0x60b85d0>>,
- 'POST': <bound method ReportRulesetSummary.view_report of <noc.fm.apps.reportrulesetsummary.views.ReportRulesetSummary object at 0x60b85d0>>,
- 'PUT': <bound method ReportRulesetSummary.view_report of <noc.fm.apps.reportrulesetsummary.views.ReportRulesetSummary object at 0x60b85d0>>}
- Form = <class 'django.forms.forms.Form'>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- self = <noc.lib.app.site.Site object at 0x3c73e10>
- v =
- <bound method ReportRulesetSummary.view_report of <noc.fm.apps.reportrulesetsummary.views.ReportRulesetSummary object at 0x60b85d0>>
- request =
- <WSGIRequest
- path:/fm/reportrulesetsummary/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': 'itfUJgzKyDtYuTD8T2KaQUMfzuLQzMk1',
- 'sessionid': '90caf5ab9e145adcafbe3b624d91e1b0'},
- META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,lzma,sdch',
- 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.8',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=90caf5ab9e145adcafbe3b624d91e1b0; csrftoken=itfUJgzKyDtYuTD8T2KaQUMfzuLQzMk1',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_REFERER': 'http://192.168.192.145/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36 OPR/23.0.1522.75',
- 'PATH_INFO': u'/fm/reportrulesetsummary/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'GET',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': '127.0.0.1',
- 'SERVER_PORT': '8000',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x321adb0>,
- 'wsgi.input': <_io.BytesIO object at 0x6747dd0>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- to_log_api_call = False
- InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
- kwargs = {}
- app =
- <noc.fm.apps.reportrulesetsummary.views.ReportRulesetSummary object at 0x60b85d0>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement