[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 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(): >     f

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

[web2py] Re: Enable and disable links in a view.

2012-02-20 Thread Annet
Hi Alan, Thanks for your explanation. I got the idea now, and I think your solution is easier to implement when I replace the divs containing the links with list items. Best regards, Annet

[web2py] Re: Passing arg from view to controller.

2012-02-20 Thread Annet
Hi Anthony, Thanks for your reply. > $(function() { > $("#no_table_locality_args").autocomplete({ > source: "{{=URL('hubaddressbook', 'locality_args_autocomplete')}}" + > "/" + $(select#no_table_word).val(), I tried the above, which made the view's JavaScript invalid, I had to add '' to ma

[web2py] Re: Passing arg from view to controller.

2012-02-20 Thread Annet
Hi Anthony, Thanks for your reply. > $(function() { >   $("#no_table_locality_args").autocomplete({ >     source: "{{=URL('hubaddressbook', 'locality_args_autocomplete')}}" + > "/" + $(select#no_table_word).val(), I tried the above, which made the view's JavaScript invalid, I had to add '' to ma

[web2py] Re: BELONGS is not supported on GAE?

2012-02-20 Thread guruyaya
I think inner select belongs are not supported by GAE, but using an array, is. Can anyone confirm what I just said (read the code, didn't test it). On 21 פברואר, 08:06, "Peter G." wrote: > I'm trying to obtain a set of rows whose ID values belongs in rows' > fields of another table. > > Here's t

[web2py] Re: New member and new to web2py and need some clarification about file paths.

2012-02-20 Thread RKS
Thanks guys. @Massimo The

Re: [web2py] Re: Web2py Code University and Officaial Certify Training

2012-02-20 Thread ramkrishan bhatt
The main Idea is the following:- In India final year of the education as per University syllabus concern , student need to have industrial training. And the sack of the certificate, due to less number of perfect education they stuck in greedy consultant. Who's giving certificate and takes money fro

Re: [web2py] Re: Validate the Checkbox

2012-02-20 Thread Sanjeet Kumar
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, whowh

[web2py] BELONGS is not supported on GAE?

2012-02-20 Thread Peter G.
I'm trying to obtain a set of rows whose ID values belongs in rows' fields of another table. Here's the code: # Construct a query to fetch all the mootid's from the group mootGroup = db(db.moot_groups.gid==groupid)._select(db.moot_groups.mootid) # Gets moots only if the moot ID exists in the Grou

[web2py] Re: Validate the Checkbox

2012-02-20 Thread whowhywhat
please could post your controller code.. On Feb 21, 10:32 am, Sanjeet Kumar 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 "

[web2py] Validate the Checkbox

2012-02-20 Thread Sanjeet Kumar
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] 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 (re

[web2py] Re: unable to call ajax url from external javascript.

2012-02-20 Thread Vineet
In your statement -- ajax("{{=URL(r=request,c='control2',f='function1')}}"['name'],'target'); comma is missing after URL and before ['name']. Check whether it is a typo or otherwise. Secondly, double check whether the external js file is included in the header section of layout.html -- Vineet O

[web2py] Re: unable to call ajax url from external javascript.

2012-02-20 Thread Vineet
In your statement -- ajax("{{=URL(r=request,c='control2',f='function1')}}"['name'],'target'); comma is missing after URL and before ['name']. Check whether it is a typo or otherwise. -- Vineet On Feb 21, 1:01 am, Alan Etkin wrote: > Maybe wrapping the code in jQuery(document).ready() the execut

[web2py] Re: how to modify scaffolding form for a specific model

2012-02-20 Thread Anthony
Here are some options: http://stackoverflow.com/questions/8146260/best-practice-for-populating-dropdown-based-on-other-dropdown-selection-in-web2p/8152910#8152910 Anthony On Sunday, February 19, 2012 2:41:14 PM UTC-5, Can Candan wrote: > > I am willing to extend the behavior of the autogenerate

[web2py] Re: New member and new to web2py and need some clarification about file paths.

2012-02-20 Thread Massimo Di Pierro
You have two options: click me or {{=A('click me',_href=URL('page'))}} Notice it is {{=URL('page')}}, not {{URL('page')}} Hope this helps. On Feb 20, 8:13 pm, RKS wrote: > Hello. Coming over from the php world and I started a new job where we > use web2py and python. I'm trying to wrap my he

[web2py] New member and new to web2py and need some clarification about file paths.

2012-02-20 Thread RKS
Hello. Coming over from the php world and I started a new job where we use web2py and python. I'm trying to wrap my head around how it's handling the paths to pages I create and I can't find my answers in the docs. Probably I'm just missing it but I can't seem to figure it out. I've already create

[web2py] Re: crontab sytax

2012-02-20 Thread web-dev-m
I apologize, this should have been in my original post. For more specifics, my crontab file has only one line in it: @reboot root python web2py.py -S test -M -N -R applications/test/ controllers/private.py I have tried to restart the server multiple times, to no avail with getting this process w

[web2py] Re: how to modify scaffolding form for a specific model

2012-02-20 Thread Alan Etkin
I'd check if it is not developed yet (for example in web2pyslices or here http://dev.s-cubism.com/web2py_plugins#plugin_rating_widget) On 19 feb, 16:41, Can Candan wrote: > I am willing to extend the behavior of the autogenerated crud interface > just for one table so that when the dropdown corre

[web2py] Re: Enable and disable links in a view.

2012-02-20 Thread Alan Etkin
The code is pretty extense, but I think that there is no need to set conditional css and script tags. I'd put template syntax sentences in views for alternating A with P tags (or wathever tag suits the style needs for the site) and changing the class attribute for each page item. That grants you th

[web2py] Re: Web2Py/Google App Engine Apps - How to get ID or key after Inserting New Rec

2012-02-20 Thread BrendanC
Just did some more testing -insert works OK, but bulk insert fails. FWIW I think this was previously reported as a problem. Here;s a link: https://groups.google.com/forum/#!searchin/web2py/bulk$20insert$20mapping/web2py/k9Pa2EdHNeA/1mcHn6bCWw4J

[web2py] Re: Web2py + amfrpc3 + clean flash

2012-02-20 Thread Marek Mollin
Does anyone have any working example in plain Actionscript 3 ? As I try numerous attempts but cant get web2py to provide amf gateway. On 21 Lut, 00:23, Marek Mollin wrote: > Also does not work with:http://pastebin.com/Ghn2yNkV > > I hope anyone can help me... > > On 20 Lut, 23:01, Marek Mollin w

[web2py] Re: Web2py + amfrpc3 + clean flash

2012-02-20 Thread Marek Mollin
Also does not work with: http://pastebin.com/Ghn2yNkV I hope anyone can help me... On 20 Lut, 23:01, Marek Mollin wrote: > Hey, > I have a problem. I am trying to work with clean flash or as3 if you > will. > The issue I am bumping into is null asynctoken.result. > > ** AS3 code: > > import mx.r

[web2py] crontab sytax

2012-02-20 Thread web-dev-m
Hey everyone, I'm trying to figure out how to run a background process and write a very simple script to test it. It's not working, and I can't seem to find the right syntax. The link in the web2py book is broken. Can anyone break it down for me or is there an updated link? Thanks!

[web2py] Re: Using Web2Py Shell with Google App Engine App- Does this work?

2012-02-20 Thread howesc
while i never tried to make it work, the other thread suggests that the GAE libs are not on your path. using the launcher install on OSX i think i would have to add "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine"

[web2py] Web2py + amfrpc3 + clean flash

2012-02-20 Thread Marek Mollin
Hey, I have a problem. I am trying to work with clean flash or as3 if you will. The issue I am bumping into is null asynctoken.result. ** AS3 code: import mx.rpc.remoting.RemoteObject; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.utils.RpcClassAliasInitializer; imp

[web2py] Re: Web2Py/Google App Engine Apps - How to get ID or key after Inserting New Rec

2012-02-20 Thread Anthony
How are you inserting the record? The .insert() method returns the id of the inserted record, and .bulk_insert() returns a list of id's. On Monday, February 20, 2012 4:47:45 PM UTC-5, BrendanC wrote: > > I want to build a mapping/xref/intersect table that needs to be updated > after a new recor

[web2py] Web2Py/Google App Engine Apps - How to get ID or key after Inserting New Rec

2012-02-20 Thread BrendanC
I want to build a mapping/xref/intersect table that needs to be updated after a new record insert. For that I need the key or id of the last inserted record. Is this available with the DAL/GAE? Elsewhere I have seen an issue where this did not work with a bulk insert. Unfortunately, this is no

[web2py] Re: Web2py Code University and Officaial Certify Training

2012-02-20 Thread Alan Etkin
> I have thought to implement this task for the building and filtering the > perfect candidates on web technology Would you please clarify that line?. I can't get the central idea of the message.

[web2py] Re: Check if request method is post

2012-02-20 Thread Alan Etkin
This command returns a string with the method name (uppercase) request.env.request_method On 20 feb, 17:26, Hassan Alnatour wrote: > Dear All , > > How can i check if the request method is post ?

[web2py] Re: Check if request method is post

2012-02-20 Thread Anthony
Also, if request.post_vars is not None, then it is a post request -- so you could do something like: if request.post_vars: [do something with POST request variables] Note, request.vars contains both request.get_vars and request.post_vars. Anthony On Monday, February 20, 2012 3:35:23 PM UTC

[web2py] Creating Model extractor for Oracle and need some help/advice

2012-02-20 Thread Larry Schwerzler
I thought I had posted this about an hour ago but don't see it as a topic so I'll repost. Forgive if this is a duplicate. I'm trying to build an Oracle version of the extract_mysql_models.py and extract_pgsql_models.py, these files look at a currently existing database and write out a web

[web2py] Re: validating computed field

2012-02-20 Thread Anthony
On Monday, February 20, 2012 3:31:29 PM UTC-5, Alan Etkin wrote: > > Great! Thanks for your quick answer. I really don't understand > completely what does IS_NOT_IN_DB, I just copy/pasted the code and it > works perfectly. I'll check the documentation and the API for detailed > info. > The firs

[web2py] Re: Check if request method is post

2012-02-20 Thread Niphlod
the method is stored into request.env.request_method . So request.env.request_method == 'POST' is what you're looking for

[web2py] Re: web2py + GAE memory usage

2012-02-20 Thread howesc
it does not seem to make a difference, so it is something else...

[web2py] Re: validating computed field

2012-02-20 Thread Alan Etkin
Great! Thanks for your quick answer. I really don't understand completely what does IS_NOT_IN_DB, I just copy/pasted the code and it works perfectly. I'll check the documentation and the API for detailed info. Thanks again On 20 feb, 17:06, Anthony wrote: > > db.combinada.primero.requires = > >

[web2py] Check if request method is post

2012-02-20 Thread Hassan Alnatour
Dear All , How can i check if the request method is post ?

[web2py] Re: validating computed field

2012-02-20 Thread Anthony
> > db.combinada.primero.requires = > [IS_NOT_IN_DB(db(db.combinada.combinado==str(request.vars.primero) > +str(request.vars.segundo)), "combinada.combinado"), IS_NOT_EMPTY()] > The value of request.vars.primero will be passed to the above IS_NOT_IN_DB validator, but it is then comparing that

[web2py] Re: unable to call ajax url from external javascript.

2012-02-20 Thread Alan Etkin
Maybe wrapping the code in jQuery(document).ready() the execution is delayed enough time for the web2py functions to be read. On 20 feb, 12:08, Pradeesh wrote: > I am new to web2py. > form my view i am able to call web2py ajax as " > ajax("{{=URL(r=request,c='control2',f='function1')}}"['name'],'

[web2py] Using Web2Py Shell with Google App Engine App- Does this work?

2012-02-20 Thread BrendanC
In an earlier thread someone tried to use the shell to do some interactive testing on a GAE app but kept getting error 'gae' not defined. I'm also getting the same error. Anyone out got this working? https://groups.google.com/forum/?fromgroups#!searchin/web2py/gae$20shell/web2py/mg5ICyEjTCg/9WN

[web2py] Re: http://people.csail.mit.edu/pgbovine/python/tutor.html#mode=visualize

2012-02-20 Thread Alan Etkin
My bad, and Imput should be Input :P On 20 feb, 15:11, Anthony wrote: > > Imput: > > > import os > > print os.getcwd() > > > Output: > > > ImportError: __import__ not found > > "This application supports the core Python > 2.5language, with no module imports or fil

[web2py] Re: validating computed field

2012-02-20 Thread Alan Etkin
I looked at the code posted in stackoverflow, but it's behaving the same as the former model, perhaps I am not implementing the example correctly: This is the new model: db.define_table("combinada", Field("combinado", requires=IS_NOT_EMPTY(), compute=lambda row: row.primero+row.segundo, unique=Tr

[web2py] Re: http://people.csail.mit.edu/pgbovine/python/tutor.html#mode=visualize

2012-02-20 Thread Anthony
> > Imput: > > import os > print os.getcwd() > > Output: > > ImportError: __import__ not found > "This application supports the core Python 2.5language, with no module imports or file I/O. It's meant to be used as a platform for creating programming tutorial

[web2py] Re: validating computed field

2012-02-20 Thread Anthony
One option is to use an "onvalidation" function with your form: http://web2py.com/books/default/chapter/29/7#onvalidation. In your onvalidation function, you can re-use the field's compute function by calling it with form.vars as its argument: def my_onvalidation(form): combinada = db.combi

[web2py] Re: http://people.csail.mit.edu/pgbovine/python/tutor.html#mode=visualize

2012-02-20 Thread Alan Etkin
Imput: import os print os.getcwd() Output: ImportError: __import__ not found On 20 feb, 06:33, António Ramos wrote: > nice tool > > http://people.csail.mit.edu/pgbovine/python/tutor.html#mode=visualize

[web2py] validating computed field

2012-02-20 Thread Alan Etkin
I want to define a table that has a compound field which concatenates data from two different field values on form submission. In addition, I would like to check the database on validation to make sure that the current record is the only to have that "combinada" field value. The unique argument res

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
Many thanks again Anthony, I will look into both your suggestions, I may be gone sometime. LOL.

[web2py] Re: unable to call ajax url from external javascript.

2012-02-20 Thread Anthony
On Monday, February 20, 2012 10:08:42 AM UTC-5, Pradeesh wrote: > > I am new to web2py. > form my view i am able to call web2py ajax as " > ajax("{{=URL(r=request,c='control2',f='function1')}}"['name'],'target'); > ". But the same command is not working from an external javascript. > How can i

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Anthony
On Monday, February 20, 2012 10:08:26 AM UTC-5, Edward Shave wrote: > > Many thanks for supplying the right answer, unfortunately I realise now I > posed the wrong question. > > Your right answer was new to me and I can certainly make good use of it. > > The question should have been... *Is there

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
change *the*number or order of columns...

[web2py] unable to call ajax url from external javascript.

2012-02-20 Thread Pradeesh
I am new to web2py. form my view i am able to call web2py ajax as " ajax("{{=URL(r=request,c='control2',f='function1')}}"['name'],'target'); ". But the same command is not working from an external javascript. How can i call a function (in another control file) using ajax from an external JavaScript

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
Many thanks for supplying the right answer, unfortunately I realise now I posed the wrong question. Your right answer was new to me and I can certainly make good use of it. The question should have been... *Is there a better way to right justify numeric fields (more specifically, decimal) in a

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
Thanks for pointing out the mistake in the width attribute, seems it's not needed in SQLTABLE, but was in the static mock-up. Being new to this I couldn't see a way to get at the td tag with css. Although I see Anthony has shown a way in another answer

[web2py] Re: deployment

2012-02-20 Thread Wikus van de Merwe
The /var/www folder is just an example. You can put the wsgi.py in your home folder as well. You can also simply use wsgihandler.py that comes with web2py. One or the other has to be set as the WSGI script in the http server configuration. To learn more on deploying web2py applications read this

[web2py] Re: http://people.csail.mit.edu/pgbovine/python/tutor.html#mode=visualize

2012-02-20 Thread Massimo Di Pierro
It crashes Chrome for me. On Feb 20, 3:33 am, António Ramos wrote: > nice tool > > http://people.csail.mit.edu/pgbovine/python/tutor.html#mode=visualize

[web2py] Re: Web2py Code University and Officaial Certify Training

2012-02-20 Thread Massimo Di Pierro
:-) On Feb 19, 11:42 pm, Ramkrishan Bhatt wrote: > Hello Web2py lovers, >     from past 1 year i am working on web2py in INDIA with zero-group.com, > and also trained many people who's showed interest in web development. In > education many of them looking for training approachability for there b

[web2py] Re: The Great Web Framework Shootout

2012-02-20 Thread Massimo Di Pierro
I did submit a patch. I also submitted a comment on reddit. Those benchmarks are misleading. For example in Django they use the ORM but in Flask they use native sqlite, not SQLAlchemy. In Django I think they have sessions enabled, in Flask, I think no. On Feb 19, 11:23 pm, Bruno Rocha wrote: > I

[web2py] Testing application with Pychecker

2012-02-20 Thread Oliver
Hi. I'm trying to run some tests on our application with Pychecker, but I'm getting this error: TypeError: __import__() takes at most 4 arguments (5 given) Anyone else got this error? Is it possible to test a whole web2py application with Pychecker? Regards, Oliver

[web2py] Re: Passing arg from view to controller.

2012-02-20 Thread Anthony
> > $(function() { > $("#no_table_locality_args").autocomplete({ > source: > "{{=URL('hubaddressbook','locality_args_autocomplete',args='javascript: > $(select#no_table_word).val();')}}", > You have to put your javascript code in the javascript portion of the above, not the Python port

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Anthony
Seems reasonable. You could also do it purely via CSS. Suppose "amount" is the third column of the table and the table has id "mytable": #mytable td:nth-child(3) {text-align: right;} That won't work in older versions of IE, though. In that case, you can use jQuery: $('.ie #mytable td:nth-child

[web2py] Re: Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread weheh
That should work (width: 100%; /* note the ":" is missing in your example */), but stylistically, I'd be putting this kind of thing in my css file. The doc explains the naming convention for SQLForm fields (it slips my mind at the moment). Firebug is also useful for seeing the naming convention f

[web2py] Auth / default checks

2012-02-20 Thread Corne Dickens
Hi, Just an idea for the web2p auth system, why not introduce a standard group 'public' which is assigned to all visitors (not only logged in users) The main advantage of this would be, that you in an easy way can change all access rights for all requests. By (allways) using the has_permission d

[web2py] LOAD / restful requests problem

2012-02-20 Thread Corne Dickens
Hi, Currently it is not possible to use LOAD with ajax=False, together with the request.restful decorator. -> a minimal example: controllers/default.py @request.restful() def index(): def GET(*args,**vars): return dict() return locals() @request.restful() def test(): def GE

[web2py] Is there a better way to right justify an SQLTABLE column?

2012-02-20 Thread Edward Shave
Currently I am using this db.ledger.amount.represent=lambda value: DIV(value, _style="width 100%; text-align:right;")

[web2py] http://people.csail.mit.edu/pgbovine/python/tutor.html#mode=visualize

2012-02-20 Thread António Ramos
nice tool http://people.csail.mit.edu/pgbovine/python/tutor.html#mode=visualize