Deleting a record in GAE (gql.py) fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
web2py-wiki |
New
|
Undecided
|
Unassigned |
Bug Description
In GAE (inside the SDK) calling this:
db(db[data_
results in a tracback, ultimately with an issue here:
gluon/contrib/
counter = items.count()
TypeError: count() takes exactly one argument (0 given)
Seems that items is a list, and the count method of a list takes a value to count inside the list, i.e. it's not counting the items in the list.
Just wondering whether the following code was intended (at least it doesn't fail :-) ), file gluon/contrib/
def count(self):
(items, tablename, fields) = self._select()
return len(items) # original = >return items.count()
def delete(self):
(items, tablename, fields) = self._select()
tableobj = self._db[
counter = self.count() # original => items.count()
return counter - self.count() # original => items.count()
But I haven't studied the code in depth, so hopefully the gql.py maintaner can confirm whether these are just some typos as I expect or that there is a deeper issue.
Paulus