[web2py] Re: Setting the default user id derived from a custom auth table in a record

2010-10-24 Thread annet
As far as I know auth.user.id should work. However, I faced a similar problem and solved it by setting the default in the function, something like: def add_comment(): db.comment.user.default=auth.user.id return dict(...) Maybe someone else can provide you (and me) with

[web2py] Re: Hidden form fields not accepted by form.accept()?

2010-10-24 Thread Ruiwen Chua
I see. So form.accept() will not parse any field unless explicitly defined in SQLFORM? (Ok I'm not sure if I should start another thread for this, but a few issues I found with using SQLFORM.. so perhaps I'm still doing something wrong.) a) I have multiple forms (for the same model) on a page, no

[web2py] Re: Hidden form fields not accepted by form.accept()?

2010-10-24 Thread mdipierro
Say you have: db.define_table('user',Field('name'),Field('manager',writable=False,default='no') and a registration form: def register(): form=SQLFORM(db.user) form.accepts(request.vars) If attackers were allowed to do http://.../register?name=me&manager=yes they would be a

[web2py] Re: Hidden form fields not accepted by form.accept()?

2010-10-24 Thread Ruiwen Chua
Thanks for the clarification. Though, in what way is this a security mechanism? On Oct 25, 1:03 pm, mdipierro wrote: > I understand. That is intended. That is a security mechanism. > You must use SQLFORM(...,hidden=...) > > On Oct 24, 11:46 pm, Ruiwen Chua wrote: > > > > > > > > > Yes, the hidd

[web2py] Re: Hidden form fields not accepted by form.accept()?

2010-10-24 Thread mdipierro
I understand. That is intended. That is a security mechanism. You must use SQLFORM(...,hidden=...) On Oct 24, 11:46 pm, Ruiwen Chua wrote: > Yes, the hidden input values do seem to appear in request.post_vars. > > I call form.accepts(), like so: form.accepts(request.post_vars, > formname=None) >

[web2py] Re: Hidden form fields not accepted by form.accept()?

2010-10-24 Thread Ruiwen Chua
Yes, the hidden input values do seem to appear in request.post_vars. I call form.accepts(), like so: form.accepts(request.post_vars, formname=None) And even so, only the non-hidden field is saved to the database. On Oct 25, 12:43 pm, mdipierro wrote: > The hidden fields will be in request.vars

[web2py] Re: tip of the day. The power of routes [CLOSED]

2010-10-24 Thread mdipierro
:-) On Oct 24, 11:19 pm, VP wrote: > Great. It appears to be working as intended now.  Thanks.

[web2py] Re: Hidden form fields not accepted by form.accept()?

2010-10-24 Thread mdipierro
The hidden fields will be in request.vars but not in form.vars because accepts does not know they are supposed to be there and protects you from injection attacks. You can also try use this: form=SQLFORM(,hidden=dict(key='value')) Massimo On Oct 24, 11:39 pm, Ruiwen Chua wrote: > Apologie

[web2py] Re: better mercurial integration

2010-10-24 Thread mdipierro
I am flying to a conference so there is no hurry. Anything you can get done within the next 8 days will be great. On Oct 24, 11:15 pm, mart wrote: > k, items 1 and 2 should be simple enough  item 3, that is a > different story, but ok, sure. I think merging outside of the > mercurial context

[web2py] Re: Hidden form fields not accepted by form.accept()?

2010-10-24 Thread Ruiwen Chua
Apologies, I wasn't clear. I meant that the form in the view is static HTML and not generated by SQLFORM. However, in the action that receives the POST, I instantiate a new SQLFORM for that model and pass request.post_vars to it. On Oct 25, 12:30 pm, mdipierro wrote: > if you use > > form.accept

[web2py] Re: Hidden form fields not accepted by form.accept()?

2010-10-24 Thread mdipierro
if you use form.accepts() what is form if you do not use FORM or SQLFORM? On Oct 24, 11:27 pm, Ruiwen Chua wrote: > Hi all, > > I have created a manual HTML form (not FORM() or SQLFORM()) that has a > few hidden fields (ie. ..) > > When this form posts back to the controller, form.accepts() ret

