carltongibson / neapolitan

Quick CRUD views for Django
https://noumenal.es/neapolitan/
MIT License
502 stars 35 forks source link

Add support for generic arguments to `CRUDView.get_paginate_by` #55

Closed joshuadavidthomas closed 3 months ago

joshuadavidthomas commented 3 months ago

I've been bending myself backwards trying to get neapolitan and django-tables2 to play nice together using django_tables2.views.SingleTableMixin.

The core issue between the two is django-tables2 passes an argument to get_paginate_by, similar to django.views.generic.list.ListView. The problem is neapolitan.views.CRUDView.get_paginate_by does not take any arguments, nor is it able to via *args or **kwargs in the function's definition.

Are you open to adding *args, **kwargs to get_paginate_by?

References: https://github.com/django/django/blob/9f5e2306e22f9c7577f7af88135f12b496fce237/django/views/generic/list.py#L81 https://github.com/jieter/django-tables2/blob/34f92e9a582357cb08e87b17cad66b46ab1e1620/django_tables2/views.py#L64

carltongibson commented 3 months ago

Probably, yes 😅 wanna sketch up a minimal change with some example tests, and we'll have a look?

joshuadavidthomas commented 3 months ago

Ended up going a different direction, so I no longer have this issue! Sorry for gumming up the repo's issue tracker, but thanks for this library and everything you do for the broader Django community. 🎉😄