Re: [web2py] Form not processed on first submit

2012-06-27 Thread Johann Spies
On 27 June 2012 17:51, Anthony wrote: > Perhaps form.process() is failing the first time because the _formkey in > the session isn't matching for some reason (don't know why, though). > I am definitely going to investigate this possibility. The previous page was a page with components with more

Re: [web2py] Routes - simple requirement, but how??

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 10:33 PM, Anthony wrote: > It is usually a good thing that we have choices, but not choices of blind > alleys. IMO there should be one comprehensive way for web2py to do routes. > If regex patterns are the only way to solve all situations then so be it - we > should just g

Re: [web2py] Routes - simple requirement, but how??

2012-06-27 Thread Anthony
> > It is usually a good thing that we have choices, but not choices of blind > alleys. IMO there should be one comprehensive way for web2py to do > routes. If regex patterns are the only way to solve all situations then so > be it - we should just get used to it. All our efforts can then g

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Michael Toomim
This is all a great unearthing of the Mystery of Transactions. Thanks for the investigation, Doug. This was difficult for me to learn when I got into web2py as well. Perhaps we could write up all this knowledge somewhere, now that you're figuring it out? Can we have a section on Transactions i

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 9:08 PM, Anthony wrote: > SQLite is a file-based database, so has to have more course locking than a > typical client/server database. Other databases have "select for update" > functionality, which allows you to select a set of records and lock them. > web2py actually suppor

Re: [web2py] Quoting reserved words in DAL

2012-06-27 Thread Michael Toomim
Ok, here's one step closer to a fix! This is what had to be manually changed in order to quote the names of tables/fields to load a postgres database into MySQL. This won't work for other databases. And this only works for importing a database—table creation, with foreign keys, and insert state

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-27 Thread Michael Toomim
:) Because I'm a perfectionist, and I want other developers to be able to install my system by just unzipping the code, running ./serve, and have it just work. So I want to use the built-in webserver and scheduler. There's no reason they shouldn't be able to manage these race conditions correct

Re: [web2py] web2py ported to bottle, flask, pyramid, tornado, wsgiref

2012-06-27 Thread Steve Witham
On Tuesday, March 13, 2012 6:48:04 PM UTC-4, nekrox wrote: > > This week i try to make my tiny version of web2py with werkzeug. > nekrox, how far did you get with that?

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Anthony
SQLite is a file-based database, so has to have more course locking than a typical client/server database. Other databases have "select for update" functionality, which allows you to select a set of records and lock them. web2py actually supports this, via .select(..., for_update=True). Anyway,

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Doug Philips
On Wed, Jun 27, 2012 at 11:53 AM, Anthony wrote: >> > Yes, it does release the lock, as soon as the select is complete. You do >> > not >> > have to do db.commit() after a select. >> Please show me where that is documented. >> Section 7 of http://www.sqlite.org/lockingv3.html says that ONLY >> hap

[web2py] wempy published in the Python Cheese Shop

2012-06-27 Thread G. Clifford Williams
Hey fellow web-2-pirates / web2py-rats. Just thought I'd share with you the fact that I've hijacked the template engine from web2py and made a command line utility similar to Ruby's ERB. I've also stripped down the library a removed gluon integration wrappers and HTML escaping to make it a generall

[web2py] Re: Sending message.html to single new user?

2012-06-27 Thread RKS
Ah, I see. Can't test now but I will in the morning. Thanks. On Wednesday, June 27, 2012 7:30:14 PM UTC-5, Anthony wrote: > > mail.send(to=['form.vars.email'],subject='Your Registration >> Details',message=response.render('new_user.html')) >> > > You have put form.vars.email in quotes, as

[web2py] Re: Suggestion to add more mod_wsgi info to help new users -- WSGIPassAuthorization for instance

2012-06-27 Thread Larry Weinberg
In order to have the web2py examples work out of the box on Apache with mod_wsgi, an extra directive is needed in the Apache configuration for the VirtualHost WSGIPassAuthorization On This allows basic authentication to proceed through. It looks like there are some good reasons why mod_wsgi i

Re: [web2py] Re: Multi_tenant

