|
|
|
|
@ -66,11 +66,13 @@ class RealtyViewSet(ModelViewSet): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SpecializationViewSet(ModelViewSet): |
|
|
|
|
queryset = Specialization.objects.root_nodes()[0].get_descendants() |
|
|
|
|
# queryset = Specialization.objects # Migrate with this enabled |
|
|
|
|
try: # TODO: dirty |
|
|
|
|
queryset = Specialization.objects.root_nodes()[0].get_descendants() |
|
|
|
|
except: |
|
|
|
|
queryset = Specialization.objects |
|
|
|
|
serializer_class = SpecializationSerializer |
|
|
|
|
filter_class = SpecializationFilterSet |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UserViewSet(ModelViewSet): |
|
|
|
|
queryset = User.objects.all() |
|
|
|
|
@ -79,7 +81,9 @@ class UserViewSet(ModelViewSet): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LocationViewSet(ModelViewSet): |
|
|
|
|
queryset = Location.objects.root_nodes()[0].get_descendants() |
|
|
|
|
# queryset = Location.objects # Migrate with this enabled |
|
|
|
|
try: # TODO: dirty |
|
|
|
|
queryset = Location.objects.root_nodes()[0].get_descendants() |
|
|
|
|
except: |
|
|
|
|
queryset = Location.objects |
|
|
|
|
serializer_class = LocationSerializer |
|
|
|
|
filter_class = LocationFilterSet |
|
|
|
|
|