Beispiel #1
0
    def __init__(self, *args, **kwargs):
        door_id = kwargs.pop('door_id', None)
        super(PlaceDetachForm, self).__init__(*args, **kwargs)

        if door_id:
            self.fields['door_id'].initial = door_id
            places = DoorService.get_attached_places(id=door_id)
            self.fields['places'].queryset = places
        self.fields['places'].empty_label = None
Beispiel #2
0
 def get_queryset(self):
     try:
         return DoorService.get_attached_places(id=self.kwargs[ID])
     except:
         raise Http404