def get_ea_data(self): if self.level or not self.selected_location: return if self.selected_type_is_second_lowest(): return EnumerationArea.under_(self.selected_location) if self.selected_ea: return self.selected_ea.get_siblings()
def get_ea_data(self): if not self.level or not self.selected_location: return if self.selected_type_is_second_lowest(): return EnumerationArea.under_(self.selected_location) if self.selected_ea: return self.selected_ea.get_siblings()
def enumeration_areas(request, location_id): location = Location.objects.get(id=location_id) eas = EnumerationArea.under_(location).values('id', 'name').order_by('name') json_dump = json.dumps(list(eas), cls=DjangoJSONEncoder) return HttpResponse(json_dump, mimetype='application/json')
def enumeration_areas(request, location_id): location = Location.objects.get(id=location_id) eas = EnumerationArea.under_(location).values('id', 'name').order_by('name') json_dump = json.dumps(list(eas), cls=DjangoJSONEncoder) return HttpResponse(json_dump, content_type='application/json')