[web2py] db.Table in appadmin when used in a module

2012-02-29 Thread Johann Spies
I have this in a model. It is included in many tables. akb_signature = db.Table(db, 'akb_signature', Field('created_on', 'datetime', default = request.now, readable = False, writable = False), Field('created_by', db.auth_user, de

Re: [web2py] db.Table in appadmin when used in a module

2012-02-29 Thread Bruno Rocha
where the akb_signature_uuid is defined? in a model or module from gluon import current current.akb_signature_uuid = akb_signature_uuid = something then in appadmin from gluon import current does not works¿ http://zerp.ly/rochacbruno Em 29/02/2012 06:26, "Johann Spies" escreveu: > I have th

Re: [web2py] db.Table in appadmin when used in a module

2012-02-29 Thread Johann Spies
On 29 February 2012 12:05, Bruno Rocha wrote: > where the akb_signature_uuid is defined? > > in a model or module > model > from gluon import current > current.akb_signature_uuid = akb_signature_uuid = something > In the model I have from gluon import current current.db = db current.akb_signa

Re: [web2py] db.Table in appadmin when used in a module

2012-02-29 Thread Bruce Wade
Is there any reason you have a extra comma in the __init__ method? def __init__(self, db*,*): On Wed, Feb 29, 2012 at 3:14 AM, Johann Spies wrote: > On 29 February 2012 12:05, Bruno Rocha wrote: > >> where the akb_signature_uuid is defined? >> >> in a model or module >> > > model > >> from gluon

Re: [web2py] db.Table in appadmin when used in a module

2012-02-29 Thread Johann Spies
On 29 February 2012 16:28, Bruce Wade wrote: > Is there any reason you have a extra comma in the __init__ method? > def __init__(self, db*,*): > > > Well spotted. No. It was a typo. I have removed it now, but that did not change the behaviour of appadmin. Regards Johann -- Because experienc

Re: [web2py] db.Table in appadmin when used in a module

2012-02-29 Thread Bruce Wade
Have you tried setting: def __init__(self, db): self.signature = current.akb_signature_uuid then using self.signature? On Wed, Feb 29, 2012 at 10:21 PM, Johann Spies wrote: > > > On 29 February 2012 16:28, Bruce Wade wrote: > >> Is there any reason you have a extra comma in the __init__ met

Re: [web2py] db.Table in appadmin when used in a module

2012-02-29 Thread Johann Spies
On 1 March 2012 08:26, Bruce Wade wrote: > Have you tried setting: > > def __init__(self, db): >self.signature = current.akb_signature_uuid > > then using self.signature? > > > Yes I had something similar and for some reason which I do not understand the code complained: AttributeError: 'Ins

Re: [web2py] db.Table in appadmin when used in a module

2012-03-01 Thread Bruce Wade
Ummm where are you creating your object? In db.py? Or only in actions that require it? If only in actions that require it you will also need to import it and create an instance in the appadmin file. On Wed, Feb 29, 2012 at 10:56 PM, Johann Spies wrote: > On 1 March 2012 08:26, Bruce Wade wrote:

Re: [web2py] db.Table in appadmin when used in a module

2012-03-02 Thread Johann Spies
On 1 March 2012 16:15, Bruce Wade wrote: > Ummm where are you creating your object? In db.py? Or only in actions that > require it? If only in actions that require it you will also need to import > it and create an instance in the appadmin file. > I think my previous email(s) on this subject con