[web2py] Re: Introducing myself

2012-02-26 Thread whowhywhat
Hi Luciano,
You said that right, web2py has a great community :) .. welcome
aboard. I'm sure you will find web2py a superb web development
framework.
I have been using web2py casually for the last one year or so, and on
a serious basis for the last 2 months.
If you are happy about the inbuilt cron i think you will be overjoyed
when you check out the in built scheduler :D
take a look at:
http://web2py.com/books/default/chapter/29/4?search=scheduler#Scheduler-(experimental)
http://web2py.com/books/default/chapter/29/8?search=scheduler

and watch this video:
http://vimeo.com/27478796

I Personally think the web2py documentation (the book) is a great
resource. A new CookBook is being published by PacktPub
And as you rightly pointed out, the google group is one of web2py's
biggest strengths.



On Feb 26, 3:29 pm, Luciano Pacheco lucm...@gmail.com wrote:
 Hi all,

 I joined the group yesterday.

 I've started a small project and in my point of view web2py fits perfectly
 in this case.

 The client want:

 Port a player management to Linux.

 A player that handles music and  database update through FTP downloads,
 handles the playlist based in programs/schedules sent and stored in
 database.

 Management interface to handle some configurations (like FTP servers,
 schedule updates and others).

 Handle backups (data and application).

 And the first feature that made me chose web2py, easy deployment.

 As the application doesn't have to handle a lot of users, the Rocket server
 is more than enough to handle threads to communicate with background
 player, ftp and management interface.

 I'm very happy to have found a built-in cron on web2py so I can focus in
 other features instead of build my own scheduler. :-)

 Also the new scheduler seems useful for the FTP update task.

 For keep the player working I start a thread (on demand) and it has worked
 well, I'll send a specific mail to show the idea and get some feedback.

 So far, I found the documentation in web2py community not so well organized
 and but this list (and web2py-dev) seem to be very worth, as far as I
 navigated in the archives.

 I've been working with Django and before I worked with Plone. I started to
 play with Python occasionally in 2005 and since 2008 I've been working only
 with it. :-)

 I looking forward to help the community. :-)

 Regards,
 --
 Luciano Pacheco
 blog.lucmult.com.br


[web2py] Re: Validate the Checkbox

2012-02-21 Thread whowhywhat
also

TR(Type:,TD(INPUT(_type=checkbox,_name=options,_value=a,_size=0,requires
= IS_NOT_EMPTY(error_message=Please select
at least one check-box)), A ...

to have your required error message

Please check out the excellent web2py documentation for forms and
validators http://web2py.com/books/default/chapter/29/7#Validators


On Feb 21, 12:51 pm, whowhywhat mads...@gmail.com wrote:
 You can also just write a jquery validator for the same..

 On Feb 21, 12:49 pm, whowhywhat mads...@gmail.com wrote:







  This should work. Although it is ugly (it gives a error message under
  all the checkboxes :P ).. but does validate as you require. Please
  check and let me know.

  def multi_check_box():
      form = FORM(TABLE(

  TR(Type:,TD(INPUT(_type=checkbox,_name=options,_value=a,_size=0,requires
  = IS_NOT_EMPTY()), A,

  INPUT(_type=checkbox,_name=options,_value=b,_size=0), B,

  INPUT(_type=checkbox,_name=options,_value=c,_size=0), C)),
              TR(,INPUT(_type=submit,_value=SUBMIT 
      if form.accepts(request.vars,session):

      return dict(form=form)

  On Feb 21, 11:09 am, Sanjeet Kumar sanjeet@gmail.com wrote:

   TR(Type:,(TD(INPUT(_type=checkbox,_name=a,_value=a,_size=0),A))),

   (TD(INPUT(_type=checkbox,_name=b,_value=b,_size=0),B)),

   (TD(INPUT(_type=checkbox,_name=c,_value=c,_size=0),C))),
   TR(,INPUT(_type=submit,_value=SUBMIT ))

   On Tue, Feb 21, 2012 at 11:28 AM, whowhywhat mads...@gmail.com wrote:
please could post your controller code..

On Feb 21, 10:32 am, Sanjeet Kumar sanjeet@gmail.com wrote:
 I have the multiple check-box in one row in Controller I want to 
 validate
 it form controller when the user submit his request without selecting 
 any
 of the check-box than it should be shown the error message Please 
 select
 at least one check-box


[web2py] Re: Validate the Checkbox

2012-02-21 Thread whowhywhat
Good tip Wikus..
you can also do the something similar with SQLFORM.factory and not
define in the model (that way no DB table is created)

in controller

MY_OPTIONS = [a,b,c]
form = SQLFORM.factory(
Field(my_options, list:string,
default=MY_OPTIONS,widget=SQLFORM.widgets.checkboxes.widget,
requires=[IS_IN_SET(MY_OPTIONS,
multiple=True),IS_NOT_EMPTY()]))
if form.accepts(request.vars):
#code to process form
return dict(form=form)


On Feb 21, 4:03 pm, Wikus van de Merwe dupakrop...@googlemail.com
wrote:
 The easiest way to do that is rely on web2py model - form transformation
 and use a validator (instead of the custom form).

 model
 --
 MY_OPTIONS = [a,b,c]
 db.define_table(my_table,
     db.Field(my_options, list:string, default=MY_OPTIONS))

 db.my_table.my_options.widget = SQLFORM.widgets.checkboxes.widget
 db.my_table.my_options.requires = [IS_IN_SET(MY_OPTIONS, multiple=True),
 IS_NOT_EMPTY()]

 controller
 --
 def my_function():
     if len(request.args):
         form=SQLFORM(db.my_table, request.args[0])
     else:
         form=SQLFORM(db.my_table)

     if form.accepts(request.vars):
         redirect(URL(r=request, f='my_next_function', args=[form.vars.id]))

     return {form:form}


[web2py] Re: Any way to make web2py SQLFORM.grid accept inserted fields?

2012-02-21 Thread whowhywhat
anybody .. please .. pretty please :)..

On Feb 21, 10:20 am, whowhywhat mads...@gmail.com wrote:
 I need a web2py SQLFORM.grid to accept and process based on some
 conditions, which need to be triggered based on some check boxes. I
 have inserted these checkboxes into the form by doing something like :

 In the controller -

 def my_grid():
 form = SQLFORM.grid()

 if  len(request.args)1 and (request.args[0]=='new' or 'edit') and
 (form.create_form or form.edit_form):
         my_extra_element = TR(TD(LABEL('Process x:'),
 _class='w2p_fl'), INPUT(_name='Do X', default=False,
             _value='on', _type='checkbox',_id='process_x'))
     if form.create_form:
         form.create_form[0].insert(-1,my_extra_element)
     if form.edit_form:
         form.edit_form[0].insert(-1,my_extra_element)
     if request.post_vars: session.tmp = request.post_vars
 return dict(form=form)

 Adding the custom elements is straight forward and easy..
 Is there some way to store and pass the value of the custom inserted
 check-box or any such customized form?
 I have tried many things.. but have not been successful so far.
 Any help is greatly appreciated :) ..


[web2py] Re: Any way to make web2py SQLFORM.grid accept inserted fields?

2012-02-21 Thread whowhywhat
Thanks a lot cliff! :) .. really appreciate it!

On Feb 21, 9:39 pm, Cliff cjk...@gmail.com wrote:
 ## Caveat beware sloppy syntax below
 ## DO NOT forget to validate!!

 def add_my_field(form):
   form.vars.myfield = request.post_vars.myfield

 # After defining the form but before returning the dict
 if form[0].process(onvalidation=add_my_field)
 On Feb 21, 10:09 am, whowhywhat mads...@gmail.com wrote:







  anybody .. please .. pretty please :)..

  On Feb 21, 10:20 am, whowhywhat mads...@gmail.com wrote:

   I need a web2py SQLFORM.grid to accept and process based on some
   conditions, which need to be triggered based on some check boxes. I
   have inserted these checkboxes into the form by doing something like :

   In the controller -

   def my_grid():
   form = SQLFORM.grid()

   if  len(request.args)1 and (request.args[0]=='new' or 'edit') and
   (form.create_form or form.edit_form):
           my_extra_element = TR(TD(LABEL('Process x:'),
   _class='w2p_fl'), INPUT(_name='Do X', default=False,
               _value='on', _type='checkbox',_id='process_x'))
       if form.create_form:
           form.create_form[0].insert(-1,my_extra_element)
       if form.edit_form:
           form.edit_form[0].insert(-1,my_extra_element)
       if request.post_vars: session.tmp = request.post_vars
   return dict(form=form)

   Adding the custom elements is straight forward and easy..
   Is there some way to store and pass the value of the custom inserted
   check-box or any such customized form?
   I have tried many things.. but have not been successful so far.
   Any help is greatly appreciated :) ..


