[Schevo-devel] Iterable extents?

Matthew Scott mscott at goldenspud.com
Tue Dec 13 08:43:01 EST 2005


Schevo 2's extents had this method.  I can't recall exactly why we
didn't put it in Schevo 3.  I don't particularly see a problem with
doing so, but I'll let Pat chime in when he has a chance to see if he
can remember the reasoning, if there is any.

It might have just been a decision early on when Schevo 3 was still
the "rebel" branch -- since it was a complete rewrite of Schevo, we
took the YAGNI approach to quite an extreme in an effort to keep the
code as small as possible.

You are right though, those little touches help, and we are fond of
removing keystrokes wherever it makes sense to do so :)

A minor detail -- find() is a lower-level query API now that queries
are in place.  So the question becomes, do we make iter(db.Person) an
alias for iter(db.Person.find()), or do we make it an alias for
iter(db.Person.q.default())?    The latter would mean that if the
default query was specialized, iter(db.Person) would not necessarily
return all the entities in db.Person.

I'm leaning toward the former myself, since iterating over an extent
like this is something that you would do when writing code -- any
auto-generated UI would probably already have a Query instance in the
first place and would likely not use iter(db.Person) directly.


On 12/13/05, Tom Locke <tom at livelogix.com> wrote:
> Hi
>
> How about adding an __iter__ method to extents, so one can do:
>
>   for x in db.Person:
>
> As a synonym for:
>
>   for x in db.Person.find():
>
> It's all in the little touches y'know :-)
>
> Tom.
>
> _______________________________________________
> Schevo-devel mailing list
> Schevo-devel at lists.orbtech.com
> http://lists.orbtech.com/mailman/listinfo/schevo-devel
>


--
Matthew R. Scott



More information about the Schevo-devel mailing list