Пример #1
0
 def get_queryset(self):
     queryset = model_access.get_all_profiles()
     role = self.request.query_params.get("role", None)
     if role:
         queryset = model_access.get_profiles_by_role(role)
     # support starts-with matching for finding users in the
     # Submit/Edit Listing form
     username_starts_with = self.request.query_params.get("username_starts_with", None)
     if username_starts_with:
         queryset = model_access.filter_queryset_by_username_starts_with(queryset, username_starts_with)
     return queryset
Пример #2
0
 def get_queryset(self):
     role = self.request.query_params.get('role', None)
     if role:
         queryset = model_access.get_profiles_by_role(role)
     else:
         queryset = model_access.get_all_profiles()
     # support starts-with matching for finding users in the
     # Submit/Edit Listing form
     username_starts_with = self.request.query_params.get(
         'username_starts_with', None)
     if username_starts_with:
         queryset = model_access.filter_queryset_by_username_starts_with(
             queryset, username_starts_with)
     return queryset