2012-06-27 Thread Massimo Di Pierro
I would suggest you use a different database (a different connection string) for each hospital depending on the hostname. .domain.com import re; regex = re.compile('.*\://(.*?)/.* db = DAL('postgresq:///%s' % regex.match(request.env.http_host).group(1)) In this way you keep your data separ

[web2py] Re: Sending message.html to single new user?

2012-06-27 Thread Anthony
> > mail.send(to=['form.vars.email'],subject='Your Registration > Details',message=response.render('new_user.html')) > You have put form.vars.email in quotes, as if that is the literal email address. Just do to=[form.vars.email]. Anthony

Re: [web2py] Re: Routes - simple requirement, but how??

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 5:15 PM, villas wrote: > With regards testing routes. I notice there seems to be a way of logging and > there are some doc tests too, not that I know how they work (please forgive > me). However, I wonder whether there is some way I can do something like > this (all strin

[web2py] Using web toolkits with web2py

2012-06-27 Thread Daniel Gonzalez
Hi, I am struggling to get web2py my web application (desktop-like, with buttons and so on) properly rendered in the different browser versions. I would like to use a Web Toolkit to render my components, but still implement all the business logic in a web2py application. Has somebody experience

[web2py] Re: Routes - simple requirement, but how??

2012-06-27 Thread villas
With regards testing routes. I notice there seems to be a way of logging and there are some doc tests too, not that I know how they work (please forgive me). However, I wonder whether there is some way I can do something like this (all strings just random) so I can test my ideas without cha

[web2py] Sending message.html to single new user?

2012-06-27 Thread RKS
In the book it mentions sending message.html to every person in the database. I know you know where it is already but for posterity sake...http://web2py.com/books/default/chapter/29/8. There now seems to be a problem with my code as it only sends the first mail.send and not the other. I really

[web2py] Re: Best practice using scheduler as a task queue?

2012-06-27 Thread ptressel
Michael -- Here's a common scenario. I'm looking for the best implementation using the > scheduler. > > I want to support a set of background tasks (task1, task2...), where each > task: > • processes a queue of items > • waits a few seconds > > It's safe to have task1 and task2 running in pa

[web2py] Re: Is there a place to vote to add an id or class to user forms?

2012-06-27 Thread Anthony
http://code.google.com/p/web2py/issues/list In the meantime, you might change your user() function to something like this: def user(): form = auth() if isinstance(form, FORM): form['_id'] = 'auth_%s__form' % request.args(0) return dict(form=form) Anthony On Wednesday, June

[web2py] Re: Is there a place to vote to add an id or class to user forms?

2012-06-27 Thread RKS
Don't want to be a prude but do you happen to have that URL handy? On Wednesday, June 27, 2012 6:00:11 PM UTC-5, Massimo Di Pierro wrote: > > Make a proposal on googlecode issues > > On Wednesday, 27 June 2012 16:41:23 UTC-5, RKS wrote: >> >> I think it might be pretty simple just to add a class o

Re: [web2py] Re: Multi_tenant

2012-06-27 Thread Ovidio Marinho
I am making an application to control government medical appointments in more than fifty hospitals all use a single postgres database, but each hospital must have administrator access, Operator and User, and each access must be made with the view of their unique data . is this.        Ovidio Ma

Re: [web2py] Re: web2py crashing

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 4:02 PM, Massimo Di Pierro wrote: > I agree. Please check. That's better; thanks. > > On Wednesday, 27 June 2012 17:53:25 UTC-5, Jonathan Lundell wrote: > On Jun 27, 2012, at 3:45 PM, Massimo Di Pierro wrote: >> ok.please check the solution in trunk. > > OK, but I think that

Re: [web2py] Re: web2py crashing

2012-06-27 Thread Massimo Di Pierro
I agree. Please check. On Wednesday, 27 June 2012 17:53:25 UTC-5, Jonathan Lundell wrote: > > On Jun 27, 2012, at 3:45 PM, Massimo Di Pierro wrote: > > ok.please check the solution in trunk. > > > OK, but I think that SocketClosed might be a better exception. And maybe a > comment pointing to thi

[web2py] Re: Suggestion to add more mod_wsgi info to help new users -- WSGIPassAuthorization for instance

2012-06-27 Thread Massimo Di Pierro
Please. Tell us more. On Wednesday, 27 June 2012 16:41:39 UTC-5, Larry Weinberg wrote: > > I'm a newbie to apache configuration, so I just spent hours trying to > determine why none of the REST-api-with-authentication web2py examples > were working for me. All worked fine without authentication.

[web2py] Re: Is there a place to vote to add an id or class to user forms?

2012-06-27 Thread Massimo Di Pierro
Make a proposal on googlecode issues On Wednesday, 27 June 2012 16:41:23 UTC-5, RKS wrote: > > I think it might be pretty simple just to add a class or id to the > auth.user forms by default. It's unsemantic to have to wrap it in a div > just to target those specific inputs or tedious to target

[web2py] Re: SQLdesigner still down for maintenance?

2012-06-27 Thread Massimo Di Pierro
Sorry I forgot. it is up. On Wednesday, 27 June 2012 11:48:05 UTC-5, Alec Taylor wrote: > > I remember trying out the designer when I first started using web2py, > but wanted to improve my web2py knowledge before using it (especially > how to do n+1 unrolling). > > I tried to access it about a

[web2py] Re: Webservice to upload files

2012-06-27 Thread Massimo Di Pierro
if you use web2py trunk you should be able to do something easy like @auth.requires_login() def upload(): if request.post_vars: db.table.insert(upload_fieldname=request.post_vars['fieldname']) then do a post using basic auth. On Wednesday, 27 June 2012 06:10:30 UTC-5, Adriano

Re: [web2py] Re: web2py crashing

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 3:45 PM, Massimo Di Pierro wrote: > ok.please check the solution in trunk. OK, but I think that SocketClosed might be a better exception. And maybe a comment pointing to this thread or something else explaining what it's doing there (it's a pretty odd piece of code otherwise)

Re: [web2py] Form not processed on first submit

2012-06-27 Thread Massimo Di Pierro
This can happen if you have a broken link the page (for example an img src) which accidentally reload the page itself in background. On Wednesday, 27 June 2012 10:51:44 UTC-5, Anthony wrote: > > Perhaps form.process() is failing the first time because the _formkey in > the session isn't matching

[web2py] Re: long text as content for PluginMModal

2012-06-27 Thread Massimo Di Pierro
1) the newline are respected but not converted into . You have to do this manually if that is what you want to do. db.table.field.represent=lambda value, row: DIV(*[P(p) for p in value.split('\n')]) 2) check your layout. Perhaps it sends an encoding other than utf8 On Wednesday, 27 June 2012 1

