Commit 0133039d authored by Gladys Forte's avatar Gladys Forte

Merge pull request #710 in RMS/api-main-service from gladys-dev2 to product-dev

* commit '6b645403':
  page size set 100 branches viewset
  filter files for all dependent of branches endpoint
parents 2ed93b3c 6b645403
...@@ -6,3 +6,4 @@ class BranchSerializer(serializers.ModelSerializer): ...@@ -6,3 +6,4 @@ class BranchSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = Branch model = Branch
fields = '__all__' fields = '__all__'
...@@ -12,8 +12,9 @@ class BranchViewSet(viewsets.ModelViewSet): ...@@ -12,8 +12,9 @@ class BranchViewSet(viewsets.ModelViewSet):
serializer_class = BranchSerializer serializer_class = BranchSerializer
pagination_class = CustomPagination pagination_class = CustomPagination
lookup_field = 'id' lookup_field = 'id'
# http_method_names = ['get'] # pagination.PageNumberPagination.page_size = 100
pagination_class.page_size = 100
def list(self, request, *args, **kwargs): def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset()) queryset = self.filter_queryset(self.get_queryset())
......
...@@ -20,4 +20,4 @@ urlpatterns = [ ...@@ -20,4 +20,4 @@ urlpatterns = [
path('', include(router.urls)), path('', include(router.urls)),
url(r'^user-types/$', UserTypeViewSet.as_view(), name="user-types"), url(r'^user-types/$', UserTypeViewSet.as_view(), name="user-types"),
url(r'^dashboard/$', RMSDashBoardViewSet.as_view(), name="dashboard"), url(r'^dashboard/$', RMSDashBoardViewSet.as_view(), name="dashboard"),
] ]
\ No newline at end of file
...@@ -25,3 +25,4 @@ class Migration(migrations.Migration): ...@@ -25,3 +25,4 @@ class Migration(migrations.Migration):
}, },
), ),
] ]
...@@ -1276,6 +1276,7 @@ class ChangeRequestSettings(models.Model): ...@@ -1276,6 +1276,7 @@ class ChangeRequestSettings(models.Model):
# branches info # branches info
class Branch(models.Model): class Branch(models.Model):
enviroment = models.CharField( enviroment = models.CharField(
max_length=255) max_length=255)
...@@ -1291,6 +1292,6 @@ class Branch(models.Model): ...@@ -1291,6 +1292,6 @@ class Branch(models.Model):
class Meta: class Meta:
db_table = 'branches' db_table = 'branches'
def __str__(self): def __str__(self):
return f'{self.branch_name}' return f'{self.branch_name}'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment