set pagination message - V2
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.0 on 2025-09-03 11:01
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('product', '0071_quotaincentiveassignment_livestock_type_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='quota',
|
||||
name='base_price_cooperative',
|
||||
field=models.PositiveBigIntegerField(default=0),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='quota',
|
||||
name='base_price_factory',
|
||||
field=models.PositiveBigIntegerField(default=0),
|
||||
),
|
||||
]
|
||||
@@ -75,8 +75,10 @@ class InventoryEntryViewSet(viewsets.ModelViewSet, DynamicSearchMixin, POSDevice
|
||||
if page is not None:
|
||||
serializer = self.get_serializer(page, many=True, context={'rancher': rancher.first(), 'device': device})
|
||||
# set custom message for paginator
|
||||
if not available_entries:
|
||||
if not rancher:
|
||||
self.paginator.set_message("دامدار با کد ملی مد نظر یافت نشد") # noqa
|
||||
elif not available_entries:
|
||||
self.paginator.set_message("دامدار با کد ملی مد نظر سهمیه ایی ندارد") # noqa
|
||||
return self.get_paginated_response(serializer.data)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user