[web2py] Re: Two questions about models

2012-06-27 Thread cyan
Thanks guys! Very helpful comments and explanations!

Re: [web2py] Re: web2py crashing

2012-06-27 Thread Massimo Di Pierro
ok.please check the solution in trunk. On Wednesday, 27 June 2012 08:20:12 UTC-5, Jonathan Lundell wrote: > > On Jun 27, 2012, at 6:12 AM, Massimo Di Pierro wrote: > > We acn catch it but what do we do? Report "this is a python bug"? > > > The crash is a python bug. The connection failure isn't (n

Re: [web2py] How to change a form.vars.field value after validation?

2012-06-27 Thread Bruno Rocha
SO I think you have to inspect and edit the attributes of * form.custom.widget.captcha* * * after the .validate() check the attr's of form.custom.widget.captcha anc change them. *Bruno Cezar Rocha* http://www.CursoDePython.com.br [image: Facebook] [image: Twitter

Re: [web2py] How to change a form.vars.field value after validation?

2012-06-27 Thread vinicius...@gmail.com
Yes, I was rendering {{=form.custom.widget.captcha}} in my view. Why is this strange? On 06/27/2012 05:58 PM, pbreit wrote: Wow, that is some strange code. What does your view code look like? How are you rendering the captcha widget?

[web2py] Suggestion to add more mod_wsgi info to help new users -- WSGIPassAuthorization for instance

2012-06-27 Thread Larry Weinberg
I'm a newbie to apache configuration, so I just spent hours trying to determine why none of the REST-api-with-authentication web2py examples were working for me. All worked fine without authentication. It turns out the apache server with mod_wsgi strips the authorization out by default. A one l

[web2py] Is there a place to vote to add an id or class to user forms?

