On 10 February 2012 08:37, Bruce Wade <[email protected]> wrote:
> Ok so I came up with a little bit of a different approach then you have,
> it seems to be working for me. I did this pretty fast so it will require
> some improvements.
>
I have adapted your method ...
>
> First create a module:
> test.py
> #!/usr/bin/env python
> # coding: utf8
> from gluon import *
>
> class TestMe(object):
>
> def __init__(self, db):
> self.db = db
> self.T = current.T
> self.auth = current.session.auth
> self.tablename = "test_me"
>
> self.define_tables()
>
> def define_tables(self):
> if self.tablename not in self.db.tables:
> table = self.db.define_table(self.tablename,
> Field('secret'),
> Field('answer')
> )
> ...
>
> To fix this edit appadmin.py:
> from test import TestMe
> testme = TestMe(db)
>
> Now the database table is only ever created if it isn't in the db.tables
> object, and you can use it per action, and in appadmin.
>
>
The tables show up in appadmin but not the content and I cannot do csv
import or export:
<type 'exceptions.TypeError'> __call__() got an unexpected keyword argument
'ignore_common_filters'
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)