Waldemar Kornewald committed 3820972


Comments (0)

Files changed (1)

         pks_only = False
         if len(fields) == 1 and fields[0].primary_key:
             pks_only = True
-        self.gae_query = Query(self.db_table, keys_only=pks_only)
+        db_table = self.query.get_meta().db_table
+        self.gae_query = Query(db_table, keys_only=pks_only)
     # This is needed for debugging
     def __repr__(self):
     def fetch(self):
         query = self.gae_query
         if self.pk_filters:
-            results = self.get_matching_pk(self.pk_filters)
+            results = self.get_matching_pk()
             low_mark, high_mark = self.limits
             if high_mark is None:
             yield self._make_entity(entity, self.fields)
-    def count(self, limit):
+    def count(self, limit=None):
         if self.pk_filters:
-            return len(self.get_matching_pk(self.pk_filters))
+            return len(self.get_matching_pk())
         return self.gae_query.Count(limit)
         entity[self.query.get_meta().pk.column] = key
         return entity
-    def get_matching_pk(self, pk_filters):
-        pk_filters = [key for key in pk_filters if key is not None]
+    def get_matching_pk(self):
+        pk_filters = [key for key in self.pk_filters if key is not None]
         if not pk_filters:
             return []
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.