[web2py] Any way to make web2py SQLFORM.grid accept inserted fields?

2012-02-20 Thread whowhywhat
I need a web2py SQLFORM.grid to accept and process based on some
conditions, which need to be triggered based on some check boxes. I
have inserted these checkboxes into the form by doing something like :

In the controller -

def my_grid():
form = SQLFORM.grid()

if  len(request.args)1 and (request.args[0]=='new' or 'edit') and
(form.create_form or form.edit_form):
my_extra_element = TR(TD(LABEL('Process x:'),
_class='w2p_fl'), INPUT(_name='Do X', default=False,
_value='on', _type='checkbox',_id='process_x'))
if form.create_form:
form.create_form[0].insert(-1,my_extra_element)
if form.edit_form:
form.edit_form[0].insert(-1,my_extra_element)
if request.post_vars: session.tmp = request.post_vars
return dict(form=form)

Adding the custom elements is straight forward and easy..
Is there some way to store and pass the value of the custom inserted
check-box or any such customized form?
I have tried many things.. but have not been successful so far.
Any help is greatly appreciated :) ..


[web2py] Re: Validate the Checkbox

2012-02-20 Thread whowhywhat
please could post your controller code..

On Feb 21, 10:32 am, Sanjeet Kumar sanjeet@gmail.com wrote:
 I have the multiple check-box in one row in Controller I want to validate
 it form controller when the user submit his request without selecting any
 of the check-box than it should be shown the error message Please select
 at least one check-box


[web2py] Re: Validate the Checkbox

2012-02-20 Thread whowhywhat
This should work. Although it is ugly (it gives a error message under
all the checkboxes :P ).. but does validate as you require. Please
check and let me know.