[web2py] Hidden form fields not accepted by form.accept()?

2010-10-24 Thread Ruiwen Chua
Hi all, I have created a manual HTML form (not FORM() or SQLFORM()) that has a few hidden fields (ie. ..) When this form posts back to the controller, form.accepts() returns True, but only the non-hidden field (there is only one, the rest are hidden) is saved to the database. The other fields all

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Great. It appears to be working as intended now. Thanks.

[web2py] Re: better mercurial integration

2010-10-24 Thread mart
k, items 1 and 2 should be simple enough item 3, that is a different story, but ok, sure. I think merging outside of the mercurial context is best though, then simply update the remote repository with the merged file (and include good notes describing both source files and capturing the diffs

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
Aha! My mistake. $a should have been $anything everywhere in the code. I fixed is and re-posted in trunk now under scripts/autoroutes.py Massimo On Oct 24, 10:51 pm, VP wrote: > Update: > > if the function has no arguments, it works.  I.e.   > http://domain.com/app/default/f > gets mapped corr

[web2py] Re: list:string thoughts

2010-10-24 Thread mdipierro
The list:string is not an alternative to using a tag table and tag_link many-to-many (an example of which is provided by plugin_tagging). Yet you should not have the problem you experience. With recent versions of web2py, Field('keywords', 'list:string') should be rendered by a new widget that tak

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Update: if the function has no arguments, it works. I.e. http://domain.com/app/default/f gets mapped correctly to http://domain.com/f But if the function has arguments, it did not work for me. I.e http://domain.com/app/default/g/a/b does not get mapped to http://domain.com/g/a/b PS: I got

[web2py] list:string thoughts

2010-10-24 Thread rick
I'm getting frustrated with the list:string field type. I store products, each product has "keywords" that describe the product. db.define_table('products', Field('keywords', 'list:string')) I don't know what the keywords will be, so I can't use IS_IN_SET() It seems to stores the keywords fine

[web2py] Re: traceback on wizard

2010-10-24 Thread mdipierro
This is patched. Thanks for your patch. On Oct 24, 5:22 pm, Thadeus Burgess wrote: > running trunk, attempting to use wizard, dies on step6 > > Traceback (most recent call last): >   File "/home/thadeusb/Applications/web2py/gluon/restricted.py", line > 188, in restricted > >     exec ccode in env

[web2py] Re: better mercurial integration

2010-10-24 Thread mdipierro
I would be happier with much less... 1) a button in the /admin/mercurial/revision/ page that says [diff] and provides a text output with a diff between the revision and the current code 2) a few more fields in the /admin/mercurial/commit page that say changelog: write something here repository:

[web2py] Re: better mercurial integration

2010-10-24 Thread mart
K, good stuff! I'll use what you and Boris came up with and integrate to mine (will help speed things up) the other project :) and for the other thing, great idea (i think). what do you mean by "web repository"? do you mean reproduce from the code behind a live web2py server instance? which would

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
The messages that starts the thread explains that. I tried and it works. On Oct 24, 9:02 pm, VP wrote: > What works is thathttp://domain1.comwill map to app1 as intended. > > What doesn't work is that app1/default/f/a/b is not mapped to f/a/b or > vice versa.  This is ugly. > > Can you show me ho

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread Brian M
If you're looking up off of a session variable, be sure to take into account what might happen if a user happens to have your site open in multiple windows/tabs. What if you've got a client looking for room rates in different tabs for two different dates or rooms trying to do some comparison shopp

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
What works is that http://domain1.com will map to app1 as intended. What doesn't work is that app1/default/f/a/b is not mapped to f/a/b or vice versa. This is ugly. Can you show me how to get rid of "app1/default"? Thanks.

[web2py] Re: Powered by web2py

2010-10-24 Thread mdipierro
If you do, I'll link it. ;-) On Oct 24, 8:34 pm, Anthony wrote: > That was fast. Looks great. > > If you want to link it from the main site, I'll volunteer to keep it > up to date. I think prospective users really like to see some > examples, so we should make them easy to find. > > Anthony > > O

[web2py] help with testing....

2010-10-24 Thread mdipierro
One may problem is holding on a new web2py version. Something *may* have broken cron. If you use cron can you help us with testing cron in trunk? Massimo

