[web2py] share auth across applications

2011-12-15 Thread Chandrakant Kumar
How to share authentication across applications?

[web2py] requires IS_IN_SET()

2011-12-15 Thread Chandrakant Kumar
I'm adding extra fields to auth_user as, auth.settings.extra_fields['auth_user']= [ Field('user_type', requires=IS_IN_SET('Admin', 'Staff'))] But, in the Register form I'm getting a listbox with single letter options like, a, d, m, i, n. Is there something missing?

Re: [web2py] Re: requires IS_IN_SET()

2011-12-15 Thread Chandrakant Kumar
of characters On 15 dic, 08:29, "Chandrakant Kumar" wrote: I'm adding extra fields to auth_user as,         auth.settings.extra_fields['auth_user']= [                 Field('user_type', requires=IS_IN_SET('Admin', 'Staff'))] But, in the Regi

Re: [web2py] requires IS_IN_SET()

2011-12-15 Thread Chandrakant Kumar
oh, now i understand, thanks for your explanation jonathan. On Thu, 15 Dec 2011 21:13:42 +0530, Jonathan Lundell wrote: On Dec 15, 2011, at 3:29 AM, Chandrakant Kumar wrote: I'm adding extra fields to auth_user as, auth.settings.extra_fields['auth_user']= [

[web2py] 1:N relation with auth_user

2011-12-15 Thread Chandrakant Kumar
I'm trying to establish one to many relation with auth_user, but i'm getting this error: Traceback (most recent call last): File "/home/chandra/dev/web2py/gluon/restricted.py", line 194, in restricted exec ccode in environment File "/home/chandra/dev/web2py/applications/job

Re: [web2py] 1:N relation with auth_user

2011-12-15 Thread Chandrakant Kumar
no, i'm sharing the auth tables from another application in a separate model (auth.py) and this code is defined in db.py. so, alphabetically auth.py is exceuted first. On Fri, 16 Dec 2011 00:27:59 +0530, Anthony wrote: Does this code get run before your db.auth_user table has been defined?

Re: [web2py] 1:N relation with auth_user

2011-12-15 Thread Chandrakant Kumar
Both apps are using same mysql database. masterapp calls it auth_user and it is present in the database, as i checked it in mysql console. On Fri, 16 Dec 2011 01:13:02 +0530, Anthony wrote: Is this two separate databases -- one from the other app for Auth, and one for this app? If so, I do

Re: [web2py] Re: 1:N relation with auth_user

2011-12-15 Thread Chandrakant Kumar
i have only one auth_user table, this field 'org' is reference to auth_user On Fri, 16 Dec 2011 03:16:58 +0530, Cliff wrote: Both auth_user tables contain the "org" field with an identical definition, right? On Dec 15, 1:49 pm, "Chandrakant Kumar" wrote: I

Re: [web2py] Re: 1:N relation with auth_user

2011-12-15 Thread Chandrakant Kumar
I found out the problem, i had to use auth.define_tables(migrate=False), as auth tables are already defined. On Fri, 16 Dec 2011 03:16:58 +0530, Cliff wrote: Both auth_user tables contain the "org" field with an identical definition, right? On Dec 15, 1:49 pm, "Chandrakan

Re: [web2py] Re: Pycharm 2 is out

2011-12-16 Thread chandrakant kumar
+1

Re: [web2py] Web Resources

2011-12-17 Thread chandrakant kumar
Hi Javier I'm working on same, let me know if we can collaborate. On Sat, Dec 17, 2011 at 5:34 PM, Javier Quarite wrote: > Thanks everyone for the information, I'll try to read the documentation of > pythonfiddle because its FOSS, and try to do one using web2py hope it > works =) > > > Javi

Re: [web2py] Web Resources

2011-12-18 Thread Chandrakant Kumar
Yes sure On Sat, 17 Dec 2011 21:33:20 +0530, Javier Quarite wrote: On Sat, Dec 17, 2011 at 10:51 AM, chandrakant kumar wrote: Hi Javier I'm working on same, let me know if we can collaborate. Really? Well I'm actually beginning with web2py, It just came as an idea th

[web2py] production site hosting

2011-12-19 Thread chandrakant kumar
what are the good options(web hosts) for hosting the production sites? I'm located in India.

Re: [web2py] production site hosting

2011-12-20 Thread chandrakant kumar
I talked to their staff too, very friendly and helpful. On Tue, Dec 20, 2011 at 1:54 PM, Johann Spies wrote: > On 20 December 2011 07:55, chandrakant kumar wrote: > >> what are the good options(web hosts) for hosting the production sites? >> I'm located in India. >>

Re: [web2py] production site hosting