def multi_check_box():
form = FORM(TABLE(
 
TR(Type:,TD(INPUT(_type=checkbox,_name=options,_value=a,_size=0,requires
= IS_NOT_EMPTY()), A,
 
INPUT(_type=checkbox,_name=options,_value=b,_size=0), B,
 
INPUT(_type=checkbox,_name=options,_value=c,_size=0), C)),
TR(,INPUT(_type=submit,_value=SUBMIT 
if form.accepts(request.vars,session):

return dict(form=form)

On Feb 21, 11:09 am, Sanjeet Kumar sanjeet@gmail.com wrote:
 TR(Type:,(TD(INPUT(_type=checkbox,_name=a,_value=a,_size=0),A))),

 (TD(INPUT(_type=checkbox,_name=b,_value=b,_size=0),B)),

 (TD(INPUT(_type=checkbox,_name=c,_value=c,_size=0),C))),
 TR(,INPUT(_type=submit,_value=SUBMIT ))







 On Tue, Feb 21, 2012 at 11:28 AM, whowhywhat mads...@gmail.com wrote:
  please could post your controller code..

  On Feb 21, 10:32 am, Sanjeet Kumar sanjeet@gmail.com wrote:
   I have the multiple check-box in one row in Controller I want to validate
   it form controller when the user submit his request without selecting any
   of the check-box than it should be shown the error message Please select
   at least one check-box


[web2py] Re: Validate the Checkbox

2012-02-20 Thread whowhywhat
You can also just write a jquery validator for the same..

On Feb 21, 12:49 pm, whowhywhat mads...@gmail.com wrote:
 This should work. Although it is ugly (it gives a error message under
 all the checkboxes :P ).. but does validate as you require. Please
 check and let me know.

 def multi_check_box():
     form = FORM(TABLE(

 TR(Type:,TD(INPUT(_type=checkbox,_name=options,_value=a,_size=0,requires
 = IS_NOT_EMPTY()), A,

 INPUT(_type=checkbox,_name=options,_value=b,_size=0), B,

 INPUT(_type=checkbox,_name=options,_value=c,_size=0), C)),
             TR(,INPUT(_type=submit,_value=SUBMIT 
     if form.accepts(request.vars,session):

     return dict(form=form)

 On Feb 21, 11:09 am, Sanjeet Kumar sanjeet@gmail.com wrote:







  TR(Type:,(TD(INPUT(_type=checkbox,_name=a,_value=a,_size=0),A))),

  (TD(INPUT(_type=checkbox,_name=b,_value=b,_size=0),B)),

  (TD(INPUT(_type=checkbox,_name=c,_value=c,_size=0),C))),
  TR(,INPUT(_type=submit,_value=SUBMIT ))

  On Tue, Feb 21, 2012 at 11:28 AM, whowhywhat mads...@gmail.com wrote:
   please could post your controller code..

   On Feb 21, 10:32 am, Sanjeet Kumar sanjeet@gmail.com wrote:
I have the multiple check-box in one row in Controller I want to 
validate
it form controller when the user submit his request without selecting 
any
of the check-box than it should be shown the error message Please 
select
at least one check-box


[web2py] Re: BrowserID web2py authentication plugin done! Please test

2012-02-05 Thread whowhywhat
https://browserid.org/ .. seems to be working fine here. It is a
promising project in its infancy. I think they may have some teething
problems.
They won a rookie award at the 2011 black duck open software awards:
http://www.blackducksoftware.com/rookies/

Am sure every good web service has had its share of bad days..


On Feb 5, 6:47 pm, Alan Etkin spame...@gmail.com wrote:
 Congratulations. I tried to open the url of the project and it returns
 a 404 error.

 On 4 feb, 12:54, whowhywhat mads...@gmail.com wrote:







  Dear Web2py community,
  I just finished writing a web2py authentication plugin (custom
  authentication) to authenticate using BrowserID accounts (https://
  browserid.org). BrowserID is a project by Mozilla Labs
  (mozillalabs.org). It aims to provide a de-centralized, free, easy to
  use authentication method.
  BrowserID provides a nice alternative (or used side by side) to RPX,
  loginza, openID etc. personally, i feel BrowserIDs advantage is that
  you can use any email id verified by BrowserID.
  You can view the code here (https://code.google.com/p/browserid-web2py-
  plugin/source/browse/browserid_account.py).
  The browserid_account.py file needs to be in the gluon/contrib/
  login_methods/ folder. Usage is given in the doc string.

  Would love to hear your thoughts on BrowserID ..

  I have tested the plugin, everything seems to be working fine. Please
  test, look at the code and give me feedback, critique etc.. :). Please
  tell me if I am doing something wrong (security etc)

  Massimo I will email the patch to you in a few minutes.


[web2py] BrowserID web2py authentication plugin done! Please test

2012-02-04 Thread whowhywhat
Dear Web2py community,
I just finished writing a web2py authentication plugin (custom
authentication) to authenticate using BrowserID accounts (https://
browserid.org). BrowserID is a project by Mozilla Labs
(mozillalabs.org). It aims to provide a de-centralized, free, easy to
use authentication method.
BrowserID provides a nice alternative (or used side by side) to RPX,
loginza, openID etc. personally, i feel BrowserIDs advantage is that
you can use any email id verified by BrowserID.
You can view the code here (https://code.google.com/p/browserid-web2py-
plugin/source/browse/browserid_account.py).
The browserid_account.py file needs to be in the gluon/contrib/
login_methods/ folder. Usage is given in the doc string.

Would love to hear your thoughts on BrowserID ..

I have tested the plugin, everything seems to be working fine. Please
test, look at the code and give me feedback, critique etc.. :). Please
tell me if I am doing something wrong (security etc)

Massimo I will email the patch to you in a few minutes.


[web2py] Re: lungo.js

2012-02-04 Thread whowhywhat
wow! looks really cool. Thanks for sharing Massimo. I have been
playing a bit with Phonegap and JQTouch. This looks promising.

On Feb 3, 9:53 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 http://www.lungojs.com/


[web2py] Re: Mobile OTP authentication (motp) plugin for web2py

2012-01-30 Thread whowhywhat




Thanks for the suggestions Alan.

 There is a CRYPT helper object of web2py that can be instanitated with
 different options. It is used for standard authentication. (I am not
 sure if if can be of use for 
 AES)http://web2py.com/examples/static/epydoc/web2py.gluon.validators.CRYP...

I do not think CRYPT has AES. I am planning on writing a small
validator similar to CRYPT, but using AES. Will probably use the HMAC
key as the default encryption string

 Maybe you could make custom Auth forms and let the use choose the
 input sources. You could also call extra authentication object methods
 to pre-define options in the model. For this purpose, a paralell
 object available at the model should store the extra settings.

This is configured by the admin in the model definition. the admin has
to select the table and field mapping.
The problem is if some one has a totally different user auth table
defined or if they want to use username instead of email id
so how can i build that in the function (motp_auth)

 The model's auth standard instance hast special settings for handling
 on-authentication events. It should be possible to catch on-login
 events and return without storing data.

I need to check this out. Will try and figure it out and get back.
Thanks :)


[web2py] Re: Mobile OTP authentication (motp) plugin for web2py

2012-01-30 Thread whowhywhat
 motp_auth(..., userfield=email)

 And in the custom authentication code's query:

 db(db.auth_user[userfield] == value)...

Ahh yes :D .. will try that, thanks a lot!


[web2py] Mobile OTP authentication (motp) plugin for web2py

2012-01-29 Thread whowhywhat
just finished writing a motp (http://motp.sourceforge.net/)
authentication plugin for web2py. Where do i contribute this code?
I would appreciate if some one tests this and gives me some feedback.

I have uploaded the code to Google code. project is
https://web2py-motp-auth.googlecode.com
you can see the source here - 
https://code.google.com/p/web2py-motp-auth/source/browse/motp_auth.py

Some questions I had:
- is there any way to prevent web2py from storing the password in the
DB after a successful alternate login. One you authenticate with motp.
the motp password gets stored in the db. OTP means having an ever
changing password.

- does web2py have a standard AES api? i would like to (symmetrically)
encrypt the stored motp pin and motp secret. Or is it better i just
use a external python library?

- as of now the user database and user field is hard-coded to use
auth_user table and email field respectively. How can i make this
variable? (so a user can pass some other database table or field)

i also want to implement google authenticator (https://code.google.com/
p/google-authenticator/) auth for web2py. This is another OTP
solution. However for google authenticator, you need to use both your
site password and the OTP.. so a custom login for would be needed.
Would be great solution where that extra bit of security is needed. I
personally use google authenticator for my google accounts, and i
think the added security is a boon.

Would also appreciate your thoughts and comments on OTP in general

thanks web2py community.. :)


[web2py] Re: TIP: function to help with common filter usage

2012-01-29 Thread whowhywhat
nice tip. thanks for sharing!

On Jan 29, 1:51 pm, guruyaya guruy...@gmail.com wrote:
 I've made a mistake in my tip, please replace:
    db.comment._common_filter = inherit_common_filter(db, db.comment)
 with:
    db.comment._common_filter = inherit_common_filter(db,
 db.comment.post)

 Sorry for this one.

 On Jan 29, 10:46 am, guruyaya guruy...@gmail.com wrote:







  I wrote this function, to help out with a project I'm working on, that
  has an extensive use of the common filter functionality (describes in
  chapter 6 of the web2py book).
  Say you have a blog, containing active, and inactive posts:

  db.define_table('post',
   Field('subject'),
   Field('post','text'),
   Field('is_active','boolean'),
   common_filter = lambda query: db.post.is_active == True
  )

  And we have comments on posts:
  db.define_table('comment',
   Field('post',db.post),
   Field('comment','text')
  )

  Running db(db.comment.id  0).select(), will select all comments,
  including those posts where is_active is False.

  Solution:
  use this function in a model, module, whatever:

  def inherit_common_filter(db, col):
      ''' gets the common filter of a field refrenced
      '''
      ref_table_name = col.type.replace('reference ', '')
      ref_table = db[ref_table_name]
      ref_table_filter = ref_table._common_filter

      return lambda query:
  col.belongs(db(ref_table_filter(query))._select(ref_table.id))

  Now, the new model looks like:
  db.define_table('comment',
   Field('post',db.post),
   Field('comment','text')
  )
  db.comment._common_filter = inherit_common_filter(db, db.comment)

  Now Running db(db.comment.id  0).select(), will select all comments
  that are set to is_active == True.

  Hope you'll find this useful


[web2py] Re: Mobile OTP (motp) and other OTP login methods for web2py

2012-01-08 Thread whowhywhat
 I now have a foggy idea as to how motp (http://motp.sourceforge.net/)
can be implemented.. Here is how i think it should be done:

- extend the auth using define_table.. include 2 custom fields
motp_secret and motp_pin
- define a custom login method (say motp_auth).. should it be
something like the email_auth in the login methods under contrib/
login_methods ..?
- call the custom login method in model like

from gluon.contrib.login_methods.email_auth import email_auth
auth.settings.login_methods.append(motp_auth())

motp password can be calculated by creating  a lazy virtual field.
Calculated by
md5('epoch_time'[:-1]+'motp_secret'+'motp_pin').hexdigest()[:6]

now my question:
- how can i retrieve the motp_pin and motp_secret from the auth
username table in the custom login method?

am i on the right path? please correct me if i am wrong
please help..


On Jan 8, 11:56 am, whowhywhat mads...@gmail.com wrote:
 thanks a lot for the tip and recipe howsec.. will go through and
 try .. :)
 will postback

 On Jan 7, 9:54 pm, howesc how...@umich.edu wrote:







  sounds cool.

  the formula will be similar to what i did here to add facebook, twitter,
  google accounts auth to 
  web2py:http://www.web2pyslices.com/slices/take_slice/77

  obviously the custom methods will interact with OTP, but the formula should
  be similar.

  cfh


[web2py] Mobile OTP (motp) and other OTP login methods for web2py

2012-01-06 Thread whowhywhat
Dear web2py community,
I am interested in using motp (motp.sourceforge.net) / google
authenticator (http://code.google.com/p/google-authenticator/) with my
web2py apps. Both motp and google authenticator have clients available
for every possible platform (android, ios, blackberry, j2me, java,
windows phone.. etc)

Integrating an OTP system into web2py will boost the security of
web2py further :) ..
the implementation needs to be complete (including a user self
registration page)

Motp looks very simple to implement. the process is :
- the user installs the OTP client on their phone
- the OTP program is initialized ; this generates a secret key (which
is used while the user registers)
- The user also has to have a secret pin (this is also given while
registration)

the time on both the users phone and the server have to be more or
less in sync

to authenticate the user just enters the secret pin into the OTP
program on his phone, a OTP is generated
(The method the OTP is generated is simple .. a md5 sum hash of the
utc epoch time + secret string + pin is generated)
the user then uses the OTP to login .. on the server this OTP is
compared against OTP for the users secret string and key for a 2
minute window

an example python motp script is located here (http://
motp.sourceforge.net/motp.py)

My question is, how can we extend web2py auth to use motp ?
my guess is :
- need to extend the auth table to store the secret key and the secret
pin (encrypting them is a must i guess) .. how can i encrypt them with
say AES ..?
- then create a custom auth method, which will check the username and
the OTP generated by the motp program.. how can i extend auth to do
this?
- Also how do i extend the user registration page ..?

thanks in advance :) .. i would love to learn, develop and contribute
this to web2py..


[web2py] linux/unix control panel application - would be better if built with web2py

2011-12-19 Thread whowhywhat
http://ajenti.org .. looks interesting. However, would be much more
elegant and simpler to extend if built with web2py :D ..

another interesting python library/framework for remote sysadmin/
remote execution manager which i just came across is http://saltstack.org/
Looks very useful and more powerful / elegant than say fabric..



[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread whowhywhat
Thanks a lot for the prompt reply Cliff. The tip you gave me is something i 
did not know about and will be handy.. However this is useful to modify the 
grid in itself. I need some way to modify the subsequent Create, Edit and 
Update pages (if grid is editable). That is if i click on the add button 
(to create a new entry), i want to modify the Create form page (same with 
the edit/update pages). I dont know if I am missing something or am 
completely wrong :D .. so please humor me if so..
If i am not wrong the create form and edit form are generated using CRUD .. 
but how do i modify those resulting form/pages ..
Thanks in advance again.. :)
 


[web2py] Re: Pycharm 2 is out

2011-12-16 Thread whowhywhat
i voted  :) .. web2py deserves support from every decent IDE

[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread whowhywhat
i am trying to figure out the SQLFORM.grid from the source. The create and 
update forms are generated using SQLFORM and not crud.. my mistake thinking 
this was done by CRUD. I guess i will need to customize the form by passing 
form.create_form.append(whatever) .. is this the right way? .. i will try 
to figure it out. Please pardon me, i am just a self taught novice coder
 


[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread whowhywhat
:) .. that sounds right.. i guess i can just add some jquery in the view 
with a condition to check if the view is for edit or create form. The 
jquery could just insert the checkbox (if married etc.).. if checked i 
could use jquery to un-hide the spouse name field row. 
I will also try out the custom.widget method, but this sounds a little too 
laborious :D (i dont want to re-build the whole form).. is there a simpler 
way to just insert some extra elements like 
http://web2py.com/book/default/chapter/07#Adding-extra-form-elements-to-SQLFORM 
. 
I tried this, but this throws up an error (I will check and get back)
Thanks a lot Anthony and Cliff .. :D ..  any other tips ;) ?


[web2py] Re: Customizing SQLFORM.grid create, edit and update forms

2011-12-16 Thread whowhywhat
wow .. it works! :) ...

