Hi Drew and all,
I saw the same exact problem Drew saw with *defaultdict(list)*. For the
benefit of any future debuggers, I thought I'd document what went wrong in
our case.
One of the functions in the controller was inappropriately named *list()*,
thus overriding the definition of *list()* it
After taking a break and working on another section, I finally found what
was causing the issue. There was, indeed, an error elsewhere within that
controller, which was causing me all the headache. I appreciate your guys'
help! Thanks.
On Sunday, March 11, 2018 at 11:14:27 PM UTC-4, Drew Howell
Drew most likely what's happening is a variation of this
g = defaultdict(list)
g['foo'] = {'id': 1} # this could be any dictionary
g['foo'].append('someValue')
AttributeError: 'dict' object has no attribute 'append'
Note that defaultdict only gives you the default if the key doesn't have a
val
I think I've narrowed it down to having an error somewhere in my 'students'
controller.
1. If I remove all other functions within that controller, it works.
2. If I create a new controller and only have that function, it works.
3. If I put the same exact code in another existing control
I am running from source, but still seem to have the issue.
On Monday, March 12, 2018 at 1:55:51 AM UTC-4, Val K wrote:
>
> Hi!
> If you're Windows user it's requires to run web2py from source (not
> web2py.exe) to get modules that are installed on your machine
I was doing some testing and i
This controller worked fine for me:
def test():
from collections import defaultdict
g = defaultdict(list)
g['somekey'].append('somevalue')
return response.json(g)
You probably have a bug in your view. You can show us the code if you want.
--
Resources:
- http://web2py.com
- ht
6 matches
Mail list logo