Hi Robert, sounds good to me in general, just a few thoughts:
>I'd like to refactor several things about it that would have made it more >abstract and easier for me, but still keep it backwards compatible: > > - rename bottom and top variables, instead self.first and self.last > respectively > - turn their inline calculations into function calls to a new, > self.first() and self.last() I don't really care if the variables are called top/bottom or first/last, but I don't think naming the methods first() and last(), ORM style, is a good idea, especially since those methods would return only integers to slice `self.object_list` with. `_get_page_slice(number)` (or similar) might be more readable. > - move the entire self.object_list[bottom:top] into its own line > - move that specific logic into a function called self.get_page_objects I'm not really sure that *both* a method to get the page objects and a method to calculate the start/end values are necessary (I fail to see a use case), but I guess it won't hurt either. > - store that function's value into self.page_objects Could you expand on that? Since a superset of those objects is already stored in `self.object_list`, it might be less redundant to just store the slice object/the top/bottom values instead. Best Tobias -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/20170410110919.iqck7vihiuor4od7%40octorobot. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: PGP signature