python - What's wrong with this dict comprehension including django objects (SyntaxError: invalid syntax)? -
here django:
def get_temp_data(nid = none,qid = none,data = none): core_apps.models import temps temp_data = temps.objects.all() if nid != none: temp_data = temp_data.filter(nid=nid) if qid != none: temp_data = temp_data.filter(qid=qid) if data != none: temp_data = temp_data.filter(data__gte=data) temp_data.order_by('id_field') return temp_data
here dict comprehension including or mapper objects above function:
record_for_nid = {obj.qid: obj.data obj in get_temp_data(nid, none, none) if obj.data != 0.0}
record_for_nid
runs fine on regular situation not on crontab. little suspicion sublime text error checker picks error on "for" in list comprehension. what's wrong code? , how fix it?
Comments
Post a Comment