Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Kuba Kucharski
Can session files be turned of ? you can turn off sessions by session.forget() and also store sessions in the database that is how it works on GAE. In every default db.py you have: if request.env.web2py_runtime_gae: db = DAL('gae') session.connect(request, response, db=db)

[web2py] Re: Table names: plural or singular?

2010-12-01 Thread cjrh
On Nov 30, 11:48 pm, pbreit pbreitenb...@gmail.com wrote: Sorry for the newbie, religious question but what is the preference in web2py for table names, plural or singular? +1 for singular.

Re: [web2py] Re: Table names: plural or singular?

2010-12-01 Thread Michele Comitini
+1 singular And now... gender preferences: anyone would like to discuss on that? ;-) 2010/12/1 cjrh caleb.hatti...@gmail.com: On Nov 30, 11:48 pm, pbreit pbreitenb...@gmail.com wrote: Sorry for the newbie, religious question but what is the preference in web2py for table names, plural or

[web2py] Re: How to call a function in an other controller?

2010-12-01 Thread cjrh
This link http://web2py.com/book/default/chapter/04#Cooperation suggests perhaps XML-RPC?

Re: [web2py] Re: How to call a function in an other controller?

2010-12-01 Thread Michele Comitini
if that is a single web2py application instance I would simply move every common code to the model if those are differente applications on a single web2py instance I would simply move every common code into a module in site-packages if none of the above than a rest like, soap, xmlrpc, json

[web2py] jqgrid plugin display data from multiple tables

2010-12-01 Thread Neveen Adel
Hello, Is there a way to make jqgrid plugin to display data from multiple tables ? plugin_jqgrid(db.shout,columns=['id','message'],height=300) Thanks in Advance

Re: [web2py] How to call a function in an other controller?

2010-12-01 Thread rochacbruno
Depending on the function, you can call client side via ajax without the need to redirect the user. ( but it is not safe ) I prefer to put my commom code in /modules and import when it is needed. Enviado via iPhone Em 01/12/2010, às 05:54, Dan kor...@ironshark.de escreveu: Hi, is there

[web2py] Problems with mail.send()

2010-12-01 Thread Bernardo
Dear all, I don't know if it is exactly a web2py issue or not. The fact is that I have a remote mail server, listening in port 25. It uses a self created certificate to allow connections from the outside (i.e. for thunderbird, you must accept that certificate in order to send mails). The problem

[web2py] Re: Table names: plural or singular?

2010-12-01 Thread villas
And now... gender preferences: anyone would like to discuss on that?  ;-) OK +1 single women :)

[web2py] Re: Design advice for many to many

2010-12-01 Thread villas
Hi Jay, If all the permissions are easy to specify and similar, e.g. all students can see information for their own enrolled courses, then use your own model. If all the permissions might be different and set on an individual basis with many exceptions and complications, then auth is built

[web2py] Posgresql's full text search capabilities and DAL

2010-12-01 Thread Johann Spies
How do I handle the following PostgreSQL function in Web2py? ALTER TABLE pgweb ADD COLUMN textsearchable_index_col tsvector; UPDATE pgweb SET textsearchable_index_col = to_tsvector('english', coalesce(title,'') || ' ' || coalesce(body,'')); I know I can use executesql for creating the

Re: [web2py] OFFTOPIC: FUNNY: SEO specialists

2010-12-01 Thread Branko Vukelic
There are many things you could do just modifying the default app w/o the thesaurus. Just making the default app compliant with Google webmasters guidelines would be a HUGE improvement over the current default app. http://www.google.com/support/webmasters/bin/answer.py?hl=enanswer=35769 The way

Re: [web2py] Re: Table names: plural or singular?

2010-12-01 Thread Branko Vukelic
On Wed, Dec 1, 2010 at 1:08 PM, villas villa...@gmail.com wrote: And now... gender preferences: anyone would like to discuss on that?  ;-) OK +1 single women  :) +1 -- Branko Vukelić bg.bra...@gmail.com stu...@brankovukelic.com Check out my blog: http://www.brankovukelic.com/ Check out

