[web2py] Redirected https is returning HTML instead of JSON. Direct call works fine.

2012-06-28 Thread Larry Weinberg
I have a function that returns JSON data. It works great when called directly over https (using curl or pycurl). If however I have a redirect somewhere that sends me to my web2py function it returns html instead which requests a redirect from the caller. I would like it to continue to deliver th

[web2py] response.menu problem

2012-06-28 Thread Annet
In menu.py I have the following code: response.cms_menu = [['Home',request.controller=='cms' and request.function=='index',URL('cms','index')]] def adjustCmsMenu(): if session.cmsadmin_menu: response.cms_menu.append(['Admin',request.controller=='cmsadmin',URL('cmsadmin','router')])

[web2py] Re: static files extending layout.html

2012-06-28 Thread Annet
> Me neither but look into routes. > Indeed, the problem was caused by an incorrect routes, thanks for pointing me in that direction. Kind regards, Annet.

Re: [web2py] Re: SQLdesigner still down for maintenance?

2012-06-28 Thread Alec Taylor
Thanks :) On Thu, Jun 28, 2012 at 8:58 AM, Massimo Di Pierro wrote: > 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 i

[web2py] web2py Application Development Cookbook

2012-06-28 Thread Alec Taylor
Mine finally arrived in the mail! :D

[web2py] Re: long text as content for PluginMModal

2012-06-28 Thread Marco Prosperi
the first issue is solved by your suggestion, thank you. For the second I still have problems: I've created my application using 'welcome' application as template. So I have in layout.html and @charset "UTF-8"; in base.css. The strange thing is that if I run the application locally on my Win

[web2py] Re: response.menu problem

2012-06-28 Thread Annet
I made some adjustments: In menu.py: def adjustCmsMenu(): response.cms_menu = [['Home',request.controller=='cms' and request.function=='index',URL('cms','index')]] if session.cmsadmin_menu: response.cms_menu.append(['Admin',request.controller=='cmsadmin',URL('cmsadmin','index')]

Re: [web2py] Form not processed on first submit

2012-06-28 Thread Johann Spies
On Wednesday, 27 June 2012 17:51:44 UTC+2, 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). >> >> >> Anthony, I have investigated by putting a 'print session' in the controller and

Re: [web2py] DAL performance vs executesql

2012-06-28 Thread Johann Spies
On 27 June 2012 03:34, Anthony wrote: > I wish it was possible to use other time-saving tools like SQLFORM.grid >> with db.executesql(). >> >> At the moment most of the representation tools like SQLTABLE and >> plugin_wiki's jqgrid suppose DAL usage. >> > > This wouldn't help with SQLFORM.grid, w

Re: [web2py] Standalone DAL leaves mysql connections opened

2012-06-28 Thread Daniel González Zaballos
A little bump in this topic. Somebody has any idea of how use standalone dal without leaving connections opened? BR Daniel El 22/06/12 18:23, demetrio escribió: Hi everyone, I have connected WebDAV and SVN auth with a wsgi script. I needed to use a standalone DAL. When you do a dav petition

[web2py] URL vs http_referer

2012-06-28 Thread Manuele Pesenti
how could it be that this controller returns two different values for url1 and url2 if I visit the page through https? Is it correct? I was lookig a way to distinguish in my app the protocoll used for browsing. def test(): url1 = URL(host=True, scheme=True) # -> http://... url2 = reques

Re: [web2py] Re: Multi_tenant

2012-06-28 Thread Ovidio Marinho
I can not split into separate database, as the management reports need to filter all information. What I need is that the data are shown to hosptal (1) is only seen by him. No problem if all hospitals being in the same database, so is the question of security in view. When the login Hospital (1) is

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

2012-06-28 Thread Doug Philips
On Thu, Jun 28, 2012 at 12:08 AM, 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 sup

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

2012-06-28 Thread Doug Philips
On Thu, Jun 28, 2012 at 1:02 AM, Jonathan Lundell wrote: > The SQLite adapter simulates select for update by wrapping the select+update > in a transaction. Not too efficient, since it has to lock the entire > database, but it'll do it. Thanks, I wish it worked in the released version, and I'm hop

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

2012-06-28 Thread Anthony
> > > Anyway, you might be better off looking into using the scheduler, or a > > third-party task queue like Celery (a web2py Celery plugin was started > at > > some point, though not sure it is complete). > > I don't understand, how will that let me do a read-modify-update > transaction? It

