--- a/rset.py Fri Jun 04 11:09:55 2010 +0200
+++ b/rset.py Fri Jun 04 13:07:07 2010 +0200
@@ -600,7 +600,11 @@
if rel is not None:
index = rel.children[0].root_selection_index()
if index is not None and self.rows[row][index]:
- return self.get_entity(row, index), rel.r_type
+ try:
+ entity = self.get_entity(row, index)
+ return entity, rel.r_type
+ except NotAnEntity, exc:
+ return None, None
return None, None
@cached
--- a/test/unittest_rset.py Fri Jun 04 11:09:55 2010 +0200
+++ b/test/unittest_rset.py Fri Jun 04 13:07:07 2010 +0200
@@ -397,5 +397,9 @@
'(Any X,N WHERE X is CWGroup, X name N)'
')')
+ def test_count_users_by_date(self):
+ rset = self.execute('Any D, COUNT(U) GROUPBY D WHERE U is CWUser, U creation_date D')
+ self.assertEquals(rset.related_entity(0,0), (None, None))
+
if __name__ == '__main__':
unittest_main()