i just added the following in the controller (after calling SQLFORM.grid):

#check if form is a create form
if  len(request.args)1 and request.args[-2]=='new' and form.create_form:
my_extra_element = 
TR(LABEL('Married'),INPUT(_name='married',value=False,_type='checkbox'))
form.create_form[0].insert(-1,my_extra_element)

now i need to add some jquery in the view (again after checking if the view 
is for a create or edit form).. this is so cool :D ..
thanks a lot Anthony!

will post a full example later..


[web2py] Customizing SQLFORM.grid create, edit and update forms

2011-12-15 Thread whowhywhat
I could not find any post/documentation on how the create, edit and update 
forms generated by SQLFORM.grid could be customized. I am assuming that it 
is similar to CRUD form customization. However I have not been able to 
figure it out.
For example if i wished to have a optional field exposed upon a condition 
(optional spouses name if person is married, as shown in some web2py 
examples), how could this be done in SQLFORM.grid ? 

thanks in advance :) 

p.s:
web2py is shaping up beautifully .. hats off to Massimo, Antony and others 
.. 
I advocate web2py to any and everyone who is into web development.. thanks 
a lot!



[web2py] Re: Offline Access to web2py manual?

2011-11-09 Thread whowhywhat
use the Firefox scrapbook extension (https://addons.mozilla.org/en-US/
firefox/addon/scrapbook/)..
that way you could annotate, highlight etc.