Re: [web2py] Form not processed on first submit

2012-06-28 Thread Anthony
Probably need to see more code -- for grid page, component, and add_article. On Thursday, June 28, 2012 5:29:40 AM UTC-4, Johann Spies wrote: > > > > On Wednesday, 27 June 2012 17:51:44 UTC+2, Anthony wrote: >> >> Perhaps form.process() is failing the first time because the _formkey in >> the ses

[web2py] Re: response.menu problem

2012-06-28 Thread Anthony
> > @auth.requires(lambda: auth.has_membership(ADMIN)) > def router(): > [snip] > adjustCmsMenu() > redirect(url) > The menu is stored on the response object, which only lives during the request. Above, you adjust the menu, but then immediately redirect, which starts a n

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

2012-06-28 Thread Anthony
> > A controller-name map (or perhaps some generalization of that concept) > would be relatively straightforward in the parametric router. Not sure how > generally useful it'd be. > Something like that would be particularly useful when using plugins, as you usually do not want "plugin_" in you

[web2py] Use of custom CSS, HTML and JS for the view

2012-06-28 Thread mrtn
Hi, I am trying to use some custom CSS (web2py.css is not used due to potential conflict), HTML and JS (web2py.js is also not used). Now I wonder how should I tell web2py to link up these custom resources? Do I still have to use layout.html and web2py_ajax.html and modify them accordingly to u

Re: [web2py] Form not processed on first submit

