I build a table:
db.define_table('image',
Field('title', unique=True),
Field('file', 'upload'),
format = '%(title)s')
then upload a image called 'water'.
in index.html, I wrote:
<img src="{{=URL('download',args=db.image.water)}}" />
but then it gives me the error:
<type 'exceptions.AttributeError'>()
Function argument list
(self=<Table image (id,title,file)>, key='water')
Code listing
343. 344. 345. 346. 347.
348. 349. 350. 351. 352. | def __getattr__(self, key): try: return self.__dict__.__getitem__(str(key)) except:
raise AttributeError
def __setitem__(self, key, value): self.__dict__.__setitem__(key, value)
|