On Nov 10, 4:21 am, BrendanC bren...@gmail.com wrote:
 I don't mind buying the updated docs once they are available. (I'm thinking
 of some sort of local website copy).Meanwhile if there anyway to capture a
 local version of the manual for browsing that I can access when I don't
 have online access?

 I know there is a pdf doc available, but afaik it's pretty out of date.

 TIA,
 BrendanC


[web2py] Re: looking for web2py users in Mumbai

2011-02-21 Thread whowhywhat
im located at Ahmedabad about 340 miles from Mumbai

On Feb 21, 10:43 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 If you are there please contact me.

 Massimo


[web2py] web2py openid login using google account/google for your domain

2011-02-17 Thread whowhywhat
i want to try and avoid using janrain RPX. Is it possible to use
openid authentication for web2py and use the google accounts by
passing the google accounts openid URL (https://www.google.com/
accounts/o8/id). I tried using the example given in the web2py book
(chapter 8), but this does not seem to work. How can i let users login
with their google for your domain accounts? One option would be the
SMTP method, but i would prefer to use something like openid. Can
oauth be used for google?


[web2py] Re: web2py not using global http_proxy

2011-02-15 Thread whowhywhat
i have documented the steps i took to install web2py with Cherokee and
uwsgi in a public Google document. please find the document here
http://goo.gl/ixsL7 . please pardon me for making it a google doc as i
have included several screenshots.
please go through it, test it and suggest any corrections/changes etc.
Hope it helps.


