On 12/14/05, Robert Wittams <[EMAIL PROTECTED]> wrote:

[ p1.article_set.order_by('headline') ]

> Is your confusion between set the verb and set the noun ? I don't really
> know how to fix that without refactoring the English language.  I don't
> know what else could be done here - pluralisation is a no no, etc etc.
> If you can come up with a better automatic name than <whatever>_set, let
> me know.

Rereading it after a night's rest it seems to make more sense to me now.

> for article in reporter.article_set:
>     # whatever
>
> or
>
> articles = reporter.article_set.order_by('headline')
> a = articles[10]
>
> Neither of the first two statements above will access anything from the
> db until you ask them to. Really, it all works the same way.

Given how for constructs now get written this seems friendlier than
the previous way.
So disregard my previous comments.

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
Free Tibet! http://www.savetibet.org/ | Je maintiendrai!
http://www.in-nomine.org/ | [EMAIL PROTECTED]
Whenever you meet difficult situations dash forward bravely and joyfully...

Reply via email to