pagination #6

Merged
cayop merged 3 commits from pagination into main 2024-10-02 10:53:20 +00:00
1 changed files with 2 additions and 1 deletions
Showing only changes of commit 6399739228 - Show all commits

View File

@ -33,4 +33,5 @@ class LotDashboardView(InventaryMixin, DetailsMixin):
def get_devices(self, user, offset, limit):
chids = self.object.devicelot_set.all().values_list("device_id", flat=True).distinct()
return [Device(id=x) for x in chids], chids.count()
chids_page = chids[offset:offset+limit]
return [Device(id=x) for x in chids_page], chids.count()