[web2py] Re: Powered by web2py

2010-10-24 Thread Anthony
That was fast. Looks great. If you want to link it from the main site, I'll volunteer to keep it up to date. I think prospective users really like to see some examples, so we should make them easy to find. Anthony On Oct 24, 7:05 pm, mdipierro wrote: > On Oct 24, 5:26 pm, Anthony wrote: > > >

[web2py] Re: Request for a logo - PluginCentral

2010-10-24 Thread mdipierro
Do you have a site up and running? On Oct 24, 6:09 pm, Thadeus Burgess wrote: > I am working on plugin central, finally have some free time to devote to the > project. However I am a horrible artist, and wonder if anyone would like to > help me with designing a logo? > > This is my color scheme >

[web2py] Re: better mercurial integration

2010-10-24 Thread mdipierro
Actually I just did this with some help from Boris from the mercurial mailing list. Now if you run web2py from source ad you have mercurial installed (easy_install mercurial) you can use the web2py admin to: - create a repository (this is done automatically and it also makes a .hgignore) - commit

[web2py] Re: better mercurial integration

2010-10-24 Thread mart
Hi Massimo, Ok, now I feel bad... I have not had the time to finish the integration app I promised... Much is done, but not yet complete... I still do intend on completing though... hopefully soon... Until then, what is your intent here? are you looking to restore a fileset (or entire tree) to

[web2py] Re: run-away threads

2010-10-24 Thread cjrh
On Oct 25, 1:42 am, ae wrote: > Every so often, I have to restart web2py because no threads will > respond. Are you working on Windows? Do you send debugging output to the cmd shell window, and then restore that window to inspect your output? It could be that that shell window is locking your a

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Thank you Massimo. Your script as is didn't work for me (I use debian lenny). Apache complained about not recognizing virtual hosts and that there was a duplicate of the wgsi deamon (I suppose only one deamon should be named web2py). I had to modify it to make it work. (But still not desirable,

[web2py] run-away threads

2010-10-24 Thread ae
Every so often, I have to restart web2py because no threads will respond. I guess that some set of conditions in one of my controllers leads to an infinite loop? Is there a way to set a timeout on controller functions? Can you suggest any way to troubleshoot? Thanks.

[web2py] Request for a logo - PluginCentral

2010-10-24 Thread Thadeus Burgess
I am working on plugin central, finally have some free time to devote to the project. However I am a horrible artist, and wonder if anyone would like to help me with designing a logo? This is my color scheme White - body content #5E99E7 - Links & main color (a light blue) #F5F4EF - Grey, page bac

[web2py] Re: Powered by web2py

