Re: Add distinct/group_by support to ndb (issue 7865043)

39 views
Skip to first unread message

gvanr...@gmail.com

unread,
Mar 21, 2013, 8:05:33 PM3/21/13
to arfu...@google.com, faction...@gmail.com, appengine-...@googlegroups.com, re...@codereview-hr.appspotmail.com

https://codereview.appspot.com/7865043/diff/3001/ndb/model.py
File ndb/model.py (right):

https://codereview.appspot.com/7865043/diff/3001/ndb/model.py#newcode2678
ndb/model.py:2678: def __init__(self, *args, **kwds):
I wouldn't recommend this. While the original code looks truly weird
(and probably fails a lint check), the regular style means you can't
have a property named 'self'. (Or at least you can't initialize it by
calling MyModel(self=42).)

https://codereview.appspot.com/7865043/diff/3001/ndb/model.py#newcode3170
ndb/model.py:3170: if 'group_bys' in kwds:
I really don't like the name 'group_bys'. I notice that some internal
APIs use 'group_by' -- I would recommend using that everywhere.

https://codereview.appspot.com/7865043/diff/3001/ndb/query.py
File ndb/query.py (right):

https://codereview.appspot.com/7865043/diff/3001/ndb/query.py#newcode780
ndb/query.py:780: group_bys: Optional list or tuple of properties to
group by.
group_by.

https://codereview.appspot.com/7865043/diff/3001/ndb/query.py#newcode1384
ndb/query.py:1384: # Populate projection if it hasn't been overriden
Period.

https://codereview.appspot.com/7865043/
Reply all
Reply to author
Forward
0 new messages