Re: [web2py] Re: Table names: plural or singular?

2010-12-01 Thread Branko Vukelic
On Wed, Dec 1, 2010 at 1:08 PM, villas villa...@gmail.com wrote: And now... gender preferences: anyone would like to discuss on that?  ;-) OK +1 single women  :) Btw, a table for single women should be single woman. -- Branko Vukelić bg.bra...@gmail.com stu...@brankovukelic.com Check out

[web2py] Re: very long wait for http://127.0.0.1:8000/ on IE and Firefox browsers

2010-12-01 Thread Timbo
Rocket 1.2.0 is out. It addresses the issue above and has some speed improvements (though that might not be noticeable to the user). If you look at the code, it's much cleaner than it was and reflects my maturing skill as a developer. I've tested it on cPython 2.4 (the legacy branch support

Re: [web2py] jqgrid plugin display data from multiple tables

2010-12-01 Thread Richard Vézina
I would make a view at the database level and define a table for that view in web2py model dans then pass the view to jqgrid... On Wed, Dec 1, 2010 at 5:45 AM, Neveen Adel nevo.a...@gmail.com wrote: Hello, Is there a way to make jqgrid plugin to display data from multiple tables ?

[web2py] read boolean unselectable checkbox

2010-12-01 Thread Richard Vézina
Hello, How can I represent the boolean in crud.read form by an unselectable checkbox instead of True or False? Is it a job for the widget : SQLFORMhttp://web2py.com/book/default/docstring/SQLFORM .widgets.boolean.widget? Richard

[web2py] Re: Using Jython with web2py

2010-12-01 Thread mdipierro
I do not know of other problems. Event his one problem has not manifested itself. On Dec 1, 1:48 am, pierreth pierre.thibau...@gmail.com wrote: On Nov 26, 6:41 pm, mdipierro mdipie...@cs.depaul.edu wrote: It works (some of us have tested it) but there are some know problems and I would not

[web2py] Re: auth.change_password() not workign

2010-12-01 Thread mdipierro
I do not think so. What do you mean it does not work? Could it be a problem with mail? On Dec 1, 1:57 am, Aniket Arora aniket.ar...@gmail.com wrote: Hey, I'm using web2py (Version 1.83.2) on my local machine. I used auth.change_password() function and it works fine on my local machine. But

[web2py] Re: Posgresql's full text search capabilities and DAL

2010-12-01 Thread mdipierro
The query is easy: db(@@ to_tsquery('%s'); % title_body.replace(','')).select() to generate the table you need SQLCustomField and the compute attribute. Give it a try and please report back. I am very much interested in this issue. On Dec 1, 6:32 am, Johann Spies johann.sp...@gmail.com

[web2py] Re: Problems with mail.send()

2010-12-01 Thread mdipierro
try telnet mail.mydomain.com 25 and see if it is accepting remote connections (by defau postfix does not). Also I think mail.settings.login = 'berna...@mydomain.com:mypass' should be mail.settings.login = 'berna...:mypass' On Dec 1, 5:44 am, Bernardo estem...@gmail.com wrote: Dear all, I

[web2py] Re: read boolean unselectable checkbox

2010-12-01 Thread mdipierro
Please submit a bug report about this on http://code.google.com/p/web2py/ and I will take care of it asap. massimo On Dec 1, 9:17 am, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, How can I represent the boolean in crud.read form by an unselectable checkbox instead of True or

[web2py] Re: very long wait for http://127.0.0.1:8000/ on IE and Firefox browsers

2010-12-01 Thread mdipierro
I will wait for the patch from you or Jonathan. I can wait the week- end. On Dec 1, 8:39 am, Timbo tfarr...@owassobible.org wrote: Rocket 1.2.0 is out.  It addresses the issue above and has some speed improvements (though that might not be noticeable to the user).  If you look at the code,

[web2py] Re: Scalability of web2py?

2010-12-01 Thread VP
This is an example -- I think -- where web2py still needs to be proven in terms of scalability. Yes, sessions can be stored in database, turned off in specific functions, and regularly deleted. But I still think that there should be a better systematic way of handling sessions in heavy

[web2py] Re: Best way to edit SQLFORM input before passing to accepts?

2010-12-01 Thread hswolff
I'll try the model implementation. I need to be able to parse the submit content and count the frequency a word appears and set the type accordingly. I'm using response.moment_form because when I had it in the index() function and I would go to the user page it wouldn't render because the dict

[web2py] Re: Scalability of web2py?

2010-12-01 Thread mdipierro
We should have a mechanism for storing sessions clientside but this is a speed issue not a scalability issues. Storing sessions in encrypted cookies makes a each request 1-2ms faster by trading bandhwidth (required to communicate the session in cookie) with file IO (required to locate and access

[web2py] Anyone using memCache ? Two issues

2010-12-01 Thread JC11
Hello, I have used the local web2py cache such as: msg = cache.ram(cacheKey, lambda: getResponse(reqBody), time_expire=10), and sometimes cache.ram.clear(cacheKey) which works fine. (easy and fast !) I am now trying to use memcached and getting two errors. The first is :

[web2py] Re: jqgrid plugin display data from multiple tables

2010-12-01 Thread John Heenan
If you mean a 'master-slave' multiple table arrangement then you can include include code for the client (javascript) to respond to a relevant master table event that does not replace the entire page (by using ajax and json) that: 1) sends data to web2py, 2) asynchronously receive data back from

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Thadeus Burgess
All of the problems I had with web2py were because of the sessions. Even storing the sessions in db caused web2py to crash. Never really found a solution, there is something to the fact of having to pickle/unpickle the session that can't handle major loads. -- Thadeus On Wed, Dec 1, 2010 at

[web2py] Re: Scalability of web2py?

2010-12-01 Thread John Heenan
The elephant in the room has not gone away Massimo. Web2py is great for small projects. DotNet is great for small and large projects. The elephant in the room is not only the untested scalibility of web2py but also the amount of resources that neeeds to be thrown at web2py compared to DotNet

[web2py] Re: Problems with mail.send()

2010-12-01 Thread Bernardo
Hi Massimo, thanks for your reply. I connected without problems using telnet on port 25 telnet mydomain.com 25 Connected to mydomain.com. Escape character is '^]'. 220 mydomain.com ESMTP Postfix (Ubuntu) EHLO mydomain.com 250-mydomain.com 250-PIPELINING 250-SIZE 1024 250-ETRN 250-STARTTLS

[web2py] Re: Please help: Are these errors?

2010-12-01 Thread mattynoce
i get this error when i have mismatched data, but only on certain fields. i haven't done the example that you're talking about exactly, but maybe this can help. i have a normal auth_user table, a period table and an element table that look like this: auth_user period: userid, ... element:

[web2py] Re: Anyone using memCache ? Two issues

2010-12-01 Thread mdipierro
True that memcache does not support clear. Not sure about the other problem. How do you connect to memcache from web2py? On Dec 1, 11:06 am, JC11 john.c...@gmail.com wrote: Hello, I have used the local web2py cache such as:       msg = cache.ram(cacheKey, lambda: getResponse(reqBody),

[web2py] Re: Problems with mail.send()

2010-12-01 Thread mdipierro
try from the shell python web2py.py -A yourapp -N -M print mail.send(to=@..., message=, subject=...) Massimo On Dec 1, 11:55 am, Bernardo estem...@gmail.com wrote: Hi Massimo, thanks for your reply. I connected without problems using telnet on port 25 telnet mydomain.com 25

Re: [web2py] Re: Problems with mail.send()

2010-12-01 Thread Bernardo Botella Corbí
It prints False Bernardo 2010/12/1 mdipierro mdipie...@cs.depaul.edu try from the shell python web2py.py -A yourapp -N -M print mail.send(to=@..., message=, subject=...) Massimo On Dec 1, 11:55 am, Bernardo estem...@gmail.com wrote: Hi Massimo, thanks for your reply. I

[web2py] Re: Problems with mail.send()

2010-12-01 Thread mdipierro
web2py is failing to connect and send the email. Something is wrong in the settings. To debug, you can try add something some print statements inside the class Mail send function. Sorry I do not have a better advice. On Dec 1, 12:27 pm, Bernardo Botella Corbí estem...@gmail.com wrote: It prints

Re: [web2py] Re: read boolean unselectable checkbox

2010-12-01 Thread Richard Vézina
Not sure it a issue. I can do this : db.table1.approved.represent=\ lambda value: value==True and 'Approved' or 'Not approved' Richard On Wed, Dec 1, 2010 at 10:59 AM, mdipierro mdipie...@cs.depaul.edu wrote: Please submit a bug report about this on http://code.google.com/p/web2py/ and

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Branko Vukelic
Erlang is for humongous, real-time, distributed, and highly-available apps. Here's an example (maybe quoted one time too often): http://www.sics.se/~joe/apachevsyaws.html On Wed, Dec 1, 2010 at 6:45 PM, John Heenan johnmhee...@gmail.com wrote: The elephant in the room has not gone away

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Thadeus Burgess
Would that be the decision of the webserver? gevent uses a event-per-request and it is written completely in python. -- Thadeus On Wed, Dec 1, 2010 at 11:45 AM, John Heenan johnmhee...@gmail.com wrote: The elephant in the room has not gone away Massimo. Web2py is great for small projects.

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Branko Vukelic
On Wed, Dec 1, 2010 at 8:10 PM, Thadeus Burgess thade...@thadeusb.com wrote: Would that be the decision of the webserver? gevent uses a event-per-request and it is written completely in python. Anyway, they didn't say ASP.NET. They just said .NET. http://ironpython.net/ Run web2py on that,

[web2py] Re: Scalability of web2py?

2010-12-01 Thread mr.freeze
I actually have run web2py on ironpython. It runs surprisingly well. You have to remove references to signal, csv and logging modules but Rocket actually runs. No GIL either! I'm experimenting with running web2py on IIS with nwsgi (http://nwsgi.codeplex.com/). I would gladly ditch ASP.NET for

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Kuba Kucharski
Web2py is waiting for the first brave ONE to (be able to) GO and try to SCALE. I believe this person will get a lot of attention and resources from community and Massimo himself. Real WORLD scalable implementations are VERY CUSTOM thing. like for example:

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Jorge Restrepo
Yes. I second you on that, Kuba. I also want to procede with a large scale app, but I am waiting... On Wed, Dec 1, 2010 at 2:28 PM, Kuba Kucharski kuba.kuchar...@gmail.comwrote: Web2py is waiting for the first brave ONE to (be able to) GO and try to SCALE. I believe this person will get a

[web2py] Re: Problems with mail.send()

2010-12-01 Thread Bernardo
Ok Massimo, I'll post if I find something. thanks a lot!! Bernardo On 1 dic, 19:30, mdipierro mdipie...@cs.depaul.edu wrote: web2py is failing to connect and send the email. Something is wrong in the settings. To debug, you can try add something some print statements inside the class Mail

[web2py] gae, lists and scaling

2010-12-01 Thread mattynoce
i'm using web2py on gae and creating a system that will incorporate friending and a friend feed of sorts. earlier this year, i made friends a list in the auth_user table, but upon watching brett slatkin's talk on list properties (http://www.youtube.com/watch? v=AgaL6NGpkB8), i got nervous because

[web2py] Re: Wizard + Plugin Wiki

2010-12-01 Thread JayShaffstall
Look at this line  'editor' : auth.user and auth.has_membership(role='editor') or auth.user_id==1, # if current user a editor? That was it...creating a simple application does not pre-populate anything in the database, so the first user to register is automatically an editor by virtue of

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Marcello Parra
What is the largest application running web2py today? On Wed, Dec 1, 2010 at 5:28 PM, Kuba Kucharski kuba.kuchar...@gmail.comwrote: Web2py is waiting for the first brave ONE to (be able to) GO and try to SCALE. I believe this person will get a lot of attention and resources from community

[web2py] Re: Scalability of web2py?

2010-12-01 Thread mdipierro
These are the apps we have knowledge of: http://web2py.com/poweredby I have no idea how popular they are. Massimo On Dec 1, 1:34 pm, Marcello Parra parro...@gmail.com wrote: What is the largest application running web2py today? On Wed, Dec 1, 2010 at 5:28 PM, Kuba Kucharski

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Michele Comitini
did anyone try to run web2py on this? http://pypi.python.org/pypi/pastegevent/0.1 2010/12/1 Jorge Restrepo jorgeh...@gmail.com: Yes. I second you on that, Kuba. I also want to procede with a large scale app, but I am waiting... On Wed, Dec 1, 2010 at 2:28 PM, Kuba Kucharski

[web2py] Re: Syntax for placeholders in executesql

2010-12-01 Thread Richard G
As I understand Web2py passes this off to the database adapter that is in use (likely psycopg2 in this case). Psycopg2 accepts arguments in a couple different forms, using the '%s' as you identify below, as well as named references with '%(name)s'. There are a few caveats when using query

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Michele Comitini
better yet: http://pypi.python.org/pypi/Spawning/ 2010/12/1 Michele Comitini michele.comit...@gmail.com: did anyone try to run web2py on this? http://pypi.python.org/pypi/pastegevent/0.1 2010/12/1 Jorge Restrepo jorgeh...@gmail.com: Yes. I second you on that, Kuba. I also want to

[web2py] PostgreSQL notifications with Psycopg2 and Eventlet

2010-12-01 Thread mdipierro
http://initd.org/psycopg/articles/2010/12/01/postgresql-notifications-psycopg2-eventlet/

[web2py] Re: Problems with mail.send()

2010-12-01 Thread Bernardo
More news Massimo, After following the execution of send method from Mail class, I found where it throws the exception that makes it return False. Those are my new mail settings: mail.settings.server = 'mydomain:25' # your SMTP server mail.settings.sender = 'berna...@mydomain.com' # your

[web2py] Re: Problems with mail.send()

2010-12-01 Thread mdipierro
You are using x509 signed emails. You set your certificates with: mail.settings.x509_sign_keyfile = 'url_to_postfix.key' mail.settings.x509_sign_certfile = 'url_to_postfix.cert' mail.settings.x509_crypt_certfiles = 'url_to_postfix.cert' but they should not be urls, they should be full paths

[web2py] Re: Problems with mail.send()

2010-12-01 Thread Bernardo
All right. It seems to load the certificate now. But... still not sending the mail. Now web2py prints the following line: WARNING:web2py:Mail.send failure:(535, '5.7.8 Error: authentication failed: authentication failure') The mail.log in the mail server shows the following lines: Dec 1

[web2py] amfrpc problem

2010-12-01 Thread dustin.b
hi, im stuck in getting flash to work with (web2py) amfrpc. i must confess that i am very limited in my flash knowledge so far. i tryed the sample from the book and getting into import problems. i think this is related to the flash version. im using flash cs5 and flashdevelop .. with as3. i

[web2py] Re: Scalability of web2py?

2010-12-01 Thread ctalley
Nowhere in this thread is the word risk used. Bottom line, there's probably a reluctance to bet on web2py when it's not a known quantity in an application with the stated demands. Most people are risk adverse because they don't want to get beat about the head and shoulders if something turns out

[web2py] Re: amfrpc problem

2010-12-01 Thread mdipierro
Try use amf3 @service.amfrpc3('domain') def service1(): return test and gateway.connect(http://127.0.0.1:8000/FlashSoldat_Server/default/call/ amfrpc3/); gateway.connect(http://127.0.0.1:8000/FlashSoldat_Server/default/ call/amfrpc/); On Dec 1, 4:55 pm, dustin.b

[web2py] Re: amfrpc problem

2010-12-01 Thread dustin.b
thx for the quick answer! on the clintside i have the same error message. i forgot to mention the w2p ticket with amfrpc: Traceback (most recent call last): File D:\DEV\python\web2py\1_89_5\web2py_src\web2py\gluon \restricted.py, line 188, in restricted exec ccode in environment File

[web2py] Re: amfrpc problem

2010-12-01 Thread mdipierro
The domain must be specified in the flash app. http://www.web2pyslices.com/main/slices/take_slice/72 I am not a flash expert myself anyway. Perhaps other people here can help more. Massimo On Dec 1, 5:25 pm, dustin.b dustin.bens...@googlemail.com wrote: thx for the quick answer! on the

[web2py] convert a string to a table or field?

2010-12-01 Thread Lorin Rivers
I tried making a generic function that created a table variable by concatenating strings. myTable = tableBuilder('inverter',period=5) def tableBuilder(element,period=0): if element == 'inverter': if period = 0: return 'db4.' + 'arraydata_table' elif period = 1: return

Re: [web2py] convert a string to a table or field?

2010-12-01 Thread Branko Vukelic
On Thu, Dec 2, 2010 at 1:11 AM, Lorin Rivers lriv...@mosasaur.com wrote: I tried making a generic function that created a table variable by concatenating strings. myTable = tableBuilder('inverter',period=5) def tableBuilder(element,period=0):  if element == 'inverter':    if period = 0:

Re: [web2py] convert a string to a table or field?

2010-12-01 Thread Branko Vukelic
On Thu, Dec 2, 2010 at 1:11 AM, Lorin Rivers lriv...@mosasaur.com wrote: I tried making a generic function that created a table variable by concatenating strings. myTable = tableBuilder('inverter',period=5) def tableBuilder(element,period=0):  if element == 'inverter':    if period = 0:  

Re: [web2py] convert a string to a table or field?

2010-12-01 Thread Stef Mientki
On 02-12-2010 01:11, Lorin Rivers wrote: I tried making a generic function that created a table variable by concatenating strings. myTable = tableBuilder('inverter',period=5) def tableBuilder(element,period=0): if element == 'inverter': if period = 0: return 'db4.' +

Re: [web2py] convert a string to a table or field?

2010-12-01 Thread Branko Vukelic
On Thu, Dec 2, 2010 at 1:23 AM, Stef Mientki stef.mien...@gmail.com wrote: that doesn't return a table variable, but a string, so maybe you want  return eval ( 'db4' + 'arraydata_table') Don't use eval. It's evil! :) 'db4' doesn't have to be a string. I think you can access the tables using

[web2py] Re: Scalability of web2py?

2010-12-01 Thread John Heenan
The OP asked What's the 'largest' scale web2py is known to perform well on? Massimo evaded the question and no one else has provided an answer. The core of Erlang is very simple. Erland does no On Dec 2, 5:09 am, Branko Vukelic bg.bra...@gmail.com wrote: Erlang is for humongous, real-time,

[web2py] Re: convert a string to a table or field?

2010-12-01 Thread mart
table is a table object and not a string... here's an example. creating the table is easy enough, but referencing is different... # VARS tlist = ['martP4Sync', 'coreP4Sync', 'testP4Sync'] # MAKE TABLES for t in tlist: db.define_table('{0}'.format(t),

[web2py] Re: Scalability of web2py?

2010-12-01 Thread mdipierro
The fact is that there is not one number to measure scalability. There are many parameters like: number of requests/second (average) number of requests/second (peak) complexity of those requests/second (static pages, dynamic pages, types of db queries, do they use caching). number of servers used.

Re: [web2py] Re: Scalability of web2py?

2010-12-01 Thread Marcello Parra
Massimo, Any doc/reference about this? Thanks On Wed, Dec 1, 2010 at 11:20 PM, mdipierro mdipie...@cs.depaul.edu wrote: web2py introduces a penalty when you have lots of tables and there are some optimizations that need to be done in that case.

[web2py] Re: Scalability of web2py?

2010-12-01 Thread John Heenan
The OP, Lorin, asked What's the 'largest' scale web2py is known to perform well on? Massimo evaded the question and no one else has provided an answer. Hence the elephant in the room has been ignored. Web2py is designed to use an OS 'thread per web' request as Web2py is built on a WGSI

[web2py] Re: Scalability of web2py?

2010-12-01 Thread mdipierro
Some of them are discussed here: http://web2py.com/book/default/chapter/11#Efficiency-and-Scalability Some are new features like: session.connect(request,response,separate=True) This was proposed by author of http://www.zhjtjyw.com/ which is made with web2py and seems to have lots of users. So

[web2py] Re: Syntax for placeholders in executesql

2010-12-01 Thread Brian M
Yes, web2py's executesql when used with placeholders will simply pass the provided query placeholders on to execute() method of whichever database driver is being used, thus you must use a syntax supported by your driver. In the case of SQLite MS SQL that syntax is question marks (?) for

[web2py] Re: Best way to edit SQLFORM input before passing to accepts?

2010-12-01 Thread DenesL
your_model.py: db.define_table('moment', Field('textarea','text'), Field('txttype', readable=False, writable=False), ... ) default.py: def moment_type(form): form.vars.txttype=... def submit_moment(): form=SQLFORM(db.moment) if form accepts(request.vars, session,

[web2py] Re: Scalability of web2py?

2010-12-01 Thread John Heenan
With regard to comments below about elephants in the Web2py room, such as vulnerability to individuals with comment Linus is being downplayed by the LF (Linux foundation), following is a quote from http://www.desktoplinux.com/news/NS7450801259.html in section 'Top Linux Contributors' with regard

[web2py] Re: Best way to edit SQLFORM input before passing to accepts?

2010-12-01 Thread mr.freeze
I would personally use a computed field for this: Model: def count_words(txt): ... return count def get_type(txt): count = count_words(txt) if count 10: return 'small' if count 20: return 'medium' if count 30: return 'large' return 'huge' db.define_table('moment',

[web2py] Re: Best way to edit SQLFORM input before passing to accepts?

2010-12-01 Thread DenesL
True, but you gotta learn to walk before you run ;) On Dec 1, 9:48 pm, mr.freeze nat...@freezable.com wrote: I would personally use a computed field for this: Model: def count_words(txt):     ...     return count def get_type(txt):     count = count_words(txt)     if count 10: return

Re: [web2py] Re: Best way to edit SQLFORM input before passing to accepts?

2010-12-01 Thread Harry Wolff
You guys all rock hah. I got the form working as I want it to. I'm gonna try putting in the compute argument in my model tomorrow but for now I have the form working with the following code: new controller: moment.py: import re def form(): ## TODO: Get db.moment.type set to best or worst

[web2py] Re: Scalability of web2py?

2010-12-01 Thread VP
While he's very knowledgeable with web2py, I think John Heenan's criticisms are unfair. From what I understand, it seems most other recognizable Python frameworks employ WGSI. So this problem (if there's a problem), is not unique to web2py. Comparing web2py to Erlang is curious. I am a newbie,

[web2py] Bug: if theres is two forms normal of request.vars. become LISTS!

2010-12-01 Thread Phyo Arkar
I use html forms, that code was since 1.7x and today i get complains from customer (a month after updated to 1.88) Now i found out why: If there is two html forms (non web2py-generated) with different ID, different action but if they have same post vars (or get var i am not tested..) , it

[web2py] Re: how do get me to imporsonate a generic user?

2010-12-01 Thread guruyaya
Ummm... you know that it's an opening for xss... right? It's not a big deal if everything else is done right in the website, but I can force an admin to impersonate someone else, by creating an image in my website, with src that goes: http://.../app/default/user/impersonate/{id} You should really

[web2py] onvalidation problem

2010-12-01 Thread VP
somehow onvalidation seems to work on create but not on update/edit. I have something like this: def edit_entry(): form = SQLFORM(db.entry, request.args(0)) if form.accepts(request.vars, session, onvalidation=func): ## blah blah The function func apparently is not called at all.

[web2py] Re: onvalidation problem

2010-12-01 Thread mr.freeze
Can you verify that there are no form errors? Currently if there are any form errors, onvalidation will not run. Also, what version are you running? On Dec 1, 10:53 pm, VP vtp2...@gmail.com wrote: somehow onvalidation seems to work on create but not on update/edit. I have something like this:

[web2py] Re: Bug: if theres is two forms normal of request.vars. become LISTS!

2010-12-01 Thread mdipierro
Not sure what the problem is. Can you try replace? form.accepts(request.vars,...) with form.accepts(request.post_vars,...) On Dec 1, 10:23 pm, Phyo Arkar phyo.arkarl...@gmail.com wrote:    I use html forms, that code was since 1.7x and today i get complains from customer (a month after

[web2py] Re: how do get me to imporsonate a generic user?

2010-12-01 Thread mdipierro
True. This will break backward compatibility but it is a security issue. I will sleep on it. All in favor? Against? On Dec 1, 10:34 pm, guruyaya guruy...@gmail.com wrote: Ummm... you know that it's an opening for xss... right? It's not a big deal if everything else is done right in the

[web2py] Re: Scalability of web2py?

2010-12-01 Thread weheh
To the original post in this thread, I think the idea for distributing session files across the file system is sensible. I use what I believe is a similar web2py capability for distributing files and I know it works and is scalable. As for the rest of the thread, scalability is a moving target.

[web2py] Re: Table names: plural or singular?

2010-12-01 Thread Kostas M
Speaking of table names, I have a question: In Django models, when defining a table e.g. Unit, there is the ability to adjust the name of the table when it is shown in the admin app, using the Meta class as 'verbose_name' for single, and 'verbose_name_plural' for plural: class

[web2py] Re: auth.change_password() not workign

2010-12-01 Thread Aniket Arora
Actually I'm using two forms in a page. One of them is using SQLFORM and second form is using auth.change_password(). The first one works fine but change password form is not being submitted and also doesn't show any error when filled wrongly. This problem occurs where I'm using Version 1.88.2 and

[web2py] Re: Table names: plural or singular?

2010-12-01 Thread mdipierro
There is no label for the table because the name of the table does not show up in any generated forms except, as you say, in appadmin. But appadmin is not quite the same of Django admin. It is designed for the administrator, not for the users. Massimo On Dec 2, 12:48 am, Kostas M

[web2py] Re: how do get me to imporsonate a generic user?

2010-12-01 Thread pbreit
I love the commitment to backwards compatibility but a security issue warrants a fix.

[web2py] Re: Scalability of web2py?

2010-12-01 Thread pbreit
This is a good discussion as it is apparent that web2py is an incredible framework for rapidly building well-designed applications but it's not totally clear what happens in a high volume situation. But let's not forget that pretty much every framework experiences this exactly. While Massimo is

[web2py] Re: onvalidation problem

2010-12-01 Thread VP
latest version. THere are no form errors. On Dec 1, 11:02 pm, mr.freeze nat...@freezable.com wrote: Can you verify that there are no form errors? Currently if there are any form errors, onvalidation will not run. Also, what version are you running? On Dec 1, 10:53 pm, VP vtp2...@gmail.com

[web2py] Re: Please help: Are these errors?

2010-12-01 Thread Seeker
Hi Matt, Thanks very much for responding. I think you may (indirectly) be onto something. It never occurred to me that the auto population of tables with the wizard could be the source of the problem. But it could in fact be that the wizard was perhaps creating records with missing references.