On Feb 14, 11:01 pm, Luis Díaz diazluis2...@gmail.com wrote:
 Greetings.
 I'm waiting for the documentation ;)

 Díaz Luis
 TSU Analisis de Sistemas
 Universidad de Carabobo

 Facultad de 
 Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=ar...

 2011/2/14 whowhywhat mads...@gmail.com







  Solved the problem! :) .. wsgi has a option to explicitly pass an
  environment variable (given in the commandline).
  Once i passed the http_proxy variable by this method web2py works
  fine.
   I think the default uwsgi wizzard in cherokee is broken. I had to
  define a custom source to get uwsgi + web2py to work.
  i finally have cherokee + uwsgi + web2py working absolutely fine (with
  proxy etc.)
  will document everything and post it. thanks for everything.

  On Feb 12, 8:47 pm, whowhywhat mads...@gmail.com wrote:
   Luis i did use the web2py auto config script to try out apache with
   WSGI.
   I too noticed that apache seems to hog memory (as compared to
   cherokee). I think Cherokee is a great web server as its documentation
   is really good.
   I will surely document how i set up Cherokee + WSGI + web2py and post
   it here or on the web2py wiki.
   i was seeing a total memory consumption of under 150MB with Cherokee,
   WSGI and web2py (4 WSGI processes)
   i have done this on my work machine (running turnkey Linux (based on
   Ubuntu 10.04) in a virtualbox). i will document and post what i have
   done on Monday (14th feb 2010)

   On Feb 12, 6:10 pm, Luis Díaz diazluis2...@gmail.com wrote:

I'm using a virtualization solution. (Proxmox)

I have a debian server 5,
installed by minimal changes in the script
Setup web2py + apache + ssl + mod_wsgi + postgresql in FEW seconds
I do not use postgresql on this server.

I have another server with debian virtualized 5 and in this I have
configured to allow external connections postgresql

I noticed a 638Mb memory consumption on the first server without
ejecutandoce web2py applications.

could comment as configurastes web2py and Cherokee

I want to lose the memory consumption and increase performance.

2011/2/12 whowhywhat mads...@gmail.com

 Thanks for the quick replies.
 As Luis mentions i have used export http_proxy (but in /etc/
 environment and in the startup script of cherokee). I will try
 defining in /etc/profile
 i did some further testing by launching web2py with its own web
 server.
 by running python web2py.py -c server.crt -k server.key -a password
  -
 i IPADDRESS -p 
 This way web2py uses the proxy seamlessly (It works fine!)

 but when i deploy using wsgi either in apache or cherokee web2py does
 not see the proxy. what could be wrong? where is this problem
 occurring?

 Luis .. which is the web server and cgi setup you are using?

 i am really impressed with the speed of cherokee + wsgi + web2py, the
 memory foot print is small and the whole thing runs like greased
 lightning :D .. i just hope to solve this proxy issue.

 On Feb 11, 10:50 pm, Luis Díaz diazluis2...@gmail.com wrote:
  I forgot.
  if you need to specify username and password
  then the structure would be something.

  export http_proxy =http://username:password@proxy:port/
  export https_proxy =http://username:password@proxy:port/
  export ftp_proxy =http://username:password@proxy:port/

  2011/2/11 Luis Díaz diazluis2...@gmail.com

   Greetings,
   web2py I mention that I use in my work.
   and we have a proxy that we restrict the output
   by user name and password

   I have solved the problem properly configuring the proxy on the
 computer
   where I have installed debian web2py

   nano /etc/profile

   adding the following lines:

   export http_proxy =http://proxy.uc.edu.ve:5010/
   export https_proxy =http://proxy.uc.edu.ve:5010/
   export ftp_proxy =http://proxy.uc.edu.ve:5010/

   2011/2/11 Massimo Di Pierro massimo.dipie...@gmail.com

   Thanks for your comments.

   WHen you need urllib, and web2py.python makes outbound
  connections you
   should not need a proxy server or any proxy configuration as far
  as I
   can tell (and I am not sure about your setup). This looks more
  of a
   firewall issue.

   On Feb 11, 5:19 am, whowhywhat mads...@gmail.com wrote:
web2py is the first framework i actually enjoy using. :) ..
  been
advocating it to everyone i meet these days. I sincerely thank
  the
entire web2py community for everything.

I have been developing a small

[web2py] Re: web2py not using global http_proxy

2011-02-13 Thread whowhywhat
Solved the problem! :) .. wsgi has a option to explicitly pass an
environment variable (given in the commandline).
Once i passed the http_proxy variable by this method web2py works
fine.
 I think the default uwsgi wizzard in cherokee is broken. I had to
define a custom source to get uwsgi + web2py to work.
i finally have cherokee + uwsgi + web2py working absolutely fine (with
proxy etc.)
will document everything and post it. thanks for everything.

On Feb 12, 8:47 pm, whowhywhat mads...@gmail.com wrote:
 Luis i did use the web2py auto config script to try out apache with
 WSGI.
 I too noticed that apache seems to hog memory (as compared to
 cherokee). I think Cherokee is a great web server as its documentation
 is really good.
 I will surely document how i set up Cherokee + WSGI + web2py and post
 it here or on the web2py wiki.
 i was seeing a total memory consumption of under 150MB with Cherokee,
 WSGI and web2py (4 WSGI processes)
 i have done this on my work machine (running turnkey Linux (based on
 Ubuntu 10.04) in a virtualbox). i will document and post what i have
 done on Monday (14th feb 2010)

 On Feb 12, 6:10 pm, Luis Díaz diazluis2...@gmail.com wrote:

  I'm using a virtualization solution. (Proxmox)

  I have a debian server 5,
  installed by minimal changes in the script
  Setup web2py + apache + ssl + mod_wsgi + postgresql in FEW seconds
  I do not use postgresql on this server.

  I have another server with debian virtualized 5 and in this I have
  configured to allow external connections postgresql

  I noticed a 638Mb memory consumption on the first server without
  ejecutandoce web2py applications.

  could comment as configurastes web2py and Cherokee

  I want to lose the memory consumption and increase performance.

  2011/2/12 whowhywhat mads...@gmail.com

   Thanks for the quick replies.
   As Luis mentions i have used export http_proxy (but in /etc/
   environment and in the startup script of cherokee). I will try
   defining in /etc/profile
   i did some further testing by launching web2py with its own web
   server.
   by running python web2py.py -c server.crt -k server.key -a password -
   i IPADDRESS -p 
   This way web2py uses the proxy seamlessly (It works fine!)

   but when i deploy using wsgi either in apache or cherokee web2py does
   not see the proxy. what could be wrong? where is this problem
   occurring?

   Luis .. which is the web server and cgi setup you are using?

   i am really impressed with the speed of cherokee + wsgi + web2py, the
   memory foot print is small and the whole thing runs like greased
   lightning :D .. i just hope to solve this proxy issue.

   On Feb 11, 10:50 pm, Luis Díaz diazluis2...@gmail.com wrote:
I forgot.
if you need to specify username and password
then the structure would be something.

export http_proxy =http://username:password@proxy:port/
export https_proxy =http://username:password@proxy:port/
export ftp_proxy =http://username:password@proxy:port/

2011/2/11 Luis Díaz diazluis2...@gmail.com

 Greetings,
 web2py I mention that I use in my work.
 and we have a proxy that we restrict the output
 by user name and password

 I have solved the problem properly configuring the proxy on the
   computer
 where I have installed debian web2py

 nano /etc/profile

 adding the following lines:

 export http_proxy =http://proxy.uc.edu.ve:5010/
 export https_proxy =http://proxy.uc.edu.ve:5010/
 export ftp_proxy =http://proxy.uc.edu.ve:5010/

 2011/2/11 Massimo Di Pierro massimo.dipie...@gmail.com

 Thanks for your comments.

 WHen you need urllib, and web2py.python makes outbound connections 
 you
 should not need a proxy server or any proxy configuration as far as I
 can tell (and I am not sure about your setup). This looks more of a
 firewall issue.

 On Feb 11, 5:19 am, whowhywhat mads...@gmail.com wrote:
  web2py is the first framework i actually enjoy using. :) .. been
  advocating it to everyone i meet these days. I sincerely thank the
  entire web2py community for everything.

  I have been developing a small web2py application for intranet use
   at
  the place where i work. During development i used windows (i carry
  web2py on a thumb drive). At work we use a proxy for net access and
   in
  windows i have no problems with web2py accessing the net using the
  proxy.
  I can use urllib to fetch webpages etc.

  To deploy the app i am using Ubuntu. I have deployed web2py using
   both
  apache as well as Cherokee using WSGI. The application runs fine.
  however the web2py environment is not able to fetch anything from
   the
  internet. urllib does not fetch any webpages. I have explicitly set
  the http_proxy environment variable (in /etc/environment, in the
  Cherokee startup script). I need to fetch data from the web, mostly
  for openID authentication. I am

[web2py] Re: web2py not using global http_proxy

2011-02-12 Thread whowhywhat
Luis i did use the web2py auto config script to try out apache with
WSGI.
I too noticed that apache seems to hog memory (as compared to
cherokee). I think Cherokee is a great web server as its documentation
is really good.
I will surely document how i set up Cherokee + WSGI + web2py and post
it here or on the web2py wiki.
i was seeing a total memory consumption of under 150MB with Cherokee,
WSGI and web2py (4 WSGI processes)
i have done this on my work machine (running turnkey Linux (based on
Ubuntu 10.04) in a virtualbox). i will document and post what i have
done on Monday (14th feb 2010)

On Feb 12, 6:10 pm, Luis Díaz diazluis2...@gmail.com wrote:
 I'm using a virtualization solution. (Proxmox)

 I have a debian server 5,
 installed by minimal changes in the script
 Setup web2py + apache + ssl + mod_wsgi + postgresql in FEW seconds
 I do not use postgresql on this server.

 I have another server with debian virtualized 5 and in this I have
 configured to allow external connections postgresql

 I noticed a 638Mb memory consumption on the first server without
 ejecutandoce web2py applications.

 could comment as configurastes web2py and Cherokee

 I want to lose the memory consumption and increase performance.

 2011/2/12 whowhywhat mads...@gmail.com









  Thanks for the quick replies.
  As Luis mentions i have used export http_proxy (but in /etc/
  environment and in the startup script of cherokee). I will try
  defining in /etc/profile
  i did some further testing by launching web2py with its own web
  server.
  by running python web2py.py -c server.crt -k server.key -a password -
  i IPADDRESS -p 
  This way web2py uses the proxy seamlessly (It works fine!)

  but when i deploy using wsgi either in apache or cherokee web2py does
  not see the proxy. what could be wrong? where is this problem
  occurring?

  Luis .. which is the web server and cgi setup you are using?

  i am really impressed with the speed of cherokee + wsgi + web2py, the
  memory foot print is small and the whole thing runs like greased
  lightning :D .. i just hope to solve this proxy issue.

  On Feb 11, 10:50 pm, Luis Díaz diazluis2...@gmail.com wrote:
   I forgot.
   if you need to specify username and password
   then the structure would be something.

   export http_proxy =http://username:password@proxy:port/
   export https_proxy =http://username:password@proxy:port/
   export ftp_proxy =http://username:password@proxy:port/

   2011/2/11 Luis Díaz diazluis2...@gmail.com

Greetings,
web2py I mention that I use in my work.
and we have a proxy that we restrict the output
by user name and password

I have solved the problem properly configuring the proxy on the
  computer
where I have installed debian web2py

nano /etc/profile

adding the following lines:

export http_proxy =http://proxy.uc.edu.ve:5010/
export https_proxy =http://proxy.uc.edu.ve:5010/
export ftp_proxy =http://proxy.uc.edu.ve:5010/

