This definitely makes sense, I have made a view called
`books_by_author` - this made it easy for me to fit the logic into my
feeble mind, and moreover it looks good in the URLconfs. Thanks a lot
for suggestions!

On Feb 8, 7:57 pm, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]>
wrote:
> On 2/8/08, coldpizza <[EMAIL PROTECTED]> wrote:
>
> > And other related question: where it would be more logically correct
> > to put this code? In URLConf as an parameter for the view, in a view
> > of its own, or in a method bound to the Book model?
>
> I wouldn't put it in a URLconf. URLconfs are supposed to be
> "configuration", so putting logic there seems dirty (to me). From
> there, though, it's a bit of a matter of taste: do you consider "books
> by an author" to be model logic, or view logic?
>
> For me, I'm usually guided by how I'll be using the query in question:
> if it's designed to be accessed from non-view areas (template tags,
> CLI scripts, etc.) I'll put it on the model, but if that particular
> query is only used in some specific view, I'll leave it in the view.
> Again, though, it's a matter of taste.
>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to