示例#1
0
 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()
示例#2
0
 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()
示例#3
0
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')
示例#4
0
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')