Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-02-27 Thread Bruce Wade
I am using a very similar concept now however I am storing all my modules that require access to multiple app's in a different location. At the same level ass gluon For example: web2py -- gluon -- customAPIs - my_api Now in any action where you want to use your api: from customAPIs.my_api imp

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-02-27 Thread Johann Spies
On 25 February 2012 08:42, Johann Spies wrote: > > > The tables show up in appadmin but not the content and I cannot do csv > import or export: > > __call__() got an unexpected keyword > argument 'ignore_common_filters' > On a different computer today I do not get this error. So it might be a

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-02-24 Thread Johann Spies
On 10 February 2012 08:37, Bruce Wade 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/

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-02-09 Thread Bruce Wade
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. First create a module: test.py #!/usr/bin/env python # coding: utf8 from gluon import * class TestMe(object): def __init__(self

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-02-01 Thread Bruno Rocha
can you send me your app? .w2p or only your datamodels? May be we can work to improve the approach! On Wed, Feb 1, 2012 at 4:12 PM, Bruce Wade wrote: > Actually just tested the same problem happens with all datamodels I > created and try to save from using appadmin. > appadmin.py: > from myapp

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-02-01 Thread Bruce Wade
Actually just tested the same problem happens with all datamodels I created and try to save from using appadmin. appadmin.py: from myapp import MyApp app = MyApp() auth = app.auth #from datamodel.post import Post as PostModel from datamodel.user import UserAccount from datamodel.dist import Distrib

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-02-01 Thread Bruce Wade
Ok thanks that makes things clear. I am having another issue: from gluon.dal import Field from basemodel import BaseModel from gluon.validators import IS_NOT_EMPTY, IS_NOT_IN_DB from gluon import current class Language(BaseModel): tablename = "languages" def set_properties(self):

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-02-01 Thread Bruno Rocha
You can set visibility and other options, but you cant use self.auth.settings.table_user_ name because at this point self.auth does not exist and it is a circular reference given the fact that User class is the base for the creation of Auth object in that example. But, in most cases you will name

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-02-01 Thread Bruce Wade
This is how I originally thought to do it. (Would have posted this last night but code was at the office) class User(BaseAuth): def set_properties(self): tablename = self.auth.settings.table_user_name T = current.T # take a look in basemodel to see the options allowed

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-01-31 Thread Bruce Wade
Thanks that will do it, I was close to that exact same approach when I was playing around today. -- Regards, Bruce On Tue, Jan 31, 2012 at 7:54 PM, Bruno Rocha wrote: > Hi Bruce, > > delete the database if the sample app created one, then replace > modules/datamodel/user.py with this https://gi

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-01-31 Thread Bruno Rocha
Hi Bruce, delete the database if the sample app created one, then replace modules/datamodel/user.py with this https://gist.github.com/1714979 -- Bruno Rocha [http://rochacbruno.com.br]

Re: [web2py] Re: [w2py-dev] model less apps (a blog example)

2012-01-31 Thread Bruce Wade
Hi Bruno, I have been looking at your code. How would you override the Auth to not include first name last name using your class? IE: How would we do the following using your approach? (BaseAuth) db.define_table( auth.settings.table_user_name, Field('username', length=128, default='0

[web2py] Re: [w2py-dev] model less apps (a blog example)

2012-01-30 Thread Ross Peoples
Bruno, This is a good article. I have done something like this before. My approach was a bit different. I was using the singleton pattern, but I think it accomplishes the same goal. I would for example have a module like this: from gluon import * class MyModel(object): instance = None