>
> I still think your original code was failing due to the table not being
> defined
>
I put a print statement in the 'download' function to check that the db
instance being passed to that function contains the required table, and it
did seem to confirm that the table was there. Specifically, I did this:
def download():
print "\ndb.tables:", db.tables
return response.download(request,db)
Perhaps you're right about the source of the problem, but I'm a bit
confused as to how the download function can see the table, and
response.download does not.
I'll see if I can reproduce the issue in a minimal program.
On Monday, October 20, 2014 7:13:49 AM UTC-5, Leonel Câmara wrote:
>
> This is pretty inefficient, I still think your original code was failing
> due to the table not being defined. Specifically response.download does
> this:
>
> items = re.compile('(?P<table>.*?)\.(?P<field>.*?)\..*').match(
> name)
> if not items:
> raise HTTP(404)
> (t, f) = (items.group('table'), items.group('field'))
> try:
> field = db[t][f]
> except AttributeError:
> raise HTTP(404)
>
>
> I think your 404 is this last one.
>
> If you want, you could make a minimal application that reproduces your
> problem, post it here, and I'll fix it.
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.