On 12/31/06 12:33 PM, ringemup wrote:
I'm working on a fairly data-heavy (as opposed to content-heavy) application, and I'm trying to create some reusable code for sortable HTML tables
^^^^^^^^^^^
...
Or does this belong somewhere else entirely (like a specialized method for each view)?
Yup, you nailed it on the head right there. As soon as you start thinking "HTML" (or "XML", or "PDF", or "my boss wants more blue..."), that's a big hint you've moved out of the realm on the model and into that of your view (or possibly the template itself).
Your model shouldn't know anything about how it's going to be displayed, nor should it care about which fields an HTML table is going to display.
So, yeah, put it in the view -- you'll be *much* happier in the long run, trust me :)
Jacob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---