[web2py] Re: how to custimize the submit button in auth form

2010-01-10 Thread Frank
thanks ,mr.freeze, the method you provide request customized form with SQLFORM.factory. what about the default auth form just like login, register, password forms? those forms use {{=form}}. can we still use method "form.element" to change submit button to image button? I try it but failed. by t

[web2py] session.flash after registration?

2010-01-10 Thread JimK
I can't seem to figure out how to display a session.flash message on the following page after a registration. I think the answer will have something to do with auth.settings.register_onaccept but I'm not sure how to pass the form object to this setting. Any help would be appreciated. Thanks, Ji

[web2py] Re: Scalability of Web2py

2010-01-10 Thread vvk
Thanks massimo sir, At first, I was getting mean response time of 200 ms per request (ab - n 500 -c 20) I did compile (link "compile" in admin page), mean time per request reduced to 61 ms. After that I did, migrate=False for all tables, mean time came down to 57.1 ms. I'll try caching today and p

Re: [web2py] Re: repopulating form with data after form.errors encountered

2010-01-10 Thread Jeff Bauer
form.vars.update(request.vars) <-- what I was looking for, thanks. I also appreciate the simplified code. The original code posted was taken from page 193 of the web2py manual. -Jeff On 01/09/2010 11:32 PM, mdipierro wrote: You can simplify your code def diag_form(): form = SQLFORM(db.

[web2py] Re: django and web2py

2010-01-10 Thread pihentagy
So, if I happen to write some doc strings, should I do it in epydoc, right? Gergo On Jan 9, 10:39 am, waTR wrote: > I agree that the documentation is lacking, especially for the newest > features. Though, IMHO, documentation is ALWAYS a problem for > developers. I am sure when this framework is

[web2py] Re: Is there any 'Ad Rotator' like in ASP in web2py

2010-01-10 Thread Jon Romero
Yeap, here you go: http://bitbucket.org/jonromero/openshare/src/ On Jan 7, 12:31 pm, "K.R.Arun" wrote: > Is source is available?? > > I haven't seen it. Please provide me the link. > No one ever want's to start from scratch (most of the time). > > On Jan 7, 12:18 am, Jon Romero wrote: > > > I wa

[web2py] Re: session.flash after registration?

2010-01-10 Thread Mengu
http://mdp.cti.depaul.edu/examples/default/tools See the "Custom Authentication" section. On Jan 10, 12:19 pm, JimK wrote: > I can't seem to figure out how to display a session.flash message on > the following page after a registration.  I think the answer will have > something to do with auth.s

Re: [web2py] Re: enforcing a one-to-one relationship

2010-01-10 Thread Jeff Bauer
Working from changeset 94:4fd248d09b52, the unique column is enforced, but the dropdown is missing. It is replaced by a text (string) entry field. If I add the following code to db.py, the dropdown reappears: db.socdiag.socform.requires = \ IS_IN_DB(db, 'socform.id', _and=IS_NOT_IN_DB(d

[web2py] Re: job

2010-01-10 Thread Mengu
I'd, if only i lived in U.S. On Jan 7, 9:54 pm, mdipierro wrote: > Any of you behind this? > > http://www.startuply.com/Jobs/Web_Py_Web_Developer_1856_1.aspx > > if you know more I am curious. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To

[web2py] Re: Duplicate Records

2010-01-10 Thread Mengu
Well, what would I do? I'd "select primarykey, lower(emailfield) from table" and then assign the results to a dict. check the duplicates and remove them from the table. On Jan 7, 6:59 pm, Thadeus Burgess wrote: > Ah... times such as these when Access really makes you happy... > > So I have an ema

Re: [web2py] Re: repopulating form with data after form.errors encountered

2010-01-10 Thread Jeff Bauer
Yes, keepvalues=True is the default. My form is using the checkbox widget, and it appears the values aren't retained upon a form error. Field('inpatient_procedure', 'string', widget=SQLFORM.widgets.checkboxes.widget, Hmmm, the database is updated, but the values aren't displayed on the form

[web2py] Re: Share some wisdom

2010-01-10 Thread rev
> Currently I am the only programmer in the company. My goals are > two-folded. One, I need a way to show my non-technical superiors that > I am working and making progress. Being able to show submits in your version control app is one way of showing that you did something. Many submits doesn't aut

[web2py] Re: twitter2web2py2twitter

2010-01-10 Thread mdipierro
Yes. It is in the appending of the book. The stuff for reading ships with web2py and is in applications/admin/controllers/default.py|twitter () On Jan 10, 1:25 am, weheh wrote: > Has anybody written a web2py app reading or writing twitter stuff from > web2py? I was just curious how it went or is

[web2py] Re: how to custimize the submit button in auth form

2010-01-10 Thread mdipierro
This is in the source of change_password form = form_factory(sql.SQLField( 'old_password', 'password', label=self.messages.old_password, requires=validators( self.settings.table_user[passfield].requires,

[web2py] Re: Scalability of Web2py

2010-01-10 Thread mdipierro
These number are high. What is in the app? Are you testing ssl? What are the same numbers without ssl? On Jan 10, 5:12 am, vvk wrote: > Thanks massimo sir, > > At first, I was getting mean response time of 200 ms per request (ab - > n 500 -c 20) > I did compile (link "compile" in admin page), mea

[web2py] Re: django and web2py

2010-01-10 Thread mdipierro
No. Sphinx please. The plan is to move to Sphinx. On Jan 10, 6:25 am, pihentagy wrote: > So, if I happen to write some doc strings, should I do it in epydoc, > right? > > Gergo > > On Jan 9, 10:39 am, waTR wrote: > > > I agree that the documentation is lacking, especially for the newest > > feat

[web2py] Re: enforcing a one-to-one relationship

2010-01-10 Thread mdipierro
Good point. Perhaps the _and solution is not a good one. On Jan 10, 7:59 am, Jeff Bauer wrote: > Working from changeset 94:4fd248d09b52, the unique column is > enforced, but the dropdown is missing.  It is replaced by a > text (string) entry field.  If I add the following code to > db.py, the dro

[web2py] Re: job

2010-01-10 Thread mdipierro
we should add this. On Jan 7, 10:53 pm, Jason Brower wrote: > On Thu, 2010-01-07 at 11:54 -0800, mdipierro wrote: > > Any of you behind this? > > >http://www.startuply.com/Jobs/Web_Py_Web_Developer_1856_1.aspx > > > if you know more I am curious. > > I haven't checked lately, but is there a site

[web2py] Re: repopulating form with data after form.errors encountered

2010-01-10 Thread mdipierro
You are right. it s widget problem. It is a bug. I will see what I can do but I could use some help on this one. On Jan 10, 8:31 am, Jeff Bauer wrote: > Yes, keepvalues=True is the default.  My form is using the > checkbox widget, and it appears the values aren't retained > upon a form error. > >

[web2py] new in trunk RFC

2010-01-10 Thread mdipierro
There are two new features in trunk. One will probably stay, the other I do not know: 1) Before you could do db.define_table('person',Field('name'),format='%(name)s') db.define_table('dog',Field('name'),Field('owner',db.dog)) now you can also have things like format=lambda person: p

Re: [web2py] Re: repopulating form with data after form.errors encountered

2010-01-10 Thread Jeff Bauer
As I'm the one with the issue, I'll take a look. I've got no experience with this codebase however and will probably make queries on irc #web2py if anyone's listening. Should I file a bug report? -Jeff On 01/10/2010 09:30 AM, mdipierro wrote: You are right. it s widget problem. It is a bug. I

[web2py] Re: how to custimize the submit button in auth form

2010-01-10 Thread mr.freeze
It works for me. Here is my user function: def user(): form=auth() submit = form.element("input",_type="submit") submit["_type"] = "image" submit["_src"] = URL(...) return dict(form=form) On Jan 10, 3:11 am, Frank wrote: > thanks ,mr.freeze, > the method you provide request

[web2py] Re: Scalability of Web2py

2010-01-10 Thread vvk
Sir, These are numbers of my app. I've rebooted my Ubuntu this time, with no other program running, these are the results. Config: 2.16 GHZ Dual Core, 2GB RAM *Without SSL*** va...@varun-laptop:~$ ab -c 20 -n 500 http://10.1.65.114/init/default/login This is ApacheBench,

[web2py] Re: Scalability of Web2py

2010-01-10 Thread vvk
I've benchmarked default welcome application also, posted WITH SSL results above, these are the results: **WELCOME APP WITHOUT SSL* va...@varun-laptop:~$ ab -c 20 -n 500 http://10.1.65.114/welcome/default/user/login This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyr

[web2py] Re: twitter2web2py2twitter

2010-01-10 Thread weheh
Oops, so sorry. I see it now. Must remember not to post things after 2am. I was looking all over in the doc last night (really) and didn't realize I had developed a selective blindness for the word "twitter", the very thing I was looking for. -- You received this message because you are subscribed

[web2py] Re: how to custimize the submit button in auth form

2010-01-10 Thread mr.freeze
You are probably getting an error because the auth function is disabled or the mailer is not set and form=auth() is returning an empty string. You can avoid the error with a simple test: def user(): form=auth() if form: submit = form.element("input",_type="submit") submit[

[web2py] Re: error DAL with Sqlite in appadmin

2010-01-10 Thread Jose
On 10 ene, 06:24, mdipierro wrote: > For everybody else: > this error was only with the trunk version and it is now fixed. This > is because of an attempt in merging table and keyedtable. It required > changes in both appadmin and sqlhtml. I just updated (with hg) and the error still remains J

[web2py] Re: Scalability of Web2py

2010-01-10 Thread mdipierro
Was the app bytecode compiled? Is ab running on localhost or do the number include affects from latency and bandwith? I get smaller numbers running on my laptop. In your output (ab output). What is the difference between? Time per request: 373.505 [ms] (mean) Time per request: 18.675

[web2py] Re: error DAL with Sqlite in appadmin

2010-01-10 Thread mdipierro
Can you post steps to reproduce the error and complete traceback? I cannot reproduce it anymore. Massimo On Jan 10, 2:09 pm, Jose wrote: > On 10 ene, 06:24, mdipierro wrote: > > > For everybody else: > > this error was only with the trunk version and it is now fixed. This > > is because of an

[web2py] Re: how to custimize the submit button in auth form

2010-01-10 Thread Frank
mr.freeze writes: > > You are probably getting an error because the auth function is > disabled or the mailer is not set and form=auth() is returning an > empty string. You can avoid the error with a simple test: > > def user(): > form=auth() > if form: > submit = form.element(

[web2py] Re: error DAL with Sqlite in appadmin

2010-01-10 Thread mdipierro
I understand the problem now. Yes I did an experiment with the code in trunk and broke a new stuff. I think I have restored things to what they should be. Please try again and thanks for your patience. massimo On Jan 10, 2:09 pm, Jose wrote: > On 10 ene, 06:24, mdipierro wrote: > > > For everyb

[web2py] Re: www.web2py.com down?

2010-01-10 Thread Richard
would it be possible to host the main web2py site on GAE to avoid these problems? On Jan 9, 9:32 am, mdipierro wrote: > This time I was able to see the error. It was an out of memory error > on os.fork.  This is a virtual machine with 256MB Ram and I had not > rebooted in long time (only restart

[web2py] Re: job

2010-01-10 Thread Richard
are there any web2py job board apps available? (I enquired about this earlier: http://groups.google.com/group/web2py/browse_thread/thread/183c88915654276e) On Jan 11, 2:28 am, mdipierro wrote: > we should add this. > > On Jan 7, 10:53 pm, Jason Brower wrote: > > > > > On Thu, 2010-01-07 at 11:

[web2py] Re: Best approach for keeping a session alive

2010-01-10 Thread Richard
I need sessions though, because each user has different roles. Just once they login I want the session to last until they logout. On Jan 8, 9:00 am, Wes James wrote: > look in db.py > > ## if no need for session > # session.forget() > > Just don't use sessions. > > On Thu, Jan 7, 2010 at 2:57 PM

[web2py] Re: www.web2py.com down?

2010-01-10 Thread mdipierro
Yo have a point. Some of the examples use features that are not supported on GAE. They can be rewritten. The only issue is finding them. I will do so. On Jan 10, 5:27 pm, Richard wrote: > would it be possible to host the main web2py site on GAE to avoid > these problems? > > On Jan 9, 9:32 am, md

[web2py] Re: job

2010-01-10 Thread mdipierro
No that I know of. On Jan 10, 5:33 pm, Richard wrote: > are there any web2py job board apps available? > (I enquired about this > earlier:http://groups.google.com/group/web2py/browse_thread/thread/183c889156...) > > On Jan 11, 2:28 am, mdipierro wrote: > > > we should add this. > > > On Jan 7,

[web2py] Re: Best approach for keeping a session alive

2010-01-10 Thread mdipierro
The session object itself never expires. Only the auth session expires. There is a auth.settings.expiration = 3600 which you can make very very long. On Jan 10, 5:35 pm, Richard wrote: > I need sessions though, because each user has different roles. Just > once they login I want the session to

Re: [web2py] Re: error DAL with Sqlite in appadmin

2010-01-10 Thread Thadeus Burgess
It is working now. -Thadeus On Sun, Jan 10, 2010 at 5:09 PM, mdipierro wrote: > I understand the problem now. Yes I did an experiment with the code in > trunk and broke a new stuff. I think I have restored things to what > they should be. Please try again and thanks for your patience. > > ma

[web2py] Re: www.web2py.com down?

2010-01-10 Thread mdipierro
One problem is the size of the web2py*.zip and the pdf documents. I host many of them and they would not fit on GAE. On Jan 10, 5:50 pm, mdipierro wrote: > Yo have a point. Some of the examples use features that are not > supported on GAE. They can be rewritten. The only issue is finding > them.

[web2py] multiple upload folders

2010-01-10 Thread weheh
I'm building an app where user-uploaded jpeg files go into uploads/ auth.user.id/mytable.myfile.crypto.suffix. Here's some pseudo code... # model db.define_table('mytable',Field('auth_user',db.auth_user),Field ('myfile',upload')) Then, depending on the user logged in, db.mytable.myfile.uploadfol

Re: [web2py] new in trunk RFC

2010-01-10 Thread Jeff Bauer
Minor error in the trunk, I think. I only noticed because I did a fresh clone on a new machine. WARNING:root:OpenSSL libraries unavailable. SSL is OFF WARNING:root:WEB2PY CRON: cron.master not found at /home/jbauer/web2py/applications/admin/cron/cron.master. Trying to re-create. WARNING:root:

[web2py] Re: multiple upload folders

2010-01-10 Thread mdipierro
The view is not clear to me. Where is the for loop closed? Changing db.mytable.myfile.uploadfolder in a loop does not look like a good idea since it is used only by form.accepts. On Jan 10, 6:16 pm, weheh wrote: > I'm building an app where user-uploaded jpeg files go into uploads/ > auth.user.i

[web2py] Re: Scalability of Web2py

2010-01-10 Thread mdipierro
I asked a stupid question. 373.505 is the average time it takes to respond to a request but there are 20 of them at the same time. 373/20 ~= 18ms per request. On Jan 10, 3:33 pm, mdipierro wrote: > Was the app bytecode compiled? > Is ab running on localhost or do the number include affects from

[web2py] Re: new in trunk RFC

2010-01-10 Thread mdipierro
Good catch. Fixed in trunk now. Massimo On Jan 10, 6:20 pm, Jeff Bauer wrote: > Minor error in the trunk, I think.  I only noticed because I > did a fresh clone on a new machine. > > WARNING:root:OpenSSL libraries unavailable. SSL is OFF > WARNING:root:WEB2PY CRON: cron.master not found at > /

[web2py] URGENT possible vulnerability with postgresql

2010-01-10 Thread mdipierro
Yarko has discovered a major potential vulnerability in web2py with postgresql if the latter is misconfigured. If you are using postgresql make sure you have the setting standard_conforming_strings(on); (I believe this is the default in 8.3 but not in earlier versions). Otherwise your apps

[web2py] Re: session.flash after registration?

2010-01-10 Thread JimK
Hello Massimo, First off, I'd like to tell you how much I love the web2py framework! Thanks for the time and effort, it was well worth it! Now to my issue: I'm just not getting it. I added auth.messages.registration_successful = 'some string' to my db.py model but I'm not sure what it is that I

[web2py] Re: multiple upload folders

2010-01-10 Thread weheh
Sorry about the code. It's pseudo and not syntactically accurate. Trying to take a shortcut, here. Thanks for clarifying that uploadfolder only affects form.accepts. That makes sense, now that you say it. Here's a clarification: #view {{for x in db().select(db.mytable.ALL):}} {{=IMG(_src=URL(r=

[web2py] Re: Suggest appending version number to downloads of web2py

2010-01-10 Thread Anand Vaidya
Hi NeonGoby, Use this: (on Linux desktop) wget -O web2py_src-1.74.5.zip http://web2py.com/examples/static/1.74.5/web2py_src.zip Regards Anand On Jan 7, 9:07 am, NeonGoby wrote: > Thanks fine, > > It's to help me keep track of what version I've downloaded.  On my > server, I unzip and rename t

Re: [web2py] Re: enforcing a one-to-one relationship

2010-01-10 Thread Jeff Bauer
There's a further problem here. The scheme below also prevents socdiag from ever being updated, because once the record is created then IS_NOT_IN_DB always fails. -Jeff On 01/10/2010 09:28 AM, mdipierro wrote: Good point. Perhaps the _and solution is not a good one. On Jan 10, 7:59 am, Jeff B

[web2py] Re: session.flash after registration?

2010-01-10 Thread mdipierro
Hi Jim, thanks for your comments. Assuming you are registering using the default user() action, depending on your settings auth.settings.registration_requires_verification = False auth.settings.registration_requires_approval = False web2py should display one of the following messages: auth.mes

[web2py] Re: enforcing a one-to-one relationship

2010-01-10 Thread mdipierro
That is easy to fix. In fact it is now fixed in trunk. On Jan 10, 9:42 pm, Jeff Bauer wrote: > There's a further problem here.  The scheme below also > prevents socdiag from ever being updated, because once > the record is created then IS_NOT_IN_DB always fails. > > -Jeff > > On 01/10/2010 09:28

[web2py] Why double braces in view

2010-01-10 Thread Anand Vaidya
I was watching Cal Henderson's "Why I hate Django" talk on youtube yesterday. One of the issues he raises there is the presence of superfluous text in Django such as : {{ some_text }} web2py also uses {{ python_code }} in view files. Why do we need two braces? Will just one brace not do the job?

[web2py] Re: Why double braces in view

2010-01-10 Thread mdipierro
Because you would not be able to use the template to generate JS code. On Jan 10, 9:54 pm, Anand Vaidya wrote: > I was watching Cal Henderson's "Why I hate Django" talk on youtube > yesterday. One of the issues he raises there is the presence of > superfluous text in Django such as : > > {{  some

[web2py] Re: session.flash after registration?

2010-01-10 Thread JimK
After registration, I'm redirected to the account page with a flash message stating 'Logged In' instead of my 'Registration Successful' as defined below. I can of course override the Logged In message by adding a 'response.flash = auth.messages.registration_successful' but then the user will alway

[web2py] Re: www.web2py.com down?

2010-01-10 Thread John Heenan
This might be a good time to mention an idea I have yet to get round to automating on my web2py backend. I intend to use web2py to automate upload of files to another site and generate appropriate links. It cuts down on hosting traffic costs. For the Google App Engine it can be used to overcome pot

[web2py] Re: Why double braces in view

2010-01-10 Thread JimK
Nor would you be able to use { some_text } in the static text of the HTML to display a line of code (e.g. javascript, java, actionscript, etc). On Jan 10, 8:33 pm, mdipierro wrote: > Because you would not be able to use the template to generate JS code. > > On Jan 10, 9:54 pm, Anand Vaidya wrote

[web2py] Re: Scalability of Web2py

2010-01-10 Thread vvk
the app is bytecode compiled. It's running on my localhost. On Jan 11, 5:23 am, mdipierro wrote: > I asked a stupid question. > > 373.505 is the average time it takes to respond to a request but there > are 20 of them at the same time. > 373/20 ~= 18ms per request. > > On Jan 10, 3:33 pm, mdipier

[web2py] Re: repopulating form with data after form.errors encountered

2010-01-10 Thread JimK
This is a great example of how to handle repopulation upon errors for a regular form, but how would you handle this for a registration form when using the built-in authentication? The user() controller in default is pretty much blank except for return dict(form=auth()) . Any help would be greatly