2012-06-27 Thread RKS
I think it might be pretty simple just to add a class or id to the auth.user forms by default. It's unsemantic to have to wrap it in a div just to target those specific inputs or tedious to target them in the stylesheet by #auth_user_first_name__row input {} etc or by the #auth_user_first_name_

[web2py] Re: Multi_tenant

2012-06-27 Thread pbreit
I just started using it and it works fine. First, figure out what identifier you want to use to identify the tenant. The Web2py book shows an example that bases it on the URL's sub-domain (ex: tenant1.mysite.com, tenant2.mysite.com, etc.). I'm using the "id" field of a "shop" table so I have ad

Re: [web2py] How to change a form.vars.field value after validation?

2012-06-27 Thread pbreit
Wow, that is some strange code. What does your view code look like? How are you rendering the captcha widget?

[web2py] Re: App does not exist or your are not authorized when deploying layout plugin

2012-06-27 Thread François Delpierre
Then I do not understand why when I deploy web2py.plugin.layout_Compromise.w2p from the web interface it overwrites the view/layout.html file! pivert@skinner:~/Downloads/web2py/applications/Incident_report_2$ ls -lh views/layout.html -rw-r--r-- 1 pivert pivert 6.2K Jun 26 23:49 views/layout.ht

Re: [web2py] How to change a form.vars.field value after validation?

2012-06-27 Thread vinicius...@gmail.com
Here it is: http://pastebin.com/2zMNYWnX On 06/27/2012 05:20 PM, Richard Vézina wrote: Would you show you SQLFORM.factory code? Richard On Wed, Jun 27, 2012 at 4:14 PM, vinicius...@gmail.com mailto:vinicius...@gmail.com>> wrote: Hi guys. I'm facing a

Re: [web2py] How to change a form.vars.field value after validation?

2012-06-27 Thread Richard Vézina
Would you show you SQLFORM.factory code? Richard On Wed, Jun 27, 2012 at 4:14 PM, vinicius...@gmail.com < vinicius...@gmail.com> wrote: > Hi guys. > > I'm facing a problem I didn't find a pure web2py solution. > > I have a SQLFORM.factory() with some fields, including one captcha field. > Every

[web2py] How to change a form.vars.field value after validation?

2012-06-27 Thread vinicius...@gmail.com
Hi guys. I'm facing a problem I didn't find a pure web2py solution. I have a SQLFORM.factory() with some fields, including one captcha field. Every time the form is showed, the input captcha field must be empty. The form may have error in other fields and the captcha could be filled right, but

[web2py] Re: Parsing python from db fields?

2012-06-27 Thread RKS
Unless you're very curious about this problem I wouldn't try too hard. I'm under a deadline so I just used an if statement to wrap the include file I need and referenced the specific pages inside the if. Might not be the most elegant way to do things and certainly it falls into the workaround w

[web2py] Fwd: Multi_tenant

2012-06-27 Thread Ovidio Marinho
       Ovidio Marinho Falcao Neto                 Web Developer              ovidio...@gmail.com           ovidiomari...@itjp.net.br                  ITJP - itjp.net.br                83   8826 9088 - Oi                83   9334 0266 - Claro                         Brasil -- Forwarded m

[web2py] Multi_tenant

2012-06-27 Thread Ovidio Marinho
Procurei isto nas listas todo mundo fala e ninguem esclarece como esta coisa funciona com claridade. I tried that lists everyone talks and no one explains how this thing works with clarity.        Ovidio Marinho Falcao Neto                 Web Developer              ovidio...@gmail.com        

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-27 Thread Niphlod
uhm. why not having them started with systemd or upstart or supervisord ? Scheduler is "by design" allowed to run with multiple instances (to process a longer queue you may want to start more of them), but if you're really loosing money why didn't you rely on that services to be sure that t

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-27 Thread Niphlod
I don't find that this is a common scenario, anyway my idea was put the insertion/update of the task at cron @reboot, wrap that code in a try:except pass block and let the maintenance task to do the honours of checking if other 3 functions are ok. maintenance will run let's say, with a period o

Re: [web2py] Re: How to populate list:reference field?