2010-10-24 Thread mdipierro
On Oct 24, 5:26 pm, Anthony wrote: > A few more ideas for the Poweredby page: > > - When entering the URL for a site, failure to include the "http://"; > results in the link simply not working. To avoid this problem, maybe > include the "http://"; in the URL text box by default (or automatically

[web2py] Re: Powered by web2py

2010-10-24 Thread Anthony
A few more ideas for the Poweredby page: - When entering the URL for a site, failure to include the "http://"; results in the link simply not working. To avoid this problem, maybe include the "http://"; in the URL text box by default (or automatically prepend "http://"; to any URL submitted withou

[web2py] traceback on wizard

2010-10-24 Thread Thadeus Burgess
running trunk, attempting to use wizard, dies on step6 Traceback (most recent call last): File "/home/thadeusb/Applications/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/thadeusb/Applications/web2py/applications/admin/controllers/wizard.py" <

[web2py] better mercurial integration

2010-10-24 Thread Massimo Di Pierro
Hello everybody, I am working on improving the web2py web interface to mercurial. http://127.0.0.1:8000/admin/mercurial/commit We can current create a repo, commit and get changelog but I cannot figure out how to do revert. Here is the code I have: import os uio = ui.ui() uio.quiet =

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
Assuming you have the routes described above and this in routes.conf - BEGIN routes.conf--- domain1.com /app1/default domain2.com /app2/default - END -- you would need this in apache config file: WSGIDaemonProcess web2py user=www-data group=www- data WSGIProcessGroup web

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Massimo, Can you please show us more specifically how to do this? (I think someone also asked the same question in a previous topic). Thanks. On Oct 24, 1:25 pm, mdipierro wrote: > This assumes web2py is serving static files. But it does not prevent > you to use a apache for it. > In this cas

RE: [web2py] Re: confused about services and authorization

2010-10-24 Thread David Waldrop
It’s the standard webfaction config, web2py and python installed using their scripts. -Original Message- From: web2py@googlegroups.com [mailto:web...@googlegroups.com] On Behalf Of mdipierro Sent: Sunday, October 24, 2010 5:15 PM To: web2py-users Subject: [web2py] Re: confused about servic

[web2py] Re: confused about services and authorization

2010-10-24 Thread mdipierro
Can you also tell us more about the production server? What web server? Os? On Oct 24, 3:52 pm, "David Waldrop" wrote: > Massimo,  Thanks. This is absolutely maddening.  Attached is simple app.  It > exposes 1 service "getmeetings" located in the mm_services model.  The db.py > file includes the

[web2py] Re: bug or backward incompatibility for datetime fields

2010-10-24 Thread Marco Prosperi
Sorry, I mistyped: there is [it-it] and not [it_it] in my Firefox On 24 Ott, 22:14, mdipierro wrote:

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread cjrh
On Oct 24, 9:48 pm, Brian M wrote: > How about include all the calculated values in your form and add in an > additional field that's a HMAC keyed hash of the others using a key > that only you know? When the user submits, make sure the rest of the > field values still combine & hash the same way

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread cjrh
On Oct 24, 9:41 pm, Branko Vukelic wrote: > Oh, so ok, I get what you're trying to do now. Don't pass charge > amount around. Charge amount should be one-way. You NEVER, under ANY > circumstances, using ANY technology, expect that amount to come from > client side. Yes, I guess that should have b

[web2py] Re: Bug or break with backwards compatibility?

2010-10-24 Thread b00m_chef
By keeping the footer separate from the header I can make my app more modular, and more segregated. It is more common in django than web2py I guess...but I find it is a good habit. The blocks are a great addition, I have no need yet, as the method I mentioned above works exactly as I need it to. T

[web2py] Re: confused about services and authorization

2010-10-24 Thread mdipierro
please email me a minimalist program to reproduce the problem and I will debug it. On Oct 24, 2:32 pm, David Waldrop wrote: > Even more confusion.  I can get it to work on dev environment by reverting > to the original decorator on call > > #...

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread mdipierro
This could be a default feature Let me give it some thought.. On Oct 24, 2:48 pm, Brian M wrote: > How about include all the calculated values in your form and add in an > additional field that's a HMAC keyed hash of the others using a key > that only you know? When the user submits, make sur

[web2py] Re: bug or backward incompatibility for datetime fields

2010-10-24 Thread mdipierro
Odd. I do not think there is a language file for it_it. There is it-it and it but not it_it. On Oct 24, 3:11 pm, Marco Prosperi wrote: > I use Firefox 3.6.3 on a Vista machine and Strumenti/Opzioni/Contenuti/ > Lingue has [it_it] as first choice. > Web2py 1.87.3 complains about the dates' format

[web2py] Re: bug or backward incompatibility for datetime fields

2010-10-24 Thread Marco Prosperi
I use Firefox 3.6.3 on a Vista machine and Strumenti/Opzioni/Contenuti/ Lingue has [it_it] as first choice. Web2py 1.87.3 complains about the dates' format while web2py 1.67.0 on the same machine works correctly On 24 Ott, 01:48, Michele Comitini wrote:

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread Brian M
How about include all the calculated values in your form and add in an additional field that's a HMAC keyed hash of the others using a key that only you know? When the user submits, make sure the rest of the field values still combine & hash the same way and then you'll know the user hasn't messed

Re: [web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread Branko Vukelic
On Sun, Oct 24, 2010 at 8:41 PM, cjrh wrote: > On Oct 24, 5:03 pm, Branko Vukelic wrote: >> * Calculated values are shown, and a form with hidden fields and a >> submit button labeled 'Confirm' is shown > > The hidden fields still show in the page source though.  A smart user > could submit his o

Re: [web2py] Re: confused about services and authorization

2010-10-24 Thread David Waldrop
Even more confusion. I can get it to work on dev environment by reverting to the original decorator on call #... @auth.requires(auth.user) @auth.requires_login()

Re: [web2py] Re: confused about services and authorization

2010-10-24 Thread David Waldrop
Even more confusion. I can get it to work on dev environment by reverting to the original decorator on call #...@auth.requires(auth.user) @auth.requires_login() def call(): """ exposes services. for example: http:///[app]/default/call/jsonrpc decorate with @services.jsonrpc th

[web2py] Setting the default user id derived from a custom auth table in a record

2010-10-24 Thread Luther Goh Lu Feng
The snippet below defines a table that stores comments that are created. The 1st field `user` records the user id of the user who created the record. I am trying to set the default value to the current authenticated user, using "auth.user_id" as suggested in Chapter 13 of the web2py book. Although

[web2py] Re: Function that does not require a view

2010-10-24 Thread Anthony
>From http://web2py.com/book/default/chapter/04#Dispatching : "Functions that take arguments or start with a double underscore are not publicly exposed and can only be called by other functions." So, as long as a function takes at least one argument, it will be private, even without the double un

[web2py] Re: confused about services and authorization

2010-10-24 Thread david.waldrop
Cancel that it DOES NOT work on local either. In the previous post it worked I believe because I still had the old controller. Now that I have deleted the controller puttilng the call function back in the default controller, and moving the getmeeting function to a model file, i am not able to acc

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread cjrh
On Oct 24, 5:03 pm, Branko Vukelic wrote: > * Calculated values are shown, and a form with hidden fields and a > submit button labeled 'Confirm' is shown The hidden fields still show in the page source though. A smart user could submit his own set of data if he can see what field id's are being

[web2py] Integrating PyJamas-pages in an IFrame

2010-10-24 Thread Stef Mientki
hello, I've been experimenting with using of my existing PyJamas webpages into web2py, and after a tip from the PyJamas group, to use an Iframe, it works like a charm. I've integrated PyJamas in Web2PY_CC and made a small movie http://www.student.tue.nl/W/r.mientki/web2py_cc_pyjamas_css.html (120

[web2py] Re: Ajax example demo broken?

2010-10-24 Thread mdipierro
Turns out there was a bug. The INPUT fiels was missing the name attribute. I also fund another problem with examples (models/db.py) was missing and this breaks also the db examples. It is fixed in trunk and will post a new web2by version so that it gets fixed on the web page as well. massimo On

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread mdipierro
This assumes web2py is serving static files. But it does not prevent you to use a apache for it. In this case you would need the virtual hosts for the different apps. On Oct 24, 1:18 pm, VP wrote: > Can Massimo or someone clarify if this tip will result in web2py > serving static files or Apache

[web2py] Re: tip of the day. The power of routes

2010-10-24 Thread VP
Can Massimo or someone clarify if this tip will result in web2py serving static files or Apache serving static files? Is this a "production" (high-performance) set up? The assumption "one domain per app" appears to suggest that this is a production set up. Yet, Massimo mentioned in an early tip s

RE: [web2py] Re: confused about services and authorization

2010-10-24 Thread David Waldrop
Massimo, moving the function out of the controller enabled me to successfully invoke the function via xmlrpc on my development machine, but not on the production version. In the forum I see that this (303) supposedly indicates invalid authorization, but the testing credentials are valid on both si

[web2py] Re: Ajax example demo broken?

2010-10-24 Thread Luther Goh Lu Feng
I see. I think the indentation of def data(): is also one level too deep. On Oct 25, 1:43 am, mdipierro wrote: > I think the new examples app is , by mistake, not saving the session. > Will fix it soon. The code is correct. > > On Oct 24, 12:09 pm, "mr.freeze" wrote: > > > > > > > > > The ajax r

[web2py] Re: Ajax example demo broken?

2010-10-24 Thread mdipierro
I think the new examples app is , by mistake, not saving the session. Will fix it soon. The code is correct. On Oct 24, 12:09 pm, "mr.freeze" wrote: > The ajax request is completing successfully but it is only returning > an empty table. There must not be anything in session.m . > > On Oct 24, 12

[web2py] Re: Grouping fields

2010-10-24 Thread mdipierro
You should use a custom form {{=form.custom.begin}}... {{=form.custom.end}} On Oct 24, 12:18 pm, Massimiliano wrote: > Hello, > > is there a simple way to group fields? > > I have a big table with about 70 fields and I want to group them in the view > in some tabs. > > How can I group them? > > W

[web2py] Re: confused about services and authorization

2010-10-24 Thread mdipierro
I am not sure you should register services in controller, unless you also want to expose them as actions. I normally put them in a model. Anyway... @service.xmlrpc @service.jsonrpc @service.whetever register a function as a service def call(): return service() simply exposes all services. You

[web2py] Re: How to use steaky

2010-10-24 Thread mdipierro
When you starts web2py (I think you use windows) web2py.exe it starts the rocket web server. There is not much you need to know except: Use IP 0.0.0.0 to serve pages publicly. User web2py.exe -h for more options. Only two options concern rocket (- c, -k). Massimo On Oct 24, 10:16 am, dbb w

[web2py] Re: Function that does not require a view

2010-10-24 Thread Luther Goh Lu Feng
Tks for the helpful replies. On Oct 25, 1:21 am, JimK wrote: > You can leave the function in the controller file but pre-pend __ to > the name.  This is the Python way to create private functions and it > appears to be supported well in Web2Py. > > An example would be: > > def __privateFunc(): >

[web2py] Re: Ajax example demo broken?

2010-10-24 Thread Luther Goh Lu Feng
Any idea why the value in is not captured in session.m? On Oct 25, 1:09 am, "mr.freeze" wrote: > The ajax request is completing successfully but it is only returning > an empty table. There must not be anything in session.m . > > On Oct 24, 12:00 pm, Luther Goh Lu Feng wrote: > > > > > > > > >

[web2py] Re: Function that does not require a view

2010-10-24 Thread JimK
You can leave the function in the controller file but pre-pend __ to the name. This is the Python way to create private functions and it appears to be supported well in Web2Py. An example would be: def __privateFunc(): On Oct 24, 5:18 am, Luther Goh Lu Feng wrote: > If I have a function that

[web2py] Grouping fields

2010-10-24 Thread Massimiliano
Hello, is there a simple way to group fields? I have a big table with about 70 fields and I want to group them in the view in some tabs. How can I group them? What I thought is to use table inheritance, so that I have my groups already formed in "virtual" table defs and the db def is also more

[web2py] Re: Ajax example demo broken?

2010-10-24 Thread mr.freeze
The ajax request is completing successfully but it is only returning an empty table. There must not be anything in session.m . On Oct 24, 12:00 pm, Luther Goh Lu Feng wrote: > I am trying out example 44 at > > http://web2py.com/examples/default/examples > > This is the demohttp://web2py.com/examp

[web2py] Re: Hiding the submit button of an form generated by SQLFORM.factory

2010-10-24 Thread Luther Goh Lu Feng
Correcting a small typo for the benefit of others who may stumble upon the thread :) submit = conversion_dropdown.element('input',_type='submit') On Oct 25, 12:53 am, Luther Goh Lu Feng wrote: > I see. I am enlightened. Thank you so much! > > On Oct 25, 12:48 am, "mr.freeze" wrote: > > > > > >

[web2py] Ajax example demo broken?

2010-10-24 Thread Luther Goh Lu Feng
I am trying out example 44 at http://web2py.com/examples/default/examples This is the demo http://web2py.com/examples/default/examples Nothing happens when I click the submit button. The webpage stays the same. Is the demo broken?

[web2py] Re: Hiding the submit button of an form generated by SQLFORM.factory

2010-10-24 Thread Luther Goh Lu Feng
I see. I am enlightened. Thank you so much! On Oct 25, 12:48 am, "mr.freeze" wrote: > submit = conversion_form.element('input',_type='submit') > submit['_style'] = 'display:none;' > > or with CSS > > form#conversion_dropdown input[type=submit] { >   display:none; > > } > > On Oct 24, 11:36 am, Lu

[web2py] Re: Hiding the submit button of an form generated by SQLFORM.factory

2010-10-24 Thread mr.freeze
submit = conversion_form.element('input',_type='submit') submit['_style'] = 'display:none;' or with CSS form#conversion_dropdown input[type=submit] { display:none; } On Oct 24, 11:36 am, Luther Goh Lu Feng wrote: > conversation_dropdown = SQLFORM.factory( >                 Field('text', label

[web2py] Re: Hiding the submit button of an form generated by SQLFORM.factory

2010-10-24 Thread Luther Goh Lu Feng
conversation_dropdown = SQLFORM.factory( Field('text', label='Select a conversation', requires=IS_IN_DB(db, 'question.id','question.text')), _id='conversation_dropdown') On Oct 24, 11:47 pm, "mr.freeze" wrote: > How are you creating the form? Can y

[web2py] confused about services and authorization

2010-10-24 Thread david.waldrop
I have spent the bulk of last evening and this morning trying to test web2py services and authorization. In addition to setting auth.settings.allow_basic_login = True I have deleted the "call function" in the default controller, created a seperate controller "mmservices",and and populated with the

[web2py] Re: Hiding the submit button of an form generated by SQLFORM.factory

2010-10-24 Thread mr.freeze
How are you creating the form? Can you show the code? On Oct 24, 10:45 am, Luther Goh Lu Feng wrote: > I see. How do I filter the specific form that has id='myform'? > > On Oct 24, 11:30 pm, "mr.freeze" wrote: > > > This is how I do it. There may be a better way. > > > def myform(): > >     form

[web2py] Re: Hiding the submit button of an form generated by SQLFORM.factory

2010-10-24 Thread Luther Goh Lu Feng
I see. How do I filter the specific form that has id='myform'? On Oct 24, 11:30 pm, "mr.freeze" wrote: > This is how I do it. There may be a better way. > > def myform(): >     form = SQLFORM.factory(Field('test')) >     submit = form.element('input',_type='submit') >     submit['_style'] = 'disp

[web2py] Re: Generically accessing the results of select

2010-10-24 Thread BigBaaadBob
On Oct 23, 10:52 pm, ron_m wrote: > The rows is a dict so if you apply the keys() function you get a list > of keys or values returns a list of values under the keys. > > rows = big_hairy_select_with_joins > > for row in rows: >   for table in row.values() >     for field in table.values() Yes,

[web2py] Re: Hiding the submit button of an form generated by SQLFORM.factory

2010-10-24 Thread mr.freeze
This is how I do it. There may be a better way. def myform(): form = SQLFORM.factory(Field('test')) submit = form.element('input',_type='submit') submit['_style'] = 'display:none;' return dict(form=form) You could always just use a CSS rule too On Oct 24, 10:21 am, Luther Goh Lu

Re: [web2py] Re: How to use steaky

2010-10-24 Thread Branko Vukelic
On Sun, Oct 24, 2010 at 5:16 PM, dbb wrote: > OK, Massimo, how can I use rocket, is there documentation? Debebe Massimo pointed this thread out to me: http://groups.google.com/group/web2py/browse_thread/thread/f0ac5c1d34480565 It's a good start. -- Branko Vukelić bg.bra...@gmail.com stu...@

[web2py] Hiding the submit button of an form generated by SQLFORM.factory

2010-10-24 Thread Luther Goh Lu Feng
I have created a dropdown list, using SQLFORM.factory which will autosubmitted using ajax when there is a change in selection. However the form generated has a submit button, which I would like to hide. I would like to ask for tips regarding this.

[web2py] Re: How to use steaky

2010-10-24 Thread dbb
OK, Massimo, how can I use rocket, is there documentation? Debebe On Oct 24, 10:09 am, mdipierro wrote: > Sorry I do not understand. Do you refer to the old "sneaky" web > server? That was experimental and has been replaced with rocket (gluon/ > rocket.py) > > On Oct 24, 5:22 am, dbb wrote: > >

Re: [web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread Branko Vukelic
On Sun, Oct 24, 2010 at 4:43 PM, cjrh wrote: > The datum in my case is a room rate that a client must pay. > Recalculation is somewhat complicated, and I had hoped to avoid a > recalculation and just pass the already-calculated value to the > "confirmation" page.  I cannot let that be part of the

[web2py] Re: Should forms be defined in the controller or the view?

2010-10-24 Thread cjrh
On Oct 24, 4:43 pm, Luther Goh Lu Feng wrote: > So this will be considered an acceptable violation of DRY? There is no DRY violation.

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread cjrh
On Oct 24, 4:43 pm, cjrh wrote: > So as I said, looks like the safest is for me to simply calculate the > rate again. On the server-side, I mean. Dunno if that was clear.

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread cjrh
On Oct 24, 4:29 pm, Branko Vukelic wrote: > Since > you say the data is already in the table on the page, there's no point > in trying to hide it, especially since POST isn't really hiding > anything if someone really wants to get ahold of request data. The datum in my case is a room rate that a

[web2py] Re: Should forms be defined in the controller or the view?

2010-10-24 Thread Luther Goh Lu Feng
So this will be considered an acceptable violation of DRY? On Oct 24, 10:07 pm, mdipierro wrote: > In the controllers. For sure. If you put forms in view you will be > forced to put other logic in view and soon you end up with something > non-maintainable like PHP code. > > form processing determ

Re: [web2py] Re: Function that does not require a view

2010-10-24 Thread Jason Brower
I personally put them in a special section of the file I am using. It's easier to me. If you need to restrict access to it you can use the same decorators you normally use too. On Sun, 2010-10-24 at 07:11 -0700, mdipierro wrote: > If a function returns a string it does not require a view. > >

Re: [web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread Branko Vukelic
On Sun, Oct 24, 2010 at 4:16 PM, cjrh wrote: > I want to know if there is a way to get data to go from a page to a > controller function via an HTTP link, rather than using a form, and > without showing that data on the URL. AFAIK, you only get to use two HTTP methods (regardless of whether AJAX

[web2py] Re: $.ajax() call uses different session

2010-10-24 Thread cjrh
On Oct 24, 3:20 pm, Branko Vukelic wrote: > I just had to smile at this. :) Happened to me so many times before I > finally learned the lesson. I am still paying school fees :)

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread cjrh
On Oct 24, 3:23 pm, Branko Vukelic wrote: > It might help if you could show us the table. I'm still not sure I > understand what you're trying to do. There are three ways (that I know of) to get data to be available in successive controller functions: 1) Pass it on the URL as arguments 2) Write

[web2py] Re: Function that does not require a view

2010-10-24 Thread mdipierro
If a function returns a string it does not require a view. On Oct 24, 7:18 am, Luther Goh Lu Feng wrote: > If I have a function that I intend to call from different controllers, but I > have no need for the function to have a view, where should this function be > defined? eg. a function that simp

[web2py] Re: How to use steaky

2010-10-24 Thread mdipierro
Sorry I do not understand. Do you refer to the old "sneaky" web server? That was experimental and has been replaced with rocket (gluon/ rocket.py) On Oct 24, 5:22 am, dbb wrote: > There is a very good feature of web2py called steaky, I need > documentation that includes tutorial. I want to use it

[web2py] Re: Should forms be defined in the controller or the view?

2010-10-24 Thread mdipierro
In the controllers. For sure. If you put forms in view you will be forced to put other logic in view and soon you end up with something non-maintainable like PHP code. form processing determines redirect therefore workflow. They belong to controllers. On Oct 24, 4:18 am, cjrh wrote: > On Oct 24

Re: [web2py] Function that does not require a view

2010-10-24 Thread Branko Vukelic
On Sun, Oct 24, 2010 at 2:18 PM, Luther Goh Lu Feng wrote: > If I have a function that I intend to call from different controllers, but I > have no need for the function to have a view, where should this function be > defined? eg. a function that simply calculates the outcome of a math formula, >

Re: [web2py] support for Daytona database

2010-10-24 Thread Branko Vukelic
On Sun, Oct 24, 2010 at 12:38 PM, dbb wrote: > My question is : since web2py is a powerful simple framework, can it > simplify daytona? I have no more information about daytona, they said > the firm that developed it has placed it as an open source, but not > sure. Daytona is a very powerful datab

  1   2   >