2011/2/11 Massimo Di Pierro massimo.dipie...@gmail.com

Thanks for your comments.

WHen you need urllib, and web2py.python makes outbound connections you
should not need a proxy server or any proxy configuration as far as I
can tell (and I am not sure about your setup). This looks more of a
firewall issue.

On Feb 11, 5:19 am, whowhywhat mads...@gmail.com wrote:
 web2py is the first framework i actually enjoy using. :) .. been
 advocating it to everyone i meet these days. I sincerely thank the
 entire web2py community for everything.

 I have been developing a small web2py application for intranet use
  at
 the place where i work. During development i used windows (i carry
 web2py on a thumb drive). At work we use a proxy for net access and
  in
 windows i have no problems with web2py accessing the net using the
 proxy.
 I can use urllib to fetch webpages etc.

 To deploy the app i am using Ubuntu. I have deployed web2py using
  both
 apache as well as Cherokee using WSGI. The application runs fine.
 however the web2py environment is not able to fetch anything from
  the
 internet. urllib does not fetch any webpages. I have explicitly set
 the http_proxy environment variable (in /etc/environment, in the
 Cherokee startup script). I need to fetch data from the web, mostly
 for openID authentication. I am not sure what's wrong.

 how can i make web2py/python use the proxy server (http_proxy)?

--
Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo

Facultad de Odontología
 http://www.odontologia.uc.edu.ve/index.php?option=com_contentview=ar...

   --
   Díaz Luis
   TSU Analisis de Sistemas
   Universidad de Carabobo

   Facultad de Odontología
 http://www.odontologia.uc.edu.ve/index.php?option=com_contentview=ar...

 --
 Díaz Luis
 TSU Analisis de Sistemas
 Universidad de Carabobo

 Facultad de 
 Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option

[web2py] web2py not using global http_proxy

2011-02-11 Thread whowhywhat
web2py is the first framework i actually enjoy using. :) .. been
advocating it to everyone i meet these days. I sincerely thank the
entire web2py community for everything.

I have been developing a small web2py application for intranet use at
the place where i work. During development i used windows (i carry
web2py on a thumb drive). At work we use a proxy for net access and in
windows i have no problems with web2py accessing the net using the
proxy.
I can use urllib to fetch webpages etc.

To deploy the app i am using Ubuntu. I have deployed web2py using both
apache as well as Cherokee using WSGI. The application runs fine.
however the web2py environment is not able to fetch anything from the
internet. urllib does not fetch any webpages. I have explicitly set
the http_proxy environment variable (in /etc/environment, in the
Cherokee startup script). I need to fetch data from the web, mostly
for openID authentication. I am not sure what's wrong.

how can i make web2py/python use the proxy server (http_proxy)?


[web2py] Re: web2py not using global http_proxy

2011-02-11 Thread whowhywhat
Thanks for the quick replies.
As Luis mentions i have used export http_proxy (but in /etc/
environment and in the startup script of cherokee). I will try
defining in /etc/profile
i did some further testing by launching web2py with its own web
server.
by running python web2py.py -c server.crt -k server.key -a password -
i IPADDRESS -p 
This way web2py uses the proxy seamlessly (It works fine!)

but when i deploy using wsgi either in apache or cherokee web2py does
not see the proxy. what could be wrong? where is this problem
occurring?

Luis .. which is the web server and cgi setup you are using?

i am really impressed with the speed of cherokee + wsgi + web2py, the
memory foot print is small and the whole thing runs like greased
lightning :D .. i just hope to solve this proxy issue.

On Feb 11, 10:50 pm, Luis Díaz diazluis2...@gmail.com wrote:
 I forgot.
 if you need to specify username and password
 then the structure would be something.

 export http_proxy =http://username:password@proxy:port/
 export https_proxy =http://username:password@proxy:port/
 export ftp_proxy =http://username:password@proxy:port/

 2011/2/11 Luis Díaz diazluis2...@gmail.com









  Greetings,
  web2py I mention that I use in my work.
  and we have a proxy that we restrict the output
  by user name and password

  I have solved the problem properly configuring the proxy on the computer
  where I have installed debian web2py

  nano /etc/profile

  adding the following lines:

  export http_proxy =http://proxy.uc.edu.ve:5010/
  export https_proxy =http://proxy.uc.edu.ve:5010/
  export ftp_proxy =http://proxy.uc.edu.ve:5010/

  2011/2/11 Massimo Di Pierro massimo.dipie...@gmail.com

  Thanks for your comments.

  WHen you need urllib, and web2py.python makes outbound connections you
  should not need a proxy server or any proxy configuration as far as I
  can tell (and I am not sure about your setup). This looks more of a
  firewall issue.

  On Feb 11, 5:19 am, whowhywhat mads...@gmail.com wrote:
   web2py is the first framework i actually enjoy using. :) .. been
   advocating it to everyone i meet these days. I sincerely thank the
   entire web2py community for everything.

   I have been developing a small web2py application for intranet use at
   the place where i work. During development i used windows (i carry
   web2py on a thumb drive). At work we use a proxy for net access and in
   windows i have no problems with web2py accessing the net using the
   proxy.
   I can use urllib to fetch webpages etc.

   To deploy the app i am using Ubuntu. I have deployed web2py using both
   apache as well as Cherokee using WSGI. The application runs fine.
   however the web2py environment is not able to fetch anything from the
   internet. urllib does not fetch any webpages. I have explicitly set
   the http_proxy environment variable (in /etc/environment, in the
   Cherokee startup script). I need to fetch data from the web, mostly
   for openID authentication. I am not sure what's wrong.

   how can i make web2py/python use the proxy server (http_proxy)?

  --
  Díaz Luis
  TSU Analisis de Sistemas
  Universidad de Carabobo

  Facultad de 
  Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=ar...

 --
 Díaz Luis
 TSU Analisis de Sistemas
 Universidad de Carabobo

 Facultad de 
 Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=ar...