2012-06-27 Thread Anthony
Have you read this section: http://web2py.com/books/default/chapter/29/6#One-to-many-relation? (Think person=group and dog=event.) On Wednesday, June 27, 2012 12:42:40 PM UTC-4, Alec Taylor wrote: > > I was planning to have a many groups to 1 event relation, but now that > I think of it, there

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-27 Thread Michael Toomim
The problem with terminating the processes is: • sometimes they don't respond to control-c, and need a kill -9 • or sometimes that doesn't work, maybe the os is messed up • or sometimes the developer might run two instances simultaneously, forgetting that one was already running You're righ

Re: [web2py] Re: How to populate list:reference field?

2012-06-27 Thread Andrew
Oops. Didn't see Anthony's post.

Re: [web2py] Re: How to populate list:reference field?

2012-06-27 Thread Andrew
Suggestion. Don't have list of events in the table. It is a 1:m relationship. Querying the events table, with a join will give you the list of events for a group. Would that work. I think it is a lot simpler. What happens when someone adds a new event, does the group automatically get upd

Re: [web2py] Re: Best practice using scheduler as a task queue?

2012-06-27 Thread Michael Toomim
I'm totally interested in solutions! It's a big problem I need to solve. The recurring maintenance task does not fix the initialization problem—because now you need to initialize the recurring maintenance task. This results in the same race condition. It does fine with the 40,000 records proble

[web2py] Re: Reopening: problems running from subfolder with mod_wsgi

2012-06-27 Thread Larry Weinberg
Here is a summary of what I have found. 1 -- My inconsistent problems look like they were due to trying to run two different versions of web2py inside one WSGIProcessGroup or mod_wsgi. This was probably a very bad idea on my part. Needs to be done in separate virtual hosts with separate WSGIPr

[web2py] SQLdesigner still down for maintenance?

2012-06-27 Thread Alec Taylor
I remember trying out the designer when I first started using web2py, but wanted to improve my web2py knowledge before using it (especially how to do n+1 unrolling). I tried to access it about a week ago, but it was down. Just tried now, it still seems down. Can I assist somehow with the mainten

Re: [web2py] Re: How to populate list:reference field?