2011-12-20 Thread Chandrakant Kumar
I prefer shared hosts over VPS. My only concern with webfaction is the location of servers. servers are located in Texas & Amsterdam, while my target user base in India. On Tue, 20 Dec 2011 20:24:03 +0530, Ross Peoples wrote: There's a sticky on this somewhere, but webfaction is always

Re: [web2py] Web Development Introduction Based On Web2py

2011-12-20 Thread chandrakant kumar
very nice effort, awaiting further chapters. On Wed, Dec 21, 2011 at 12:03 AM, ma...@rockiger.com < rocki...@googlemail.com> wrote: > I published the first 3 chapters of my web development tutorial at > http://killer-web-development.com > > It's aimed at total web development beginners and uses w

Re: [web2py] Re: web2py on github

2011-12-21 Thread Chandrakant Kumar
the 5 users cap is only for free private repos, not for public repos. On Wed, 21 Dec 2011 20:14:51 +0530, Bruce Wade wrote: My problem with bitbucket is the 5 cap for free private, if you are wanting to use git and keep the projects public I recommend gitorious. 2011/12/21 Daniel Aguayo

Re: [web2py] Web Development Introduction Based On Web2py

2011-12-21 Thread Chandrakant Kumar
In the section 3.2, where you create the .hgignore file, why did you put '*' in there, that will make hg ignore all files in current directory. On Wed, 21 Dec 2011 00:03:21 +0530, ma...@rockiger.com wrote: I published the first 3 chapters of my web development tutorial at http://killer-we

[web2py] error: ('IS_IN_SET' object has no attribute 'startswith')

2011-12-21 Thread Chandrakant Kumar
I'm passing a tuple of strings to IS_IN_SET validator, but i'm getting this error - ('IS_IN_SET' object has no attribute 'startswith') code is - Field('state', IS_IN_SET(STATE_LIST)), where STATE_LIST is a tuple of strings. -- Using Opera's revolutionary email client: http://www.opera.co

Re: [web2py] Re: error: ('IS_IN_SET' object has no attribute 'startswith')

