Пример #1
0
class MetaTermsViewSet(mixins.ListModelMixin, viewsets.GenericViewSet):
    """
    List all the Meta Terms
    """
    queryset = MetaTerm.get_root_nodes()
    serializer_class = MetaTermsSerializer
    permission_classes = (
        permissions.IsAuthenticated,
        IsApplyStaffUser,
    )
Пример #2
0
 def __init__(self, *args, **kwargs):
     kwargs.pop('user')
     super().__init__(*args, **kwargs)
     self.fields['meta_terms'].queryset = MetaTerm.get_root_descendants(
     ).exclude(depth=2)