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 rocki...@googlemail.com wrote:
 Chapter 4 is online: it contains planning for the sample app and is
 intruducing Selenium for functional testing.

 Best
 marco



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

2011-12-25 Thread chandrakant kumar
On Sun, Dec 25, 2011 at 4:21 PM, lyn2py lyn...@gmail.com 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
 trying out Git commands.

 I have been trying to retrace my steps to figure out which commands or
 actions caused me to lose my folders, but to no avail. It's been
 bugging me for a while so...  it would be great if any Git users can
 point out what commands may have caused my local folders to get
 deleted. They didn't even appear in the trash can... I have no idea
 how it happened.

 I went through the commands I used during the period, and they were
 (some commands were typed many times over):
 git init
 git commit -m some message
 git push
 git push origin master
 git push -u origin master
 git add .
 git filter-branch --tree-filter 'rm -rf databases/' HEAD
 git rebase -i HEAD~2
 git reset --hard HEAD
 git push origin master --force
 git log
  git status

That is why i gave up trying to learn git and moved to mercurial.


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 lyn...@gmail.com wrote:

 @Chandrakant, I jumped straight into git without learning it first -
 just followed the tutorials online. Fortunately the loss of data
 wasn't major, just some (many!) test entries in the database (I lost
 my whole databases folder trying to remove it from a previous
 commit).
 But I wondered if I could have blundered worse with Mercurial:

 http://blog.extracheese.org/2010/05/why-i-switched-to-git-from-mercurial.html

  Thanks for your reply and happy holidays!



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 lyn...@gmail.com wrote:


Special Mention: Biggest Thank You's to Massimo and Anthony - for your
help with my questions.
Also thank you to Bruno, pbreit, and others who have walked the web2py
path before me - for your help and answers.
I probably wouldn't have come this far understanding how web2py works
without this user support group and good documentation.

I haven't finished writing anything huge to show yet, but I am
enjoying web2py and python.
One thing that I've come to learn is... I have grossly underestimated
web2py and its ability as a framework.

Many times I encounter a AHA! moment, and each time I just want to
shout: Wow, thank you for creating this beautiful framework!

Today I've encountered another one of these moments and I feel
compelled to write to say, WELL DONE!






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 bruce.w...@gmail.com  
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 Catalán daniel.agu...@gmail.com


Daniel Aguayo Catalán escribió:

 mdipierro escribió:

snip


I'm new to bitbucket but I see that it also supports git, so... it's the
github interface the killer feature? the 5 users cap for free accounts?










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  
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 web2py as  
framework.


The idea was to write a web development tutorial based on web2py, because
web2py is the easiest
to use web development solution - maybe I can rescue a few people from
starting with PHP.

The book aims to be an mixture of railstutorial.org and the Head First
series. Lots of images and
very low level subject matter. A the end readers will develop a full
microblogging service.

I would appreciate any feedback.

Best
marco





[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 -


type 'exceptions.AttributeError'('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.com/mail/


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 denes1...@yahoo.ca wrote:




On Dec 21, 11:41 am, Chandrakant Kumar k.03chan...@gmail.com
wrote:

I'm passing a tuple of strings to IS_IN_SET validator, but i'm getting
this error -

type 'exceptions.AttributeError'('IS_IN_SET' object has no attribute
'startswith')

code is - Field('state', IS_IN_SET(STATE_LIST)),


Field('state', requires = IS_IN_SET(STATE_LIST)),

you are missing the 'requires' parameter name and Field is trying to
interpret the tuple as the field type.



where STATE_LIST is a tuple of strings.
--
Using Opera's revolutionary email client:http://www.opera.com/mail/





[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 went through the group archives, and one solution was to use  
request.args, but i want to use single register link)


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_id = form.vars.id
auth.add_membership(group.id,user_id)
def user():
   auth.settings.register_onaccept = __add_user_membership
   # already existing code

On Thu, 22 Dec 2011 01:52:50 +0530, Anthony abasta...@gmail.com wrote:


You can use an auth.settings.register_onaccept function, which could use
auth.add_membership() to add the appropriate membership for the new user.

Anthony

On Wednesday, December 21, 2011 3:00:20 PM UTC-5, Chandra wrote:



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 went through the group archives, and one solution was to use
request.args, but i want to use single register link)






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 abasta...@gmail.com wrote:


You can use an auth.settings.register_onaccept function, which could use
auth.add_membership() to add the appropriate membership for the new user.

Anthony

On Wednesday, December 21, 2011 3:00:20 PM UTC-5, Chandra wrote:



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 went through the group archives, and one solution was to use
request.args, but i want to use single register link)






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 johann.sp...@gmail.comwrote:

 On 20 December 2011 07:55, chandrakant kumar k.03chan...@gmail.comwrote:

 what are the good options(web hosts) for hosting the production sites?
 I'm located in India.


 Webfaction.com is a good option especially now that they have increased
 the available memory resources.

 Regards
 Johann


 --
 Because experiencing your loyal love is better than life itself,
 my lips will praise you.  (Psalm 63:3)




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 ross.peop...@gmail.com  
wrote:



