[web2py] Re: Multi-Company System

2011-04-30 Thread annet
I have been working on something similar for some time now, and so far I haven't encountered any problems. I have a single web2py app and a single PostgreSQL database. In db.py I defined a 'company' table and added a company_id field to all the other tables (writable and readable set to False). (Be

[web2py] Re: Add gluon to global python path

2011-04-30 Thread luckysmack
mostly just for testing things and learning web2py. for example when going through the book and learning things, to follow along. or when i read a tute online somewhere. but also for the same reason the python shell is there, to test statements and see if syntax is correct and the like. I want to b

[web2py] Re: Powerpack

2011-04-30 Thread luckysmack
This is great. I noticed that the default is to use sqlite, is there a way I can convert it to use mysql? i tried editing the connection screen before visiting the page, but i kept getting a ticket stating it was unable to create a table. On Apr 29, 8:17 am, Christopher Steel wrote: > Martin, > >

Re: [web2py] Re: Powerpack

2011-04-30 Thread Martín Mulone
Like any other web2py application, change in models/config.py mainconfig.database_uri = 'sqlite://storage.sqlite' a mainconfig.migrate = True mainconfig.database_uri = 'mysql://user:pass@localhost:3306/databasename' The problem is perhaps you have migrate=False. Delete all the content in the

Re: [web2py] Re: Powerpack

2011-04-30 Thread Martín Mulone
Mmmh you need to write the same page in differents languages?. 2011/4/29 Christopher Steel > Martin, > > I have been looking at powerpack and it is a really exciting > application and collection of plugins. > > You have addressed a number of practical issues related to Web2py > application deve

[web2py] Re: Multi-Company System

2011-04-30 Thread villas
Thanks for the ideas. Bruno has reminded me that 'multi-tenant' is a better description than 'multi-company'. @B GAE namespacesAPI looks like it might be an interesting solution to build into DAL. I think Massimo would quickly know how feasible that was. http://code.google.com/appengine/docs/py

[web2py] Re: readable/writable settings of auth.signature

2011-04-30 Thread niknok
Yes, it did work. Sorry for that post. My error was that I should have set both to False but I was only setting .readable=False, but not doing the same to .writable. Thanks! /r Nik On Apr 29, 9:45 pm, Massimo Di Pierro wrote: > It should work. Can you post your model so I can try it? > > O

[web2py] Re: Multi-Company System

2011-04-30 Thread annet
> @A  I think your standardized groups will simplify things. However, > there is then some sacrifice of fine-tuning permissions. You're right. In my case I am working on a network of networks app. Since permissions are based on functions I was able to cluster functions into plans. To fine tune per

[web2py] Re: Multi-Company System

2011-04-30 Thread annet
> @A I think your standardized groups will simplify things. However, > there is then some sacrifice of fine-tuning permissions. You're right. In my case I am working on a network of networks app. Since permissions are based on functions I was able to cluster functions into plans. To fine tune per

Re: [web2py] Re: Multi-Company System

2011-04-30 Thread Stifan Kristi
how about the performance difference between using single database or multiple database? did you consider about it? On Sat, Apr 30, 2011 at 7:51 PM, annet wrote: > > @A I think your standardized groups will simplify things. However, > > there is then some sacrifice of fine-tuning permissions. >

[web2py] Re: Multi-Company System

2011-04-30 Thread villas
On Apr 30, 2:14 pm, Stifan Kristi wrote: > how about the performance difference between using single database or > multiple database? did you consider about it? I don't think that's an issue for me because DBs have to be really big, or large numbers of transactions before speed becomes a problem.

[web2py] Re: Multi-Company System

2011-04-30 Thread villas
> Since permissions are based on functions I was able to cluster > functions into plans. To fine tune permissions I defined a table > 'function' which has a company_id and Boolean fields for every single > function. Hi Annet, Your idea seems like a workable alternative, but still you seem to be r

[web2py] Re: Multi-Company System

2011-04-30 Thread Anthony
Annet, is this a publicly available website/service? If so, it would be great to list it on www.web2py.com/poweredby (which at the moment is generating errors for some reason). Anthony On Saturday, April 30, 2011 3:10:44 AM UTC-4, annet wrote: > I have been working on something similar for so

[web2py] Re: Using HTML5 local storage for Web2Py Doc - Creating a Wiki on Git to list all plugins ?