2012-06-27 Thread Alec Taylor
I was planning to have a many groups to 1 event relation, but now that I think of it, there are better ways of accomplishing that. How do I do the n+1 unrolling simply? I.e.: how do I create a list using SQLFORM (or similar) which finds and displays in a list all [events in [db.event for each gro

Re: [web2py] Webservice to upload files

2012-06-27 Thread Jason Brower
Sure. Easy. Make your model that will hold the files. Create pages that handle the uploading of files. Create pages to handle the downloading of files. The hard part is in the details, for example, what features do you want to have. Which is really something web2py can do be I think you should

[web2py] Re: Forms - MVC model

2012-06-27 Thread Anthony
Follow the examples in the book. Most of the form handling (including creation of the FORM/SQLFORM) object should be handled in the controller. In the view, you can handle the display of the form, but web2py will give you a default display if you just do: {{=form}} Anthony On Wednesday, June

Re: [web2py] Forms - MVC model

2012-06-27 Thread Jason Brower
On 06/27/2012 07:30 PM, Jonathan Lundell wrote: On Jun 27, 2012, at 4:08 AM, Pedro Casalinho wrote: This may be a dumb question but, should forms be created in controllers and passed to the view or should they be created in the view, taking into consideration the MVC model MVC is a pretty

Re: [web2py] Forms - MVC model

2012-06-27 Thread Anthony
> > # controllers\default.py > def index(): > return dict(authed_users=SQLTABLE(db().select(db.auth_user.ALL))) > > # views\default\index.html > {{if 'authed_users' in globals():}} > {{=T('Registered users:')}} > {{=authed_users}} > This example does not show a form -- it shows a table

Re: [web2py] Re: How to populate list:reference field?

2012-06-27 Thread Anthony
Actually, why do you need the "events" field in group_of_events? If you want a one-to-many relation with db.event, you've already got it with the db.event.group_id field. What workflow are you trying to create? Anthony On Wednesday, June 27, 2012 12:09:50 PM UTC-4, Alec Taylor wrote: > > Thanks

Re: [web2py] Forms - MVC model

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 4:08 AM, Pedro Casalinho wrote: > This may be a dumb question but, should forms be created in controllers and > passed to the view or should they be created in the view, taking into > consideration the MVC model > > MVC is a pretty leaky abstraction, especially in the conte

[web2py] Re: IMG ignores css tag x columns

2012-06-27 Thread Anthony
The IMG function just creates a standard HTML tag. If you want it styled in a particular way, you have to add the relevant CSS. If your CSS is based on a particular class, you have to add that class to the IMG() call: IMG(_src=..., _class='logo') Anthony On Wednesday, June 27, 2012 12:03:10

Re: [web2py] Forms - MVC model

2012-06-27 Thread Alec Taylor
Create them in the controller, call them from the template (view). Example: # controllers\default.py def index(): return dict(authed_users=SQLTABLE(db().select(db.auth_user.ALL))) # views\default\index.html {{if 'authed_users' in globals():}} {{=T('Registered users:')}} {{=authed_users}} {{e

[web2py] Re: Two questions about models

2012-06-27 Thread villas
1. I often look at the code. You might like to use this resource... http://www.web2py.com/examples/static/epydoc/index.html For example look in: gluon/tools.py / Class Auth you will see the code to create the forms. 2. Depends on how many tables and functions you have. Unless you really

Re: [web2py] Re: How to populate list:reference field?

2012-06-27 Thread Alec Taylor
Thanks, that fixed some other problems, but my initial problem of not getting the list of events associated with each group is still present. On Thu, Jun 28, 2012 at 1:44 AM, Anthony wrote: >> db.define_table( >>     'group_of_events', >>     Field('group_name', requires=[IS_NOT_EMPTY(), IS_NOT_I

[web2py] IMG ignores css tag x columns

2012-06-27 Thread BlueShadow
Hi I like to make my Logo on my webpage a link to the index page. I found this line of code: {{=TD(A(IMG(_src=URL(r=request,c='static',f='images/Logo.png')),_href=URL(r=request,f='index')))}} But the web2py IMG function ignores the CSS tag which specifies that the logo should be adjusted to 12 co

[web2py] Re: Examples for SQLFORM.grid oncreate, onupdate, ondelete

2012-06-27 Thread k0aun9
Maybe you've already found a way but here's for others who stumbled upon this thread from search. lol I believe this should be the way db.define_table('employee', Field('name','string'), Field('department','string') ) inside the controller, def do_something(form): name = form.vars.name departm

[web2py] Forms - MVC model

2012-06-27 Thread Pedro Casalinho
This may be a dumb question but, should forms be created in controllers and passed to the view or should they be created in the view, taking into consideration the MVC model --

[web2py] Re: sending email with gmail has stopped working

2012-06-27 Thread Brandon Roberts
I have found our firewall was blocking port 587. Once that was open, my emails started sending again. Check with your IT department. On Monday, June 11, 2012 6:17:04 AM UTC-4, david.waldrop wrote: > > I have several applications that use gmail to send invitations and for > authorization. Rec

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Anthony
> > > Yes, it does release the lock, as soon as the select is complete. You do > not > > have to do db.commit() after a select. > Please show me where that is documented. > Section 7 of http://www.sqlite.org/lockingv3.html says that ONLY > happens when autocommit is on, and you have stated th

Re: [web2py] Form not processed on first submit

2012-06-27 Thread Anthony
Perhaps form.process() is failing the first time because the _formkey in the session isn't matching for some reason (don't know why, though). Anthony On Wednesday, June 27, 2012 8:42:56 AM UTC-4, Johann Spies wrote: > > Reloading the page after the form appeared the first time, works. But why?

[web2py] Re: How to populate list:reference field?

2012-06-27 Thread Anthony
> > db.define_table( > 'group_of_events', > Field('group_name', requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, > 'group_of_events.group_name')]), > Field('events', 'list:reference db.event', requires=[IS_IN_DB(db, > 'event.id', '%(event_name)s [%(group_id)s]', multiple=True)]) > When

[web2py] long text in PluginMModal content

2012-06-27 Thread Marco Prosperi
hi all, I'm trying to put a long string as content of a PluginMModal but I face 2 problems: - carriage returns in the string are not rendered (even if I put some \n in the string) - characters with accents (it is an Italian text) are not shown correctly how can I solve these? thanks in advance

[web2py] long text as content for PluginMModal

2012-06-27 Thread Marco Prosperi
hi all, I'm putting a long text in a PluginMModal content but I face 2 problems: - carriage returns of the text are not respected (also if I put some \n in the string) - characters with accents (it is an Italian string) are not shown correctly which are the solutions? thanks in advance Marco

[web2py] Re: Two questions about models

2012-06-27 Thread Anthony
> > 1. In the web2py book, there is an example for Auth settings, which > presumably resides at top-level inside a model: > > auth.settings.register_onaccept.append(lambda form: mail.send(to=' > y...@example.com', subject='new user', message="new user email is %s' % > form.vars.email)) > > and I

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Doug Philips
On Wed, Jun 27, 2012 at 10:13 AM, Anthony wrote: >> Again, with autocommit off: >> The server process does a query/select to see if there is any work to >> do. This provokes SQLite to acquire a SHARED lock. Then the server >> process decides "oops, no work to do, let's go to sleep for a minute". >

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Niphlod
Some nice assumptions here... are you actually suggesting that: - could ever be a stable release of web2py out there that will hold the lock for any pending select ? - the book suggesting a good behaviour is absolutely wrong ? Web2py developers and testers in general would spot that in a breeze w

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Anthony
> > Again, with autocommit off: > The server process does a query/select to see if there is any work to > do. This provokes SQLite to acquire a SHARED lock. Then the server > process decides "oops, no work to do, let's go to sleep for a minute". > Notice that it does nothing to release that lo

Re: [web2py] Two questions about models

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 5:52 AM, cyan wrote: > 1. In the web2py book, there is an example for Auth settings, which > presumably resides at top-level inside a model: > > > auth.settings.register_onaccept.append(lambda form: > mail.send(to='y...@example.com', subject='new user', message="new user ema

Re: [web2py] PythonAnywhere issue with mercurial

2012-06-27 Thread Richard Vézina
Maybe this could help : http://www.web2pyslices.com/slice/show/1433/mercurial-plugin I don't know if it still the same but branching was not supported. Richard On Wed, Jun 27, 2012 at 5:57 AM, Nico Zanferrari wrote: > Hello! > > I'm currently playing with PythonAnywhere (http://www.pythonanywh

Re: [web2py] How to populate list:reference field?

2012-06-27 Thread Richard Vézina
Maybe this could help : http://web2py.com/books/default/chapter/29/14?search=dummy#Populating-database-with-dummy-data On Wed, Jun 27, 2012 at 4:13 AM, Alec Taylor wrote: > Here's a simple test-case: > > # Models > db.define_table( >'group_of_events', >Field('group_name', requires=[IS_NO

[web2py] Re: Two questions about models

2012-06-27 Thread Cliff Kachinske
Look here for more information about Auth and auth: http://web2py.com/books/default/chapter/29/3#Adding-Authentication Having your models in different folders can reduce the overhead per request. When your controller uses multiple tables , you can use symbolic links to bring in the models y

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Anthony
> > Well, earlier it was claimed that the DAL for SQLite left autocommit > on, A quote from my earlier response: *web2py is just using the Python standard library sqlite3 module. According to the docs, it looks l

Re: [web2py] Re: static files extending layout.html

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 6:15 AM, Massimo Di Pierro wrote: > Me neither but look into routes. There's an obscure reason that this message can be generated: if init/compiled/ exists, but init/compiled/controllers_default_generic.pyc does not, you'll get it. (The main reason is that the controller exi

Re: [web2py] Re: web2py crashing

2012-06-27 Thread Jonathan Lundell
On Jun 27, 2012, at 6:12 AM, Massimo Di Pierro wrote: > We acn catch it but what do we do? Report "this is a python bug"? The crash is a python bug. The connection failure isn't (near as I can tell). Just treat it as a dropped connection. > > On Tuesday, 26 June 2012 20:01:49 UTC-5, Jonathan Lu

[web2py] Re: static files extending layout.html

2012-06-27 Thread Massimo Di Pierro
Me neither but look into routes. On Wednesday, 27 June 2012 01:40:50 UTC-5, Annet wrote: > > I have the following menu: > > response.util_menu=[ > ['Disclaimer',request.function=='generic' and > request.args(0)=='disclaimer',URL('util','generic',args='disclaimer')], > ['Privacy',request.f

[web2py] Re: App does not exist or your are not authorized when deploying layout plugin

2012-06-27 Thread Massimo Di Pierro
A plugin is a tar gzipped file. The admin interface only allow you to tar gzip files and folder with the plugin_* prefix but from the shell there is no similtation cd applications/yourapp tar zcvf web2py.plugin.name.w2p [list of files to include] if you include views/layout.html you will accom

Re: [web2py] Re: web2py crashing

2012-06-27 Thread Massimo Di Pierro
We acn catch it but what do we do? Report "this is a python bug"? On Tuesday, 26 June 2012 20:01:49 UTC-5, Jonathan Lundell wrote: > > On Jun 26, 2012, at 5:25 PM, Massimo Di Pierro wrote: > > Looks like a buggy socket.py or ssl.py. Is this an occasional error (which > may depend on parameters su

[web2py] Two questions about models

2012-06-27 Thread cyan
Hi, 1. In the web2py book, there is an example for Auth settings, which presumably resides at top-level inside a model: auth.settings.register_onaccept.append(lambda form: mail.send(to= 'y...@example.com', subject='new user', message="new user email is %s' % form.vars.email)) and I wonder wh

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Doug Philips
On Sat, Jun 23, 2012 at 1:24 PM, Anthony wrote: > No, when autocommit is disabled, that doesn't immediately result in a shared > lock being acquired and held indefinitely. A shared lock is acquired when a > select is made, but only held as long as it takes to actually do the reading > for that sel

Re: [web2py] Form not processed on first submit

2012-06-27 Thread Johann Spies
Reloading the page after the form appeared the first time, works. But why? Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --

Re: [web2py] Re: database locking web2py vs. "external" access...

2012-06-27 Thread Doug Philips
On Sat, Jun 23, 2012 at 1:54 PM, Anthony wrote: >> > You're forgetting another "layer".  DAL leverages on DBAPI >> > implementation of sql drivers. >> >> Well, that's not exactly good news for transparency and ease of >> documentation. > > DB API is just a specification for Python database drivers

Re: [web2py] Form not processed on first submit

2012-06-27 Thread Johann Spies
On 27 June 2012 12:12, stefaan wrote: > >> I cannot solve your problem, but if all else fails it may help to insert > print statements in the controller, to see which lines you reach, > so you can find out if e.g. one of the lines that come before the call to > form.process() throws an exception

[web2py] Webservice to upload files

2012-06-27 Thread Adriano Almeida
Hello Gentleman Is this possible to create a webservice with web2py to upload files (ex:pictures)? How could this be done if I want to have some security (password verification) on it? I would like to integrate a web2py service with a mobile application, dropbox style. Thanks in advance Ad

Re: [web2py] Form not processed on first submit

2012-06-27 Thread stefaan
> > > I cannot solve your problem, but if all else fails it may help to insert print statements in the controller, to see which lines you reach, so you can find out if e.g. one of the lines that come before the call to form.process() throws an exception. --

[web2py] PythonAnywhere issue with mercurial

2012-06-27 Thread Nico Zanferrari
Hello! I'm currently playing with PythonAnywhere (http://www.pythonanywhere.com). Among tons of other features, it allows you to create a free Web2py site with a quick setup procedure. With https you can use the usual Administrative interface, but I was not able to use its versioning feature.

Re: [web2py] Form not processed on first submit

2012-06-27 Thread Johann Spies
form=SQLFORM.factory(db.akb_articles) the .factory was not originally there and is not now. I just used it to see if I the process worked if I manually insert the data. That line should read form=SQLFORM(db.akb_articles) The problem is still a problem. Thanks for your attention. Regar

[web2py] How to populate list:reference field?

2012-06-27 Thread Alec Taylor
Here's a simple test-case: # Models db.define_table( 'group_of_events', Field('group_name', requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'group_of_events.group_name')]), Field('events', 'list:reference db.event', requires=[IS_IN_DB(db, 'event.id', '%(event_name)s [%(group_id)s]', multipl

  1   2   >