2011-12-21 Thread Chandrakant Kumar
ah, that was silly of me, thank you for the correction. On Wed, 21 Dec 2011 22:39:29 +0530, DenesL wrote: On Dec 21, 11:41 am, "Chandrakant Kumar" wrote: I'm passing a tuple of strings to IS_IN_SET validator, but i'm getting this error - ('IS_IN_SET' objec

[web2py] Adding user to a group after registration

2011-12-21 Thread Chandrakant Kumar
I'm attempting to add a user to a group , depending on the role he chose from a dropdown list. for e.g., In the register form user is presented an option of choosing user type 1. individual 2. organisation how do i add the user to the appropriate group depending on his selection? (i wen

Re: [web2py] Adding user to a group after registration

2011-12-21 Thread Chandrakant Kumar
I didn't even know that existed, but that worked exactly like i wanted, thanks. I thought i should post the code, if anybody in future needs it: #controllers/default.py def __add_user_membership(form): group = db(db.auth_group.role==form.vars.user_type).select().first() user

Re: [web2py] Adding user to a group after registration

2011-12-21 Thread Chandrakant Kumar
better version : def __add_user_membership(form): group_id = auth.id_group(role=form.vars.user_type) user_id = form.vars.id auth.add_membership(group.id,user_id) On Thu, 22 Dec 2011 01:52:50 +0530, Anthony wrote: You can use an auth.settings.register_onaccept function,

Re: [web2py] Big Thank You

2011-12-22 Thread Chandrakant Kumar
same feeling here, coming from django, i underestimated web2py, and now as i learn something new everyday and i go WOW! On Thu, 22 Dec 2011 23:44:18 +0530, lyn2py wrote: Special Mention: Biggest Thank You's to Massimo and Anthony - for your help with my questions. Also thank you to Bruno, pb

Re: [web2py] Advice needed from Git users...

2011-12-25 Thread chandrakant kumar
On Sun, Dec 25, 2011 at 4:21 PM, lyn2py wrote: > I was playing around with some Git commands and accidentally deleted > the folders on my local machine that were set to "untrack" in > my .gitignore (is this coincidental?) > > I didn't realize they got deleted until after the entire session of > t

Re: [web2py] Re: Advice needed from Git users...

2011-12-25 Thread chandrakant kumar
That post is mercurial bashing without any real example or proof. I like mercurial because i don't have to remember 129 commands, and i can concentrate on my real work. It is also about personal taste. Happy Holidays! On Mon, Dec 26, 2011 at 12:38 AM, lyn2py wrote: > @Chandrakant, I jumped stra

Re: [web2py] Re: Web Development Introduction Based On Web2py

2012-01-08 Thread chandrakant kumar
this is so cool. On 1/8/12, ma...@rockiger.com wrote: > Chapter 4 is online: it contains planning for the sample app and is > intruducing Selenium for functional testing. > > Best > marco >

[web2py] new to web2py/python

2011-11-24 Thread chandrakant kumar
Hello I'm new to web2py/python, web development in general. can you suggest me the appropriate learning path. I've used django for couple of months. regards

[web2py] Differentiating GET from POST

2011-11-25 Thread chandrakant kumar
I'm going through chapter 3 of the book. In an example of 'images' app, in the show function, how is the POST and GET methods differentiated?

Re: [web2py] Re: Differentiating GET from POST

2011-11-25 Thread chandrakant kumar
I've only been to chapter 3 till now and i'm starting to like it. Best thing i like is the DAL, and the way it is implemented, so sql like syntax, yet database independent. And, the templates so simple. Thank you for such a nice project.

Re: [web2py] How to cause radio buttons to auto deselect?

2011-11-26 Thread chandrakant kumar
I think you should group them together, as per common sense, i don't know how to do it. On Sun, Nov 27, 2011 at 2:30 AM, dlypka wrote: > When I create several radio buttons in a web2py form, they do not auto > deselect when another is selected. They all stay selected. Do I need > to add my own

[web2py] web2py shell

2011-11-29 Thread chandrakant kumar
how can i do from gluon.sql import *, in a normal python shell.

Re: [web2py] web2py shell

2011-11-29 Thread chandrakant kumar
This solved the problem, actually i was trying to test the code before using it in app, kind of like dbshell in Rails. On Tue, Nov 29, 2011 at 6:49 PM, Ross Peoples wrote: > You typically have to use the web2py shell: > > python web2py.py -S appname -M > > If you are trying to use gluon libraries

[web2py] hard time understanding query and set objects

2011-11-30 Thread chandrakant kumar
I'm going through the official book, currently at the DAL chapter. I'm having confusions over query and set objects. for e.g. 1. To fetch rows one uses , rows = db(db.mytable.myfield!=None).select() it returns a collection of rows, that is fine. But, what is a 'set' then? Isn't 'rows' itse

Re: [web2py] hard time understanding query and set objects

2011-11-30 Thread chandrakant kumar
On Thu, Dec 1, 2011 at 4:31 AM, Anthony wrote: > On Wednesday, November 30, 2011 5:41:34 PM UTC-5, Chandra wrote: >> >> I'm going through the official book, currently at the DAL chapter. I'm >> having confusions over query and set objects. >> >> for e.g. >> 1. To fetch rows one uses , rows = db(

Re: [web2py] hard time understanding query and set objects

2011-11-30 Thread chandrakant kumar
On Thu, Dec 1, 2011 at 5:26 AM, Anthony wrote: > 2. A query object represents a sql 'where' clause like, myquery = (db.mytable.myfield != None) | (db.mytable.myfield > 'A') Can't the same thing be done like, rows = db((db.mytable.myfield!=None) | (db.mytable.myfield >'A')) >>>

Re: [web2py] Say hello to i-Track

2011-12-01 Thread chandrakant kumar
Julio, I have been looking for you since reading techfuel. > >

[web2py] Ulipad with web2py plugin

2011-12-02 Thread chandrakant kumar
Has anybody used ulipad with web2py plugin? I am trying it and it looks good.

Re: [web2py] Re: Ulipad with web2py plugin

2011-12-02 Thread chandrakant kumar
http://code.google.com/p/ulipad/

[web2py] Setting up eclipse for web2py development

2011-12-05 Thread chandrakant kumar
I am trying to setup eclipse for web2py development. I tried using (if 0: import things) trick, then i get lot of warning about unused functions. Is there any neater way of doing this.

Re: [web2py] Re: Setting up eclipse for web2py development

2011-12-06 Thread chandrakant kumar
Thanks Vineet , Massimo , that was really helpful. On Tue, Dec 6, 2011 at 9:39 AM, Vineet wrote: > @chandrakant kumar, > > https://groups.google.com/group/web2py/browse_thread/thread/b6c0cf5d61d0c565/a40a34c4f91661bb?lnk=gst&q=eclipse# > > In that thread, see the post by &q

[web2py] how to html drop down list with data from a query

2011-12-06 Thread chandrakant kumar
How do i create a drop down list in views with data from a query. for e.g. rows = db(db.person.id>0).select() then, how do i present the user a dropdown list containing all the persons name.

Re: [web2py] Re: Massimo

2011-12-07 Thread chandrakant kumar
Programmers don't get the glory they deserve, http://goo.gl/yRJbR. On Wed, Dec 7, 2011 at 12:34 PM, Vineet wrote: > Oops. > Inadvertently, I did not mention about the other contributors in my > OP! > Anthony's (& of course, the other members') replies have been very > useful to me. > >