2012-06-28 Thread Johann Spies
> In Module: > > Sorry here is the correct code for the function in the module: def gekose_skrywers(db, ids): import pdb request = current.request session = current.session if ids: session.ids = ids session.skrywers = set([x.uuid for x in (db.akb_authors.id.belon

[web2py] Re: Use of custom CSS, HTML and JS for the view

2012-06-28 Thread Anthony
> > I am trying to use some custom CSS (web2py.css is not used due to > potential conflict), HTML and JS (web2py.js is also not used). Now I wonder > how should I tell web2py to link up these custom resources? Do I still have > to use layout.html and web2py_ajax.html and modify them accordingly

[web2py] Re: Multi_tenant

2012-06-28 Thread Cliff Kachinske
If you identify the hospital somehow in the domain name, it's easy. As Massimo suggested, .mydomain.com, then db.define_table('super_secret_hospital_stuff', Field('something'), Field('request_tenant', default=request.env.http_host) ... ) Be sure to add the same request_tenant field to au

Re: [web2py] URL vs http_referer

2012-06-28 Thread Jonathan Lundell
On Jun 28, 2012, at 3:41 AM, Manuele Pesenti wrote: > > how could it be that this controller returns two different values for url1 > and url2 if I visit the page through https? Is it correct? I was lookig a way > to distinguish in my app the protocoll used for browsing. If you call URL(scheme=T

[web2py] Re: Installing scheduler on linux

2012-06-28 Thread Tyrone
Hi Guys, Although this script works great when upstart is available, when upstart is not available you can't do it like this. I struggled to find a solution on here or anywhere online, so I have made an alternative script which will work on sysvinit (/etc/init.d) #!/bin/sh DAEMON=/usr/local/b

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

2012-06-28 Thread Jonathan Lundell
On Jun 28, 2012, at 5:18 AM, Anthony wrote: > A controller-name map (or perhaps some generalization of that concept) would > be relatively straightforward in the parametric router. Not sure how > generally useful it'd be. > > Something like that would be particularly useful when using plugins, a

Re: [web2py] Form not processed on first submit

2012-06-28 Thread Anthony
Hmm, this is a bit hard to follow, and I don't readily see the problem. Somewhere, though, on the initial load, it is creating the form twice but displaying the first version in the view (so the _formkey in the view is outdated). Looks like the reload also creates the form twice, but it is the

[web2py] import modules

2012-06-28 Thread Corne Dickens
Hi, Web2py imports modules from the site-packages directory which is a great way to build a project withoud any 'external' dependencies. Only it does not work with modules installed by python easy-install. Python it's self uses a site module for this, which can be added to web2py in an easy way

[web2py] Bug in url parsing / extensions

2012-06-28 Thread Corne Dickens
Hi, There are a few places in the code which are a bit buggy (it looks like code that should be 'changed' already but where skipped) It is about parsing the extension from the erquest url. In some places rsplit is used (which is correct) but in other places split is used which can cause proble

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

2012-06-28 Thread Massimo Di Pierro
Thank you. I updated setup-web2py-ubuntu.sh and setup-web2py-fedora.sh On Wednesday, 27 June 2012 20:47:34 UTC-5, Larry Weinberg wrote: > > 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 > Virtu

Re: [web2py] Quoting reserved words in DAL

2012-06-28 Thread Massimo Di Pierro
Please upload this in a google code issue. I see you use the `tablename` syntax in baseadapter. This works for MySQL my I suspect it will break other databases. I cannot find any doc which says this is a standard SQL syntax. On Wednesday, 27 June 2012 23:56:05 UTC-5, Michael Toomim wrote: > > O

[web2py] Re: Redirected https is returning HTML instead of JSON. Direct call works fine.

2012-06-28 Thread Massimo Di Pierro
can you show some code and tel us how it expect to behave? On Thursday, 28 June 2012 02:02:02 UTC-5, Larry Weinberg wrote: > > I have a function that returns JSON data. > It works great when called directly over https (using curl or pycurl). > > If however I have a redirect somewhere that sends me

[web2py] Re: long text as content for PluginMModal

2012-06-28 Thread Massimo Di Pierro
Online do you mean console/terminal? terminal many not support unicode. On Thursday, 28 June 2012 03:36:43 UTC-5, Marco Prosperi wrote: > > > the first issue is solved by your suggestion, thank you. For the second I > still have problems: > I've created my application using 'welcome' application

[web2py] Re: Standalone DAL leaves mysql connections opened

2012-06-28 Thread Massimo Di Pierro
why not simply? db.commit() db.close() if db in an on object attribute like self.db you can do if self.db: self.db.commit() self.db.close() self.db = 0 you can also do: BaseAdapter.close_all_instances('commit') On Friday, 22 June 2012 11:23:47 UTC-5, demetrio wrote: > > > Hi everyo

Re: [web2py] Quoting reserved words in DAL

2012-06-28 Thread Niphlod
this is quite complicate to port over all databases, because there are no standards for quoting. I can't really express the issue better than this stackoverflow answer http://stackoverflow.com/questions/10573922/what-does-the-sql-standard-say-about-usage-of Il giorno giovedì 28 giugno 20

Re: [web2py] Re: Multi_tenant

2012-06-28 Thread Massimo Di Pierro
Do me the issue is, should all data always be filtered by hospital. If there should only be filtered in some cases and not in other, use explicit queries If some tables are always filtered and some are not, you may want to use the tenant feature. On Thursday, 28 June 2012 05:45:13 UTC-5, Ovidio

[web2py] Re: import modules

2012-06-28 Thread Massimo Di Pierro
In trunk. Excellent! On Thursday, 28 June 2012 09:27:58 UTC-5, Corne Dickens wrote: > > Hi, > > Web2py imports modules from the site-packages directory which is a great > way to build a project withoud any 'external' dependencies. > Only it does not work with modules installed by python easy-inst

[web2py] Re: import modules

2012-06-28 Thread Niphlod
Ahem If I install a module using easy_install web2py recognizes it correctly (you should use pip, btw) Maybe you are running two different python version and the easy_installed library is on one interpreter and you run web2py with another interpreter.. Web2py first looks into m

[web2py] Re: long text as content for PluginMModal

2012-06-28 Thread Marco Prosperi
If I open the main page of my web2py application with web2py running on my pc then accented characters are shown correctly but if I open the main page of the copy of my application installed on webfaction server I see mis-rendered accented characters (in both cases I use the same Firefox brows

[web2py] Re: Bug in url parsing / extensions

2012-06-28 Thread Massimo Di Pierro
In trunk too. :-) On Thursday, 28 June 2012 09:29:35 UTC-5, Corne Dickens wrote: > > Hi, > > There are a few places in the code which are a bit buggy (it looks like > code that should be 'changed' already but where skipped) > > It is about parsing the extension from the erquest url. In some place

Re: [web2py] Bug in url parsing / extensions

2012-06-28 Thread Jonathan Lundell
On Jun 28, 2012, at 7:29 AM, Corne Dickens wrote: > There are a few places in the code which are a bit buggy (it looks like code > that should be 'changed' already but where skipped) > > It is about parsing the extension from the erquest url. In some places rsplit > is used (which is correct) bu

[web2py] Re: Parsing python from db fields?

2012-06-28 Thread Anthony
I would actually like to look into this, but the packed application you sent was compiled and doesn't include the original uncompiled code. Could you instead send the uncompiled version? Anthony On Wednesday, June 27, 2012 4:09:45 PM UTC-4, RKS wrote: > > Unless you're very curious about this p

Re: [web2py] Re: Standalone DAL leaves mysql connections opened

2012-06-28 Thread Daniel González Zaballos
It does not work. If I use the self.db = 0 sometimes i get this error (and connections are open): mod_wsgi (pid=1419): Exception occurred processing WSGI script '/home/demetrio/devel/python_virtual_2.6/web2py/applications/forge2/scripts/auth.py'. Traceback (most recent call last): File "/ho

Re: [web2py] Re: Standalone DAL leaves mysql connections opened

2012-06-28 Thread Massimo DiPierro
Can I see the code? On Jun 28, 2012, at 10:08 AM, Daniel González Zaballos wrote: > It does not work. > > If I use the self.db = 0 sometimes i get this error (and connections are > open): > > mod_wsgi (pid=1419): Exception occurred processing WSGI script > '/home/demetrio/devel/python_virtual

[web2py] Alter SQLFORM.factory generated form to put tag into a table

2012-06-28 Thread Richard Vézina
Hello, I wounder what should be the best way to alter a form generated by SQLFORM.factory in a way where fields will be placed into a html table a 3 columns. So each 3 fields I need to insert a "tr" and each field need to be in a "td"... It could be simpler to use FORM instead, but it seems easi

[web2py] Re: long text as content for PluginMModal

2012-06-28 Thread Massimo Di Pierro
very odd? Do they have different python versions? On Thursday, 28 June 2012 09:55:53 UTC-5, Marco Prosperi wrote: > > > If I open the main page of my web2py application with web2py running on my > pc then accented characters are shown correctly but if I open the main page > of the copy of my app

Re: [web2py] Alter SQLFORM.factory generated form to put tag into a table

2012-06-28 Thread Anthony
> > I wounder what should be the best way to alter a form generated by > SQLFORM.factory in a way where fields will be placed into a html table a 3 > columns. > > So each 3 fields I need to insert a "tr" and each field need to be in a > "td"... > You might want to create a custom form layout i

[web2py] migrating date to datetime (mysql)

2012-06-28 Thread Jonathan Lundell
What should I expect? Should it Just Work™, or am I going to have to do a manual conversion?

Re: [web2py] Alter SQLFORM.factory generated form to put tag into a table

2012-06-28 Thread Richard Vézina
Hello Anthony, If I don't use eval(), should I use web2py dummy table, I don't see how I will be able to build dummy table dynamically and declare it as inputs_list to be use with the asterisk... If I just put a asterisk in front of my actual generated inputs_list it not working since the item in

[web2py] Re: Image Optimization

2012-06-28 Thread Jim S
Just saw this today: https://github.com/doda/imagy On Tuesday, June 26, 2012 5:49:43 AM UTC-5, Sanjeet Roy wrote: > > Can anyone tell me how can i optimize the image when the user will be > uploaded ? Acually i want to create a web application where the user can > upload and see the image on

Re: [web2py] Alter SQLFORM.factory generated form to put tag into a table

2012-06-28 Thread Richard Vézina
Forget the precedent email... I think I found how, it didn't work the first time I try, so I just put everything into string, maybe I had problem with a comma... inputs_list = [] for a in field1_names_dict: inputs_list.append(Field(field1_names_dict[a]['field1_name']+'_f1', type='b

[web2py] Re: Parsing python from db fields?

2012-06-28 Thread RKS
That's fine. I'm sorry for such a dumb mistake. Don't know why I did that. Here it is.

Re: [web2py] migrating date to datetime (mysql)

2012-06-28 Thread Jonathan Lundell
On Jun 28, 2012, at 8:46 AM, Jonathan Lundell wrote: > > What should I expect? Should it Just Work™, or am I going to have to do a > manual conversion? Answering my own question: works fine, sets the time to 00:00:00

[web2py] Container div background

2012-06-28 Thread Kevin Miller
Hi All, I am using the Nightly Build with twitter-bootstrap which is fun for the most part. However I wanted the container to have a white background. I thought I could just find the div and add the color:#FF; to the div in the web2py.css file. This has some weird effects. I even tried using

Re: [web2py] Re: uWSGI + Cherokee + web2py - a howto.

2012-06-28 Thread Leopold
Hi. First of all, sorry for not posting back, I had some unplanned issues. Anyway, I tried the Ngnix approach ( http://code.google.com/p/web2py/source/browse/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh) and long story short it didn't work either; same result as it did with cherokee on web browse

Re: [web2py] Alter SQLFORM.factory generated form to put tag into a table

2012-06-28 Thread vinicius...@gmail.com
Richard, wouldn't be better organizing your form direct in HTML using custom.form tags? On 06/28/2012 01:00 PM, Richard Vézina wrote: Forget the precedent email... I think I found how, it didn't work the first time I try, so I just put everything into string, maybe I had problem with a comma..

Re: [web2py] Alter SQLFORM.factory generated form to put tag into a table

2012-06-28 Thread Richard Vézina
Yes that what I am doing right now... I generate the form with SQLFORM.factory and then in the view as you and Anthony suggest I "refact" my form to get what I want. I am pretty impress by this new feature, I was not aware about custom form. It seems exactly what I was searching for... Thanks. R

[web2py] Re: Image Optimization

2012-06-28 Thread Yannick
Used the PIL API to do this On Tuesday, June 26, 2012 6:49:43 AM UTC-4, Sanjeet Roy wrote: > > Can anyone tell me how can i optimize the image when the user will be > uploaded ? Acually i want to create a web application where the user can > upload and see the image on the categorization of albu

Re: [web2py] Alter SQLFORM.factory generated form to put tag into a table

2012-06-28 Thread Richard Vézina
{{=form.custom.begin}} head1head2head3 {{for a in session.field1_names_dict:}} {{=form.custom.widget[session.field1_names_dict[a]['field1_name']+'_f1']}} {{=form.custom.widget[session.field1_names_dict[a]['field1_name']+'_f2']}} {{=form.custom.widget[session.field1_names_dict[a]['fiel

[web2py] Form submission and "view page source"

2012-06-28 Thread Neil
I have a page with a simple form on it, and sometimes when I click the submit button, the page just reloads instead of performing correct action. The only way I've found to consistently reproduce the problem is to click "View page source" first (I'm using Chrome). I then noticed this happens in

[web2py] Can you bind a jquery function to web2py component refresh?

2012-06-28 Thread monotasker
I'd like to be able to bind a jquery function to a div that is the container for a web2py component, so that when the component content is updated by the controller the jquery function is triggered. But I'm not sure whether there is a stock event that would cover the component refresh (I don't

[web2py] Re: Form submission and "view page source"

2012-06-28 Thread Neil
Update: I have found a post of someone who is having the same problem: http://stackoverflow.com/questions/7411269/web2py-form-works-as-expected-most-of-the-time-but-occasionally-it-simply-clears With the "view page source", I guess Chrome is reloading the page, so the session key no longer mat

[web2py] Re: Can you bind a jquery function to web2py component refresh?

2012-06-28 Thread Anthony
You can use the jQuery ajaxSuccess() method. It can register a handler to fire whenever an Ajax call completes successfully. If your page makes multiple different Ajax calls, you can determine which one it is via the url in the Ajax settings object, which ge

[web2py] Re: Form submission and "view page source"

2012-06-28 Thread Anthony
> > What is the recommended solution when this seems to happen randomly to > some pages? Sounds like removing the session from the form opens up > vulnerabilities. > It shouldn't happen "randomly". It should only happen when you open the same page (or any page with a form that has the same for

[web2py] Launch of Web2py 2

2012-06-28 Thread Kevin Miller
Hi All, Anyone knows when web2py 2.0 will be released? I am fighting with the nightly build and having some trouble with twitter bootstrap. I have an app that I want to release but I don't want to release it using the NIghtly build and I need to use twitter bootstrap. Would really love to have

[web2py] Re: Launch of Web2py 2

2012-06-28 Thread Niphlod
don't know if anyone "official" will pop up giving a timetable, but if your only concern is an app with twitter bootstrap I truly recommend to release it with your own template and css's rules Having to wait a 2.0 release just only for the styles of scaffolding app seems to me an overkill.

[web2py] Re: Redirected https is returning HTML instead of JSON. Direct call works fine.

2012-06-28 Thread Larry Weinberg
Sorry. Once again this had nothing to do with web2py. I'll try and be more thorough next time I post. It was the method of redirect that my redirect server was using that was causing the problem. urllib2 and pycurl both failed to handle meta redirect which is supposedly not preferred method th

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

2012-06-28 Thread Larry Weinberg
Great! Thanks Massimo. I'm sure that will save some others some time!

[web2py] Re: Can you bind a jquery function to web2py component refresh?

2012-06-28 Thread monotasker
Perfect. Thanks Anthony. Ian On Thursday, June 28, 2012 4:49:37 PM UTC-4, Anthony wrote: > > You can use the jQuery ajaxSuccess() > method. It can register a handler to fire > whenever an Ajax call completes > successfully. If your page makes multiple differ

[web2py] (1) Linking to image file in the CSS file. (2) Linking to image files in a js file.

2012-06-28 Thread Curiouslearn
Hello, (1) After searching on the web I have see that the following are two valid ways to link to an image in the static/images folder. However, the first way is not working for me. Could this be because I deleted all css files and js files (except jquery) that come with the Welcome app? Please le

[web2py] Re: (1) Linking to image file in the CSS file. (2) Linking to image files in a js file.

2012-06-28 Thread Anthony
> > (1) After searching on the web I have see that the following are two > valid ways to link to an image in the static/images folder. However, > the first way is not working for me. Could this be because I deleted > all css files and js files (except jquery) that come with the Welcome > app?

[web2py] Re: (1) Linking to image file in the CSS file. (2) Linking to image files in a js file.

2012-06-28 Thread curiouslearn
Thanks very much Anthony. A small question before I mark this as complete. Does your comment about web2py template not applying to the CSS file in the static folder also apply to the js file in the static folder? Does web2py template apply only to the Views? Thanks again. On Thursday, June 28,

[web2py] image thumb

2012-06-28 Thread ctrlSoft
hi i would like to implement in my app a feature , create thumbs runtime like in picasa or imgur original image http://i.imgur.com/E9az6.jpg thumb croped http://i.imgur.com/E9az6*b*.jpg or in picasa original image: https://lh3.googleusercontent.com/-iNUvq0K9l24/T

[web2py] Re: (1) Linking to image file in the CSS file. (2) Linking to image files in a js file.

2012-06-28 Thread Anthony
> > Thanks very much Anthony. A small question before I mark this as complete. > > Does your comment about web2py template not applying to the CSS file in > the static folder also apply to the js file in the static folder? > > Does web2py template apply only to the Views? > Yes, though you could

Re: [web2py] Re: Multi_tenant

2012-06-28 Thread Ovidio Marinho
Well now after my DAL I have Instructions db = DAL ('postgres :/ / postgres: passwd @ localhost: 5432/mybd') db._common_fields=Field('request_tenant',default=request.env.http_host,writable=False,readable=False)] What happened? in all my tables I have request_tenant the field, and when I do a drive

[web2py] Re: (1) Linking to image file in the CSS file. (2) Linking to image files in a js file.

2012-06-28 Thread curiouslearn
Thanks very much Anthony. Really appreciate all your help. On Thursday, June 28, 2012 8:24:53 PM UTC-4, Anthony wrote: > > Thanks very much Anthony. A small question before I mark this as complete. >> >> Does your comment about web2py template not applying to the CSS file in >> the static folder

Re: [web2py] Re: (1) Linking to image file in the CSS file. (2) Linking to image files in a js file.

2012-06-28 Thread Jonathan Lundell
On Jun 28, 2012, at 5:24 PM, Anthony wrote: > Thanks very much Anthony. A small question before I mark this as complete. > > Does your comment about web2py template not applying to the CSS file in the > static folder also apply to the js file in the static folder? > > Does web2py template apply

Re: [web2py] Re: (1) Linking to image file in the CSS file. (2) Linking to image files in a js file.

2012-06-28 Thread Anthony
> > Although since the files are really not dynamic, they could be > aggressively cached. > Good point. @cache(request.env.path_info, time_expire=60*60*24, cache_model=cache.ram) def css_js(): response.view = '../static/%s' % '/'.join(request.args) return response.render() caches for a

Re: [web2py] Re: (1) Linking to image file in the CSS file. (2) Linking to image files in a js file.

2012-06-28 Thread Jonathan Lundell
On Jun 28, 2012, at 5:51 PM, Anthony wrote: > Although since the files are really not dynamic, they could be aggressively > cached. > > Good point. > > @cache(request.env.path_info, time_expire=60*60*24, cache_model=cache.ram) > def css_js(): > response.view = '../static/%s' % '/'.join(reque

[web2py] Specify update column

2012-06-28 Thread naveed
I understand I can do an update in web2py like so: db(query).update(field=value) where field corresponds to a column in the table. If I have the column name as a string, how can I use this string variable to specify the column to do an update?

[web2py] Re: Specify update column

2012-06-28 Thread Anthony
db(query).update(**{field_name: value}) Anthony On Thursday, June 28, 2012 9:40:08 PM UTC-4, naveed wrote: > > I understand I can do an update in web2py like so: > > db(query).update(field=value) > > where field corresponds to a column in the table. > > If I have the column name as a string, how

[web2py] Produce Invalid Input message rather than escape and add entry

2012-06-28 Thread Andrew Evans
Hello I am using Santize=True with some HTML permitted. For any invalid characters or HTML added such as or , how can I produce a response error message rather than escaping the code and adding it to the database? So it just doesn't let you post it if there is any invalid markup Any ideas *chee

[web2py] Re: Produce Invalid Input message rather than escape and add entry

2012-06-28 Thread Anthony
Maybe this would work: if not XML(text).xml() == XML(text, sanitize=True).xml(): [send error message] The idea is if there's nothing illegal, then the sanitized version should be the same as the non-sanitized (or look at some of these solutions

[web2py] Re: Form submission and "view page source"

2012-06-28 Thread Massimo Di Pierro
The easiest way is to implement this is to replace self.formkey and self.session.formkey in gluon/html.py so that it store not one key but the last 10 keys. Mover, for security, when a key is used it must be discarded. I am still unsure about this. We can make it work but allowing the past 10 o

Re: [web2py] Re: Launch of Web2py 2

2012-06-28 Thread Kevin Miller
I see your point, but I am not a designer and the integration of twitter bootstrap and web2py is my answer. It has mostly been working out so far. It would take too much work for me to style my app from scratch. :-) On Thu, Jun 28, 2012 at 4:34 PM, Niphlod wrote: > don't know if anyone "officia

Re: [web2py] Re: Launch of Web2py 2

2012-06-28 Thread Massimo Di Pierro
I feel very much the same. On Thursday, 28 June 2012 22:18:33 UTC-5, dundee wrote: > > I see your point, but I am not a designer and the integration of twitter > bootstrap and web2py is my answer. It has mostly been working out so far. > It would take too much work for me to style my app from sc

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

2012-06-28 Thread Michael Toomim
On Wednesday, June 27, 2012 5:02:26 PM UTC-7, ptressel wrote: > > This won't solve your installation / setup issue, but I wonder if it would > help with the overrun and timeout problems... Instead of scheduling a > periodic task, what about having the task reschedule itself? When it's > done w

[web2py] Re: Form submission and "view page source"

2012-06-28 Thread Anthony
> > The easiest way is to implement this is to replace self.formkey and > self.session.formkey in gluon/html.py so that it store not one key but the > last 10 keys. > The number should be configurable. > I am still unsure about this. We can make it work but allowing the past 10 > open forms

Re: [web2py] Installing scheduler on linux

2012-06-28 Thread Michael Toomim
Maybe this should go into the docs somewhere. Maybe the scheduler docstring next to the upstart script? Maybe post an issue on google code to update the docs? http://code.google.com/p/web2py/issues/list On Jun 28, 2012, at 5:41 AM, Tyrone wrote: > Hi Guys, > > Although this script works great

Re: [web2py] Re: Launch of Web2py 2

2012-06-28 Thread Niphlod
who said "from scratch" ? you can as always start from the default look and finetune that ... not everyone is a designer but a few lines of css here and there can be changed around "just to see how it looks". Il giorno venerdì 29 giugno 2012 05:18:33 UTC+2, dundee ha scritto: > > I see your poi