2011-04-30 Thread Alexandre Strzelewicz
Ok the HTML5 idea was not so great but actualizing the GIT repo on GitHub (https://github.com/web2py/web2py) and adding a Wiki as Node.js could be a good idea... I can do this job if you want... On Apr 29, 9:12 pm, Alexandre Strzelewicz wrote: > Why don't we do a Wiki as Node.js which list all p

Re: [web2py] Re: Multi-Company System

2011-04-30 Thread Stifan Kristi
it's a good idea, pardon me, my point of view is focus on the performance because the data will growth and the database process will be high. i think it'll be so hard to maintain if the performance is degraded and the application system had already live. On Sat, Apr 30, 2011 at 9:03 PM, villas wr

[web2py] Re: plugin_wiki attachment KeyError: 'file'

2011-04-30 Thread Massimo Di Pierro
It is a bug. fixing it now in views/plugin_wiki/attachments.html row.filename[row.file.rfind('.') shouls be row.filename[row.filename.rfind('.') On Apr 30, 12:57 am, nic wrote: > I am using 1.95.1 and have just created a new simple app and added the > plugin_wiki, which I have done before in

[web2py] Re: Using HTML5 local storage for Web2Py Doc - Creating a Wiki on Git to list all plugins ?

2011-04-30 Thread Massimo Di Pierro
I do not want to disperse information too much. I believe Nathan, Bruno and Martin are working on this problem already. On Apr 30, 10:04 am, Alexandre Strzelewicz wrote: > Ok the HTML5 idea was not so great but actualizing the GIT repo on > GitHub (https://github.com/web2py/web2py) and adding a W

[web2py] Re: Multi-Company System

2011-04-30 Thread annet
@D > Your idea seems like a workable alternative, but still you seem to be > re-inventing the auth group system which is what I was trying to > avoid. Web2py's auth system simply didn't work for me, therefore, I came up with the 'function' table as an alternative. I am building this app for a psyc

[web2py] Re: Multi-Company System

2011-04-30 Thread villas
> Furthermore, I don't know if a single database on a database server > performs less well than multiple database > on the same database server. In my experience even large DBs perform well when queries are on indexed fields and it is much easier to manage data when it is in one place. However,

[web2py] Re: Add gluon to global python path

2011-04-30 Thread mart
I tried a while to add to system path, but some caused a little bit of grief where importing one module that had dependancies on other modules that were more focused on web use would force me to modify some gluon modules, then i had to write a script to update web2py modules everytime i upgraded...

[web2py] deal with CSV

2011-04-30 Thread cyber
hi everyone! I need a help/hint/advase again. I have a code in the controller: results=db((db.autos.dt>=t1) & (db.autos.dt<=t2)).select(orderby=~db.autos.dt) export = csv.writer(open('export.csv', 'wb'), delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL) for r in results: ex

[web2py] Re: Multi-Company System

2011-04-30 Thread Anthony
On Saturday, April 30, 2011 1:29:11 PM UTC-4, annet wrote: > > @Anthony > > Annet, is this a publicly available website/service? > > Not yet, it's still experimental, and requires a lot of re-work every > now and than. As soon as it's publicly available I'll let you know. > However, it's a sit

[web2py] Typo in Appadmin

2011-04-30 Thread Pystar
There is a typo in the Appadmin application. One of the functions is spelt "ccache" instead of "cache"

[web2py] Re: images not loading completely

2011-04-30 Thread Philip
Aha! This appears to be a bug in OS X or in Python. It sounds very similar to this: http://www.cherrypy.org/ticket/598 Following that cherrypy ticket, I changed the Connection class in rocket.py: removed: self.sendall = self.socket.sendall added: def sendall(self, buf): pending = le

[web2py] Re: Powerpack

2011-04-30 Thread Christopher Steel
Yes, Right now we do two languages and we are suppose to add a third in the near future (http://voiceofaccess.org/). In the short term our solution is working but kind of clunky. I am looking for a smooth transition path for our site and our clients sites, all of which are multi-lingual. Thanks,

Re: [web2py] Re: Multi-Company System

2011-04-30 Thread Stifan Kristi
> > In my experience even large DBs perform well when queries are on > indexed fields and it is much easier to manage data when it is in one > place. > i think indexed fields not every table must have it, because when you didn't use it wisely it can drop your database performance. just indexed the

[web2py] Urgent!! Help needed on database definition

2011-04-30 Thread Pystar
Hi guys, I am stuck in defining the database of my new project. I need help on this. DESCRIPTION: The web page has a form that allows for a 140 character post, and another field for tags. I have 2 problems now, how do I implement tagging in the database? i.e. allow a post to be associated with dif

[web2py] index not show on sql log

2011-04-30 Thread 黄祥
hi, i use the index for my table e.g. db.executesql('CREATE INDEX IF NOT EXISTS category ON blog_category (category);') but when i check on the sql log it didn't appears create index, is it normal or not? maybe my code is wrong, please give an advice or pointer about this. many thanks before

[web2py] Re: index not show on sql log

2011-04-30 Thread pbreit
sql.log reflects SQL generated from the define_table() models and will not include any queries performed with executesql().

[web2py] Re: Powerpack

2011-04-30 Thread villas
Hi Martin I was just trying out powerpack but it seems there are a few things broken, I suppose you are working on that? plugin_ip2_admin.py def editcat should be catedit .xml() has been cancelled etc. Regards, D

[web2py] Re: Multi-Company System

2011-04-30 Thread Stodge
How about using a more generic concept of 'site'? That way it could apply to multi-company, multi-project, multi-location, multi-group etc... On Apr 29, 8:30 pm, villas wrote: > Hi All, > > I would like to use a single web2py app for many companies using a > single DB.  For simplicity,  I would p

[web2py] Re: web2py as CAS consumer; The page isn't redirecting properly

2011-04-30 Thread Stodge
Thanks. Feel free to tell me I'm crazy - this is based on my limited understanding of CAS and I'm sure you're more knowledgable than I am. On Apr 29, 11:36 pm, Massimo Di Pierro wrote: > thanks. WIll process it asap. > > On Apr 29, 8:42 pm, Stodge wrote: > > > > > > > > > created ticket 251 -htt

Re: [web2py] Re: index not show on sql log

2011-04-30 Thread Stifan Kristi
i'm understand right now, btw, the indexing is working, i'm just curious why it's not log by sql log on web2py appadmin, thank you so much for your explaination, breitenbach. On Sun, May 1, 2011 at 8:00 AM, pbreit wrote: > sql.log reflects SQL generated from the define_table() models and will no

Re: [web2py] Re: passing from view to controller.. is this right?

2011-04-30 Thread TÅ®å ßrown
what i am exactly trying to do is to send the data that i have processed from my javascript and send it to the controller function - insert_updatadb() function MGP(correct) { time_per_question=2 //2 seconds per question var numBer={{=request.vars.number}} / number of quest

[web2py] Total control over your web2py models

2011-04-30 Thread Vinicius Assef
Buddies, I'd like to hear your oppinions about this post in my blog: http://bit.ly/mCH7rr -- Vinicius Assef.

[web2py] Re: passing from view to controller.. is this right?

2011-04-30 Thread Massimo Di Pierro
var numBer={{=request.vars.number}} / number of question in worksheet should be var numBer={{=request.vars.number}}; // number of question in worksheet On Apr 30, 9:16 pm, TÅ®å ßrown wrote: > what i am exactly trying to do is to send the data that i have > processed from my javascript and send

[web2py] Re: index not show on sql log

2011-04-30 Thread Massimo Di Pierro
add this to your views {{=BEAUTIFY(db._timings)}} all queries will be there, timed. On Apr 30, 8:00 pm, pbreit wrote: > sql.log reflects SQL generated from the define_table() models and will not > include any queries performed with executesql().

Re: [web2py] Total control over your web2py models

2011-04-30 Thread Stifan Kristi
nice info, viniclusban, btw, First, because web2py recommends you don't mix validators with db.define_table(). is it the best practice to not mix requires on the same time with field create? e.g. db.define_table('category', Field('category' ) )

[web2py] Re: web2py as CAS consumer; The page isn't redirecting properly

2011-04-30 Thread Massimo Di Pierro
I think we need to move CAS provider into auth /anyapp/default/user/cas/login /anyapp/default/user/cas/logout /anyapp/default/user/cas/verify In this way any existing app can provide the service to any other app. The issue... should we extend app to do more than just authentication (pass info ab

Re: [web2py] Re: index not show on sql log

2011-04-30 Thread Stifan Kristi
thank you so much for your suggestion, massimo. On Sun, May 1, 2011 at 9:30 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > add this to your views > > {{=BEAUTIFY(db._timings)}} > > all queries will be there, timed. > > On Apr 30, 8:00 pm, pbreit wrote: > > sql.log reflects SQL gene

[web2py] IS_IN_DB label from two tables

2011-04-30 Thread niknok
The following validator doesn't work: IS_IN_DB(db(db.g_province.id==db.g_municipality.province)\ ,db.g_municipality.psgc_m\ ,label='%(g_municipality.name)s (%(g_province.name)s)') I am trying to generate a select option that shows a label cons

[web2py] Re: selecting a value in dropdownlist reference to another value in dropdownlist

2011-04-30 Thread niknok
How can I add something like this in a CRUD form? On Apr 26, 1:26 am, Massimo Di Pierro wrote: > I would do something like this: > > db.define_table('nominee',Field('name'),Field('region_id',db.Regions)) > > def get_nominees(): >     region_id = request.vars.region_id >     return TAG[''](*[OPTIO

[web2py] multi-select dropdown behavior with plugin_wiki installed

2011-04-30 Thread niknok
When plugin_wiki is installed, the multi-select dropdown uses a different dropdown widget. Although it indicates how many items are selected, is there a way to make it show at least one of the items checked by default? I also miss the ability to type a letter and get to those items beggining with

[web2py] redirect to series of pages/functions after registration

2011-04-30 Thread niknok
After registration, user is automatically logged in (when verification is set to False). How do I direct a newly registered user to a series of pages? I have a number of pages, I would like a user to go through. I tried: auth.settings.register_next =[URL(c='default',f='profile'), URL(c='default

[web2py] jquery for triggering change in dropdown list values

2011-04-30 Thread niknok
I am clueless about jQuery, but I'm wondering if there's any script I can use to trigger a change the values in one dropdown list after selecting a value from another dropdown list in a CRUD form? Right now, I used a jquery script I picked up in the list that initiates a submit action. The consequ

[web2py] table cleanup

2011-04-30 Thread niknok
Where should I run a function whose task is to maintain the status of a table record? For example, I have a survey table with the column status. A record's status is "open" when a user answers it, and it is set to "completed" when a user finishes answering it. But, if in case the user doesn't fini

[web2py] prettydate showing 5 secs ago as 23 hours ago

2011-04-30 Thread danto
altougth I haven't do the proper research in the source code of the prettydate module, this is the problem I'm having right now with an article i'm fetching from rss in my web2py app. I post this if someone has a time to take a look, very thanks in advance in that case. regards

[web2py] Re: prettydate showing 5 secs ago as 23 hours ago

2011-04-30 Thread danto
2011/5/1 danto > altougth I haven't do the proper research in the source code of the > prettydate module, this is the problem I'm having right now with an article > i'm fetching from rss in my web2py app. > > I post this if someone has a time to take a look, very thanks in advance in > that case.

[web2py] Re: IS_IN_DB label from two tables

2011-04-30 Thread Massimo Di Pierro
You cannot have a join in a validator. On Apr 30, 9:52 pm, niknok wrote: > The following validator doesn't work: > >     IS_IN_DB(db(db.g_province.id==db.g_municipality.province)\ >                         ,db.g_municipality.psgc_m\ >                         ,label='%(g_municipality.name)s > (%(

[web2py] Re: selecting a value in dropdownlist reference to another value in dropdownlist

2011-04-30 Thread Massimo Di Pierro
Just make sure the filed names in the js match does of the crud form. If should work the same. On Apr 30, 9:56 pm, niknok wrote: > How can I add something like this in a CRUD form? > > On Apr 26, 1:26 am, Massimo Di Pierro > wrote: > > > > > > > > > I would do something like this: > > > db.defin

[web2py] Re: multi-select dropdown behavior with plugin_wiki installed

2011-04-30 Thread Massimo Di Pierro
I do not know. Look into the docs in jQuery multiselect. Massimo On Apr 30, 9:52 pm, niknok wrote: > When plugin_wiki is installed, the multi-select dropdown uses a > different dropdown widget. > > Although it indicates how many items are selected, is there a way to > make it show at least one o

[web2py] Re: redirect to series of pages/functions after registration

2011-04-30 Thread Massimo Di Pierro
to force the use to redirect, no matter what do auth.settings.login_onaccept = lambda form: redirect(URL(...)) On Apr 30, 9:53 pm, niknok wrote: > After registration, user is automatically logged in (when verification > is set to False). How do I direct a newly registered user to a series of > p

[web2py] Re: Urgent!! Help needed on database definition

2011-04-30 Thread pbreit
You can customize auth but it's not totally clear that you need to at this point: http://web2py.com/book/default/chapter/08#Customizing-Auth Depending on your needs, I could envision a many-to-many with "list: type". http://web2py.com/book/default/chapter/06#Many-to-Many,-list:,-and-contains Or

Re: [web2py] Total control over your web2py models

2011-04-30 Thread Vinicius Assef
Stifan, a Field() may have many properties adjusted and it turns difficult to read define_table(), mainly due to multiple validators. Note that validators stablish FORM() behaviour, not a database table behaviour. So, mixing layers is not a good practice, right? Separating them will guarantee that

[web2py] Re: redirect to series of pages/functions after registration

2011-04-30 Thread pbreit
No, you can only specify one "next" page. If you want more, you'll need to build the logic. Yes, controllers can call any function in the same controller.py file or in any model. For example: def do_add(j, k) return j + k def index(): a = b = 2 x = do_add(a, b) return x You do

Re: [web2py] Total control over your web2py models

2011-04-30 Thread pbreit
I think either way is fine. In a bigger app, you might separate them out. Vinicius, I like that approach.

[web2py] Re: table cleanup

2011-04-30 Thread pbreit
Probably a cron task: http://web2py.com/book/default/chapter/04?search=cron#Cron

Re: [web2py] Re: index not show on sql log

2011-04-30 Thread pbreit
Because sql.log only tracks define_tables(). As noted in the Book: "Currently the DAL API does not provide a command to create indexes on tables, but this can be done using the *executesql* command. This is because the existence of indexes can make migrations complex, and it is better to deal w

Re: [web2py] Total control over your web2py models

2011-04-30 Thread Bruno Rocha
My point of views is that in a simple and smaller app this approach is a good (may be the only) option. I am now running with a different numerical order, using 3 digits 000_essentials.py 100_authdatabase.py 200_dbmodel.py 300_validators.py 400_utilities.py 500_preload.py why? because between ev

[web2py] really nice interview on hackerpublicradio about web2py

2011-04-30 Thread Massimo Di Pierro
http://hackerpublicradio.org/eps/hpr0711.mp3

[web2py] Re: redirect to series of pages/functions after registration

2011-04-30 Thread Anthony
On Saturday, April 30, 2011 10:53:11 PM UTC-4, niknok wrote: > > After registration, user is automatically logged in (when verification is > set to False). How do I direct a newly registered user to a series of pages? > > I have a number of pages, I would like a user to go through. I tried: > >

Re: [web2py] Total control over your web2py models

2011-04-30 Thread pbreit
This probably doesn't help a whole lot but since it's alphabetical, you can almost always insert anywhere in the sequence. For example '11_' comes before '2_'. Here's another example of a sorted list: ['111_', '11_', '11a1_', '1_', '1a1_', '1a_', '2_']

[web2py] Re: jquery for triggering change in dropdown list values

2011-04-30 Thread Anthony
This may help: http://www.web2pyslices.com/main/slices/take_slice/85 On Saturday, April 30, 2011 10:53:16 PM UTC-4, niknok wrote: > I am clueless about jQuery, but I'm wondering if there's any script I can > use to trigger a change the values in one dropdown list after selecting a > value from

[web2py] Re: jquery for triggering change in dropdown list values

2011-04-30 Thread pbreit
Nice find! I was going to simply say it was difficult.

Re: [web2py] Re: CLEANUP() removing too many characters

2011-04-30 Thread Jonathan Lundell
On Apr 25, 2011, at 7:46 PM, Massimo Di Pierro wrote: > > I agree. Perhaps tab should be retained as well. > > On Apr 25, 8:59 pm, Jonathan Lundell wrote: >> On Apr 25, 2011, at 6:49 PM, Massimo Di Pierro wrote: >> >> >> >>> True. It should do what the book says. >> >> Except that we shoul

[web2py] URL rewrite throwning invalid request when URL contains spaces or hyphens

2011-04-30 Thread Syed Mushtaq
Hi , I was using rewrite for making the URL reader friendly . When I use a space or hypen in the URL instead of passing it to the controller , it gives an invalid request . I have configured the routes as follows routes_in = (( r'/$id/$name' , r'/app/default/view/$id/$name') ) routes_out = ( (

[web2py] Re: CLEANUP() removing too many characters

2011-04-30 Thread Massimo Di Pierro
I am not convinced about tab. I hate tab, it only causes problems. On May 1, 12:29 am, Jonathan Lundell wrote: > On Apr 25, 2011, at 7:46 PM, Massimo Di Pierro wrote: > > > > > I agree. > > Perhaps tab should be retained as well. > > > > > > > > > > > On Apr 25, 8:59 pm, Jonathan Lundell wrote:

[web2py] Re: URL rewrite throwning invalid request when URL contains spaces or hyphens

2011-04-30 Thread Massimo Di Pierro
yes routes_in = (( r'/$id/$name' , r'/app/default/view/$id/$name'), ) routes_out = ( ( r'/app/default/view/$id/$name' , r'/$id/$name'), ) the extra comma at the end. ;-) On May 1, 12:58 am, Syed Mushtaq wrote: > Hi , > > I was using rewrite for making the URL reader friendly . When I use a sp