There's a sticky on this somewhere, but webfaction is always recommended.
There is also Google App Engine. If you would like a VPS-like host  
instead,

then Rackspace, VPS.NET and Amazon EC2 are also options.





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 web2py as framework.

 The idea was to write a web development tutorial based on web2py, because
 web2py is the easiest
 to use web development solution - maybe I can rescue a few people from
 starting with PHP.

 The book aims to be an mixture of railstutorial.org and the Head First
 series. Lots of images and
 very low level subject matter. A the end readers will develop a full
 microblogging service.

 I would appreciate any feedback.

 Best
 marco



[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] Web Resources

2011-12-18 Thread Chandrakant Kumar

Yes sure

On Sat, 17 Dec 2011 21:33:20 +0530, Javier Quarite jquari...@gmail.com  
wrote:



On Sat, Dec 17, 2011 at 10:51 AM, chandrakant kumar
k.03chan...@gmail.comwrote:


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
this project because I've seen others and also I was wondering how to do
something like that... if there's some questions... I hope you can help  
me

:)

Javier





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 jquari...@gmail.com 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 =)


 Javier Q



Re: [web2py] Re: Pycharm 2 is out

2011-12-16 Thread chandrakant kumar
+1


[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

passing a dictionary worked fine.

On Thu, 15 Dec 2011 17:36:29 +0530, Alan Etkin spame...@gmail.com wrote:


You might pass a sequence or dictionary instead of single arguments:

IS_IN_SET([A, B, C])

or

IS_IN_SET({a: a, b: b, ...})

Seems that IS_IN_SET is reading the input as a list of characters

On 15 dic, 08:29, Chandrakant Kumar k.03chan...@gmail.com 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 Register form I'm getting a listbox with single letter  
options

like, a, d, m, i, n.
Is there something missing?





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 jlund...@pobox.com  
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']= [
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?


The problem with this call is that IS_IN_SET requires the set to be its  
first argument, thus:


auth.settings.extra_fields['auth_user']= [
Field('user_type', requires=IS_IN_SET(('Admin', 'Staff')))]

This makes the first argument a tuple, ('Admin', 'Staff'), instead of a  
string, 'Admin' (which happens to be iterable, of course).


For readability, you could write IS_IN_SET(['Admin', 'Staff']) or  
IS_IN_SET(tuple('Admin', 'Staff'))


No need to use a dict.





[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/jobs/models/db.py, line 15,  
in module

Field('org', db.auth_user),
  File /home/chandra/dev/web2py/gluon/dal.py, line 4511, in __getattr__
return self[key]
  File /home/chandra/dev/web2py/gluon/dal.py, line 4505, in __getitem__
return dict.__getitem__(self, str(key))
KeyError: 'auth_user'


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 abasta...@gmail.com wrote:


Does this code get run before your db.auth_user table has been defined?

On Thursday, December 15, 2011 1:49:31 PM UTC-5, Chandra wrote:



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/jobs/models/db.py, line
15,
in module
 Field('org', db.auth_user),
   File /home/chandra/dev/web2py/gluon/dal.py, line 4511, in  
__getattr__

 return self[key]
   File /home/chandra/dev/web2py/gluon/dal.py, line 4505, in  
__getitem__

 return dict.__getitem__(self, str(key))
KeyError: 'auth_user'






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 abasta...@gmail.com wrote:

Is this two separate databases -- one from the other app for Auth, and  
one

for this app? If so, I don't think you can join tables across databases.

Also, does the other app call its user table 'auth_user', or is it using  
a

different name for that table?

Anthony

On Thursday, December 15, 2011 2:02:56 PM UTC-5, Chandra wrote:


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 abas...@gmail.com wrote:

 Does this code get run before your db.auth_user table has been  
defined?


 On Thursday, December 15, 2011 1:49:31 PM UTC-5, Chandra wrote:


 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/jobs/models/db.py,  
line

 15,
 in module
  Field('org', db.auth_user),
File /home/chandra/dev/web2py/gluon/dal.py, line 4511, in
 __getattr__
  return self[key]
File /home/chandra/dev/web2py/gluon/dal.py, line 4505, in
 __getitem__
  return dict.__getitem__(self, str(key))
 KeyError: 'auth_user'








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 cjk...@gmail.com wrote:


Both auth_user tables contain the org field with an identical
definition, right?

On Dec 15, 1:49 pm, Chandrakant Kumar k.03chan...@gmail.com wrote:

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/jobs/models/db.py, line  
15,

in module
     Field('org', db.auth_user),
   File /home/chandra/dev/web2py/gluon/dal.py, line 4511, in  
__getattr__

     return self[key]
   File /home/chandra/dev/web2py/gluon/dal.py, line 4505, in  
__getitem__

     return dict.__getitem__(self, str(key))
KeyError: 'auth_user'





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 cjk...@gmail.com wrote:


Both auth_user tables contain the org field with an identical
definition, right?

On Dec 15, 1:49 pm, Chandrakant Kumar k.03chan...@gmail.com wrote:

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/jobs/models/db.py, line  
15,

in module
     Field('org', db.auth_user),
   File /home/chandra/dev/web2py/gluon/dal.py, line 4511, in  
__getattr__

     return self[key]
   File /home/chandra/dev/web2py/gluon/dal.py, line 4505, in  
__getitem__

     return dict.__getitem__(self, str(key))
KeyError: 'auth_user'





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 vineet.deod...@gmail.com 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.




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 vineet.deod...@gmail.com wrote:

 @chandrakant kumar,

 https://groups.google.com/group/web2py/browse_thread/thread/b6c0cf5d61d0c565/a40a34c4f91661bb?lnk=gstq=eclipse#

 In that thread, see the post by Miguel Lopes -- 4th from the bottom.
 HTH.

 --- Vineet


 On Dec 6, 6:53 am, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:
  are you doing:
 
  if 0: from gluon import *
 
  or are you doing something else?
 
  On Dec 5, 2:40 pm, chandrakant kumar k.03chan...@gmail.com wrote:
 
 
 
   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.- Hide quoted text -
 
  - Show quoted text -



[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.id0).select()

then, how do i present the user a dropdown list containing all the persons name.


[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.


[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/


Re: [web2py] Say hello to i-Track

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





[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' itself a set of records?

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'))
  what is the need of having a query object?


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 abasta...@gmail.com 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(db.mytable.myfield!=None).select()
it returns a collection of rows, that is fine. But, what is a
 'set' then? Isn't 'rows' itself a set of records?


 A Set defines a set of records but doesn't actually select them from the
 db -- so it's like a conceptual representation of the records, but not the
 records themselves. When you apply the select() method to the Set, you
 actually pull the records from the database and transform them to a Python
 object (a Rows object). The distinction is useful because Sets have other
 methods besides select(), such as update(), count(), and delete().


This makes things clear now.


 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'))
   what is the need of having a query object?


  What is your proposed alternative?

 using, myset = db((db.mytable.myfield!None)|(db.mytable.myfield'A')) and
then
rows = myset.select()
will do the same thing, will it? so that we can skip two lines , one
defining the myquery(db.mytable.myfield!None)|(db.mytable.myfield'A'),
then calling myset=db(myquery)


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 abasta...@gmail.com 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'))
   what is the need of having a query object?


  What is your proposed alternative?

 using, myset = db((db.mytable.myfield!None)|(**db.mytable.myfield'A'))
 and then
 rows = myset.select()
 will do the same thing, will it? so that we can skip two lines , one
 defining the myquery(db.mytable.myfield!**None)|(db.mytable.myfield'A')*
 *,
 then calling myset=db(myquery)


 Oh, certainly, there's no need to define the query first and then pass it
 to db(). Your alternative is actually the more common usage. I thought you
 were suggesting there is no need for a separate query object at all. It can
 be useful in some cases, though. Consider a base query to which you might
 want to add various optional conditions:

 base_query = (db.mytable.myfield != None)

 You might want to add additional conditions to that query in different
 scenarios:

 db(base_query  (db.mytable.myfield  'A'))

 You might also want to use the same query with different db objects.

Things are much clear now for me, thank you so much.


[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 ross.peop...@gmail.comwrote:

 You typically have to use the web2py shell:

 python web2py.py -S appname -M

 If you are trying to use gluon libraries by themselves in some other
 application (without using web2py at all), then you either need to put
 web2py on your PYTHONPATH or copy the needed libraries where you want to
 use them.



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 dly...@gmail.com 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 javascript code to do the auto deselect (so that only
 one radio button at a time stays selected)
 or does web2py have some support for this behavior?




[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.


[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