Thanks for pointing that out. I just browsed to the object_list() source, and it's nice to see a lot of the pagination stuffs abstracted out, it indeed helped me to appreciate it more. :)
On Mar 28, 4:50 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Mar 28, 2008 at 6:40 PM, bob <[EMAIL PROTECTED]> wrote: > > in some examples that require extra work, we have to define a wrapper > > function. What's confusing me is how is this different from just > > defining regular views? I can't quite notice much reduction in code, > > nor improvements in reusability. Can anyone please help to point out > > what I'm missing? > > Typically, so long as the additional requirements are not terribly > complex, it is a significant code saving; the 'object_list' generic > view, for example, is just under 100 lines of code, while in many > cases a wrapper function which uses it is only a half-dozen lines (if > that). That's better than a 90% reduction in the amount of code you > have to write yourself, so it's a useful pattern. > > Of course, if you need to add in more complex functionality, the > saving naturally decreases to the point where using nothing but your > own code makes sense. > > -- > "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---