[web2py] Re: Rocket for production sites?

2010-06-05 Thread knitatoms
Thanks for the reply Massimo. It has only just 'clicked' for me how easy it is to put up a site on a Linux VPS (as long as it is not running any other web server / sites). I'm not expecting much traffic so there's no need for me to worry about Apache / mod_wsgi and I have no need to run appadmin

[web2py] Re: LIKE is slow on RDBS; true for GAE also?

2010-06-05 Thread Matthew
Right, which is why this syntax is used: rows = db(buyer.id>0).select().find(lambda row:row.name.startswith('C')) I was just wondering how efficient this really is since it grabs the whole table. I'm going to try it on GAE, I was just wondering if anyone else had yet. On Jun 4, 2:21 am, Álvaro J

[web2py] Re: LIKE is slow on RDBS; true for GAE also?

2010-06-05 Thread mr.freeze
The 'find' and 'exclude' functions are processed by web2py and not the database so making the initial query as efficient as possible will help. On Jun 5, 9:24 am, Matthew wrote: > Right, which is why this syntax is used: > > rows = db(buyer.id>0).select().find(lambda > row:row.name.startswith('C'

[web2py] news?

2010-06-05 Thread Joschua
Hi, is there new information about the stackoverflow-clone?

[web2py] Re: Cherokee-fastcgi server (error log)

2010-06-05 Thread mdipierro
not so simple. We had discussed this with Graham some time ago. The error is server dependent and we cannot be sure of the cause. Web2py musy log it. So far the best action is to just cleanup those file aoutomatically. On Jun 4, 9:08 pm, Álvaro Justen wrote: > On Fri, Jun 4, 2010 at 20:16, mdipie

[web2py] Re: Multiple instances of same application

2010-06-05 Thread mdipierro
This should be easy to do. I would take a patch to do it or I may be able to add it myself in two weeks. Massimo On Jun 5, 12:04 am, Iceberg wrote: > Let me clarify and then summarize. > > First, .hgignore is one thing, "packing" is another. Ok we can leave > the .hgignore out of web2py level, l

[web2py] Re: Rocket for production sites?

2010-06-05 Thread mdipierro
I use setup-web2py-ubuntu.sh on vps.net and I am very pleased. On Jun 5, 5:37 am, knitatoms wrote: > Thanks for the reply Massimo.  It has only just 'clicked' for me how > easy it is to put up a site on a Linux VPS (as long as it is not > running any other web server / sites).  I'm not expecting

[web2py] Re: news?

2010-06-05 Thread mdipierro
Is anybody working on it? On Jun 5, 11:46 am, Joschua wrote: > Hi, is there new information about the stackoverflow-clone?

[web2py] Re: news?

2010-06-05 Thread Joschua
i'm sorry. i wanted to answer in this thread http://groups.google.com/group/web2py/browse_thread/thread/1857d9db961daa1d/ccfb7d14b54b2c3e?hl=en&ie=UTF-8&oe=utf-8&q=StackOverflow+clone+web2py#ccfb7d14b54b2c3e ^^ Is there a public repository? Maybie I could work on it.. On Jun 5, 7:07 pm, mdipierro

[web2py] Re: LIKE is slow on RDBS; true for GAE also?

2010-06-05 Thread mdipierro
GAE does allow rows = db(db.buyer.name>="C")(db.buyer.name<"D").select()| db(db.buyer.name>="c")(db.buyer.name<"d").select() If you want to sort cap independent rows=rows.sort(lambda row: row.name.upper()) On Jun 5, 9:24 am, Matthew wrote: > Right, which is why this syntax is used: > > rows =

[web2py] stumped on a regex

2010-06-05 Thread mr.freeze
I'm trying to replace all newline characters in a chunk of text with BRs except for those inside PRE tags. I can't seem to make it work. Any regex gurus out there?

[web2py] Is there a default file upload when filling forms?

2010-06-05 Thread Jason Brower
I need the avatar (IS_IMAGE) in my authentication table to have a default if nothing is entered. Is this easily possible? I was thinking of having it controller side and just check if it was blank... if so, default it. The image would be based on the auth_user tables .sex value. Any ideas how to

Re: [web2py] stumped on a regex

2010-06-05 Thread Thadeus Burgess
http://hg.thadeusb.com/Web/web2py_utils/file/697470f78d16/web2py_utils/output.py Line 20 - 48 could possibly be adapted. Basicly use a DOTALL regex to find \n (what about \r too, if your on windows), you might want to use os.newline, and then a dotall regex for the pre code blockqoute etc. Then

Re: [web2py] Is there a default file upload when filling forms?

2010-06-05 Thread Thadeus Burgess
Sounds like you got it. if not record.image: if record.sex == "male": return "male.jpg" else: return "female.jpg" else: return record.image -- Thadeus On Sat, Jun 5, 2010 at 12:22 PM, Jason Brower wrote: > I need the avatar (IS_IMAGE) in my authentication table to have a > defa

[web2py] Re: stumped on a regex

2010-06-05 Thread mdipierro
Try this... import uuid, re subs={} while True: match = re.compile('<(pre|PRE)(.*)/(pre| pre)>',re.DOTALL).search(text) if not match: break u=str(uuid.uuid4()) subs[u]=match.group() text=text[:match.start()]+u+text[match.end():] text=text.replace('\n','') for key,value in

[web2py] web2py 1.79.1 is OUT

2010-06-05 Thread mdipierro
As usual, please check it out! x509 emails, thanks Gyuris attachment and html in Mail on GAE, thanks PanosJee fixed docstring in SQLTABLE, thanks aabelyakov TAG(html) parese html into helpers (experimental, still some problems with unicode, \ , thanks RobertVa for unicode help) DIV.elements(find=r

[web2py] Re: Cherokee-fastcgi server (error log)

2010-06-05 Thread Jose
> > There is not much that we can do. The web server logs it. Probably > web2py logs it too. I have to enable log in fcgihandler.py. I'm going to do and see shows. Jose

[web2py] Re: stumped on a regex

2010-06-05 Thread mr.freeze
Thanks Thadeus/Massimo. I'll give each a try and let you know what I find. On Jun 5, 12:57 pm, mdipierro wrote: > Try this... > > import uuid, re > subs={} > while True: >      match = re.compile('<(pre|PRE)(.*)/(pre| > pre)>',re.DOTALL).search(text) >      if not match: break >      u=str(uuid.u

[web2py] Controlling submit button placement

2010-06-05 Thread MikeEllis
Is there a recommended way to control the location of the submit button? I've got an app that dynamically generates lengthy forms with SQLFORM.factory(). To make things easier for the user, I've arranged it so that in many cases the user will only need to fill in one or two items at the top of t

[web2py] Re: Controlling submit button placement

2010-06-05 Thread mdipierro
This will remain backward compatible but can also use (since 1.79.1) {{=form.custom.begin}} {{=form.custom.submit}} {{=form.element('form')}} # use jquery syntax to select element {{=form.custom.end}} Not sure what form[1] is since it should not exist unless you appended something to the form.

[web2py] Re: Controlling submit button placement

2010-06-05 Thread MikeEllis
Thanks, Massimo, that's good to know. In my case, form[1] is the form and form[0] is a dynamically generated H3 element that gets inserted when the form is built. I could (and probably should) move that to the view instead of having it buried in a function called by the controller. No wonder I c

[web2py] Re: convert field to multiple view values?

2010-06-05 Thread MikeEllis
I've been using SQLFORM.factory() for cases where what's in the db needs to be presented to the user in a different format. The online book has some good examples. For your case, my first thought would be to define a function in the model that generates the form, e.g. def fooform(): fields =

[web2py] Re: convert field to multiple view values?

2010-06-05 Thread MikeEllis
Oops hit send by accident. so after the form.accepts(request.vars, session), you'll need code to convert the feet, inches, and fractions to a double and stuff it into the database. Some of the more experienced web2py users may have a better way, but this approach is working for me. Cheers, Mike

[web2py] Re: html text editor selection shift position

2010-06-05 Thread MikeEllis
Yes! I see similar issues all the time on my Mac in Firefox. Most often, things get confused when I break a line with a carriage return. Seems to happen less when working in Chrome. Mike On Jun 4, 11:45 am, Jean Guy wrote: > Hi, > > I would like to know there is other web2py user that are exper

[web2py] Re: html text editor selection shift position

2010-06-05 Thread mdipierro
hmm. I use a Firefox and never seen this. Massimo On Jun 5, 6:17 pm, MikeEllis wrote: > Yes! I see similar issues all the time on my Mac in Firefox.  Most > often, things get confused when I break a line with a carriage > return.  Seems to happen less when working in Chrome. > Mike > > On Jun 4,

Re: [web2py] Re: html text editor selection shift position

2010-06-05 Thread Thadeus Burgess
I don't use the web based editor, but it h as to do with the syntax highlighting, turn that off and it should be fine. -- Thadeus On Sat, Jun 5, 2010 at 6:43 PM, mdipierro wrote: > hmm. I use a Firefox and never seen this. > > Massimo > > On Jun 5, 6:17 pm, MikeEllis wrote: >> Yes! I see si

[web2py] Re: html text editor selection shift position

2010-06-05 Thread NetAdmin
I've seen that problem too when using Firefox and Linux. Now I ONLY use a vi to edit files. On Jun 4, 10:45 am, Jean Guy wrote: > Hi, > > I would like to know there is other web2py user that are experimenting a > shift in selection highlight in html text editor built in web2py dev > environneme

[web2py] Re: convert field to multiple view values?

2010-06-05 Thread Iceberg
And in the controller/view, you can use db.foo.height.represent = lambda v: 'xx feet yy inch zz fraction' to display it, therefore you need not depend on javascript. On Jun6, 7:12am, MikeEllis wrote: > Oops hit send by accident. > > so after the form.accepts(request.vars, session), you'll need co

[web2py] Re: web2py 1.79.1 is OUT

2010-06-05 Thread GoldenTiger
restored 2.4 compatibility?!! which library was included? hashlib? Then, I will try to install web2py on Hostgator , again :) On 5 jun, 20:50, mdipierro wrote: > As usual, please check it out! > > x509 emails, thanks Gyuris > attachment and html in Mail on GAE, thanks PanosJee > fixed docstr

[web2py] Re: web2py 1.79.1 is OUT

2010-06-05 Thread mdipierro
No. It still needs hashlib and sqlite. We restored in the sense that we eliminated a "a=b if c else d" that was not supposed to be there. On Jun 5, 11:48 pm, GoldenTiger wrote: > restored 2.4 compatibility?!! > > which library was included? hashlib? > > Then, I will try to install web2py on Hos

[web2py] web2py seems to lose session

2010-06-05 Thread João Ventura
Hello everyone, i've searched a lot but couldn't find any answer to the following: I'm developing a web application, and i rely heavily on sessions, storing all the user data on a session while the user uses a jquery tab interface. The problem is that sometimes web2py loses the session object, and

[web2py] Re: web2py seems to lose session

2010-06-05 Thread mdipierro
The only thing that comes to mind is if you try store an object in the session. The object may be an instance of class that you define and therefore web2py succeeds in storing the session but fails to retrieve it because the class is not yet defined (or imported) at the time when the session is ret

[web2py] Re: convert field to multiple view values?

2010-06-05 Thread mdipierro
This is a three step process: 1) disable JS validation as float for this field form.element('input[name=height]')['_class']='feet' 2) create a custom validator that filters data in and formats data out class FEET: def __init__(self,error_message='invalid'): self.error_message=error_message