[web2py] db._adapter.reconnect()

2012-04-13 Thread Johann Spies
In the past, the database adapter disconnected when a constraint on the database side prohibited a transaction to complete. Will these changes make it possible to handle such a situation as an exception? I am working with Postresql. Regards Johann

[web2py] Re: Default table schema for the Auth tables

2012-04-13 Thread Stefan Scholl
cyan cyanasch...@gmail.com wrote: definitions for each of them, if possible. In addition, can we remove fields from these tables? I know we can add extra fields or re-define the I removed the name fields from auth_user and then some navbar function wrote Hello None,. OK, some minor problem.

Re: [web2py] Re: bidirectional languages

2012-04-13 Thread Kalpa Welivitigoda
On Thu, Apr 12, 2012 at 11:39 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You have to use something like in CSS .rlt { direction:rtl; } .ltr { direction:ltr; } and use something like span class={{=T('rtl')}}{{=T('text')}}/span and translate the direction as you

Re: [web2py] heroku, web2py and gunicorn

2012-04-13 Thread Rahul
Hi Massimo, I am trying to explore gunicorn. Below is the command I use to activate my site. I am not sure if the parameter -s gunicorn does anything. How do I confirm this? I have gunicorn, eventlet and greenlet installed via virtualenv. I am trying to streamline my deployment and

[web2py] Re: Is anyone doing Nested Lists with plugin_jqmobile?

2012-04-13 Thread villas
Here is a function which may be of interest. I have included some test input data. The data is not really nested-list because it doesn't have 'lft' and 'rgt' fields. Rather this assumes that you are using a simple parent_id field to build a list suitable for superfish. If you come up with

[web2py] how I can connect to SQLAnywhere database

2012-04-13 Thread mohamed elsebaey
Hi, Is wep2py support connection to Sybase SQLAnywhere 12 database. Thanks

[web2py] MHT file upload fails

2012-04-13 Thread Sundar
When I am trying to upload an MHT file (single file holding all browser components: html, image etc.), I get an error. I observed it in old as well as new versions of web2py. Are there prohibited extensions of files which cannot be uploaded? Trace: Traceback (most recent call last): File

[web2py] Urlshortening appliance ERROR!

2012-04-13 Thread Chu Duc Minh
I download newest version web2py and download this appliance from https://github.com/mdipierro/web2py-appliances/tree/master/UrlShortening But when i run, i can't shorten URL. (No input form?) And when I click Bookmark button: type 'exceptions.KeyError' '127.0.0.1:8000' Traceback (most recent

Re: [web2py] Is there anyone using Linode to host Web2py??

2012-04-13 Thread Marco Tulio Cicero de M. Porto
2012/4/6 Bruce Wade bruce.w...@gmail.com That script doesnt work on newer ubuntu versions uwsgi-python should just be uwsgi. Tried on 11.10 and 12.04 both failed. I was using 10.04, then I upgraded it to 11.10 and now it doesn't works anymore... why? :P

Re: [web2py] Setup virtual hosting with Web2py and apache2 mod wsgi on Ubuntu server 11.10

2012-04-13 Thread Marco Tulio Cicero de M. Porto
where ? 2012/2/8 Bruce Wade bruce.w...@gmail.com Also if you want to use uwsgi + nginx I supplied an updated script in a past post that works with Ubuntu 11.10 the default one that came with my version of web2py didn't work with Ubuntu 11.10

[web2py] how to make basic auth work?

2012-04-13 Thread selecta
I enable basic auth with auth.settings.allow_basic_login = True I tried wget --user=u...@bla.de --password=xxx http: //127.0.0.1:8000/pyMantis/tlc/records.json/Strain curl --head -u u...@bla.de:xxx http: //127.0.0.1:8000/pyMantis/tlc/records.json/Strain and the python code import urllib2

[web2py] Re: menu issues when no subitems

2012-04-13 Thread Massimo Di Pierro
This: (T('Whatever'), False, URL(...wherever...), [empty]), should be (T('Whatever'), False, URL(...wherever...), empty or []),

Re: [web2py] Re: web2py: encrypt uploaded files

2012-04-13 Thread Massimo Di Pierro
I have not tried it but you can do class EncryptedField(Field): def __init__(self,*a,**b): self.password = b['password'] del b['password'] Field.__init__(self,*a,**b) def store(self,file, filename=None, path=None): newfile =

[web2py] Re: how to change a field type from string to decimal?

2012-04-13 Thread Massimo Di Pierro
Since there are no record you do not need conversion of string to decimals. You can do it in two steps: 1) comment the line that defines the field and run appadmin 2) uncomment the line, change the type and run appadmin done On Thursday, 12 April 2012 15:37:26 UTC-5, Carlos wrote: Hi, Is it

[web2py] Re: how I can connect to SQLAnywhere database

2012-04-13 Thread Massimo Di Pierro
We do not have sybase support but if you can help testing, should be easy to add. On Friday, 13 April 2012 01:45:28 UTC-5, mohamed elsebaey wrote: Hi, Is wep2py support connection to Sybase SQLAnywhere 12 database. Thanks

[web2py] Re: db._adapter.reconnect()

2012-04-13 Thread Massimo Di Pierro
This has nothing to do with it. Anyway, recent version of web2py have automatic reconnect, if that is what you are asking. On Friday, 13 April 2012 02:20:53 UTC-5, Johann Spies wrote: In the past, the database adapter disconnected when a constraint on the database side prohibited a

[web2py] Re: Default table schema for the Auth tables

2012-04-13 Thread Massimo Di Pierro
web2py's auth is take it or leave it. I disagree. You can find the definition as Anthony suggests in the source of gluon/tools.py. You can add fields with auth.settings.extra_fields['auth_user']=[Field('address')] You should not remove fields. because they are the minimum necessary to make

Re: [web2py] heroku, web2py and gunicorn

2012-04-13 Thread Massimo Di Pierro
No. If you want to use gunicorn you must start web2py with anyserver -s gunicorn anyserver comes with web2py. On Friday, 13 April 2012 04:27:14 UTC-5, Rahul wrote: Hi Massimo, I am trying to explore gunicorn. Below is the command I use to activate my site. I am not sure if the

[web2py] Re: MHT file upload fails

2012-04-13 Thread Massimo Di Pierro
This is either a bug in cgi.FieldStorage or in the web server. Can you send me one such file so I can look into it? On Friday, 13 April 2012 06:34:57 UTC-5, Sundar wrote: When I am trying to upload an MHT file (single file holding all browser components: html, image etc.), I get an error. I

[web2py] Re: Urlshortening appliance ERROR!

2012-04-13 Thread Massimo Di Pierro
wot service cannot rate 127.0.0.1:8000 therefore it returns a json error. Not what the application expect. try to url shorten an actual live web site. * * On Friday, 13 April 2012 06:35:32 UTC-5, minhcd wrote: I download newest version web2py and download this appliance from

[web2py] Re: how to change a field type from string to decimal?

2012-04-13 Thread Carlos
Hi, I wanted this to be done in a single step (web request), due to the nature of my app (dynamic db), but I see it can't. Thank you all for your replies. Carlos On Friday, April 13, 2012 8:24:29 AM UTC-5, Massimo Di Pierro wrote: Since there are no record you do not need conversion of

[web2py] Re: db._adapter.reconnect()

2012-04-13 Thread Johann Spies
On Friday, 13 April 2012 15:26:48 UTC+2, Massimo Di Pierro wrote: This has nothing to do with it. Anyway, recent version of web2py have automatic reconnect, if that is what you are asking. Here is an example of what I wanted to do and which did not work in the past but I see it is now

Re: [web2py] Re: db._adapter.reconnect()

2012-04-13 Thread Richard Vézina
In your model definition if you use : unique=True For each field, It should build your db correctly... But maybe you want both field together to be unique... I don't remember how, but I think there is a way to tell web2py about multiple column constraint. I customize validator for doing this...

Re: [web2py] Setup virtual hosting with Web2py and apache2 mod wsgi on Ubuntu server 11.10

2012-04-13 Thread Bruce Wade
You will have to search through the mail list on google. https://groups.google.com/forum/#!searchin/web2py/nginx$20update/web2py/ysmeR0mZVZo/nOBTKhPOgi8J If that doesn't work search for: Updated: uwsgi + nginx script for Ubuntu 11.10 On Fri, Apr 13, 2012 at 5:48 AM, Marco Tulio Cicero de M.

Re: [web2py] Is there anyone using Linode to host Web2py??

2012-04-13 Thread Bruce Wade
uwsgi package changed. On Fri, Apr 13, 2012 at 5:35 AM, Marco Tulio Cicero de M. Porto mtcpo...@gmail.com wrote: 2012/4/6 Bruce Wade bruce.w...@gmail.com That script doesnt work on newer ubuntu versions uwsgi-python should just be uwsgi. Tried on 11.10 and 12.04 both failed. I was using

[web2py] return json with generic.json that is not an object/dictionary

2012-04-13 Thread selecta
is it possible to do something similar to def test(): response.generic_patterns = ['json'] return [1,2,3,4]

[web2py] session store

2012-04-13 Thread Ralo Tannahill
Hi I'm doing some tests with apache+mod_wsgi. The idea is to share sessions between two web servers. I've stored sessions in an external server (using DB and memcache), both of them wotk fine but I find that sessions stored in memcached are deleted in five minutes. Capturing web2py-memcache

Re: [web2py] Re: db._adapter.reconnect()

2012-04-13 Thread Johann Spies
On 13 April 2012 16:52, Richard Vézina ml.richard.vez...@gmail.com wrote: In your model definition if you use : unique=True For each field, It should build your db correctly... But maybe you want both field together to be unique... I know about 'unique'. The constraint I used in the

Re: [web2py] Re: db._adapter.reconnect()

2012-04-13 Thread Michele Comitini
Johan, To do what you want to achieve you could look into SAVEPOINTs. PostgreSQL supports them. They allow to recover the current transaction to a predefined savepoint in case of error. The DAL does not support SAVEPOINT support, yet, but you can use them through executesql(). mic Il 13

[web2py] Database connections speed issue

2012-04-13 Thread Bruce Wade
Hi, When I was running the site and database on the same server there were not speed problems. However as soon as I switched to have a dedicated database server page loading becomes very very slow. Any suggestions? -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade

Re: [web2py] Re: db._adapter.reconnect()

2012-04-13 Thread Johann Spies
On 13 April 2012 19:26, Michele Comitini michele.comit...@gmail.com wrote: Johan, To do what you want to achieve you could look into SAVEPOINTs. PostgreSQL supports them. They allow to recover the current transaction to a predefined savepoint in case of error. The DAL does not support

[web2py] Overlapping periods

2012-04-13 Thread Rick
Hi, I try to make a function that puts periods of time into a database. The function should only add periods that doesn't overlap any of the already registered ones. But the function does not work, and I can't see what's wrong. Any idea? Thanks in advance for help! code from the controller

Re: [web2py] Database connections speed issue

2012-04-13 Thread Bruno Rocha
are you connecting by internal private network or over the internet? there are firewall filtering the packages? On Fri, Apr 13, 2012 at 2:33 PM, Bruce Wade bruce.w...@gmail.com wrote: Hi, When I was running the site and database on the same server there were not speed problems. However as

Re: [web2py] Database connections speed issue

2012-04-13 Thread Bruce Wade
Linode same datacenter different nodes On Apr 13, 2012 11:53 AM, Bruno Rocha rochacbr...@gmail.com wrote: are you connecting by internal private network or over the internet? there are firewall filtering the packages? On Fri, Apr 13, 2012 at 2:33 PM, Bruce Wade bruce.w...@gmail.com wrote:

Re: [web2py] Re: How to add an input field in SQLFORM.grid??

2012-04-13 Thread greenpoise
Richard, I tried Massimos approach but it created one form button rather than one for each row. For my uses, it wont cut it. I need one text field plus a button on each row. I was able to accomplish this like this links = [lambda row: INPUT(_name='qty', _value='1'), lambda row: A('+',

Re: [web2py] Database connections speed issue

2012-04-13 Thread Michele Comitini
To debug do some tests on the web2py machine using psql with -h check for the time it takes to connect to the remote postgresql server and the time to process a query. If the connection takes a long time to setup, it is most likely some dns related problem. If the queries are slow to complete,

Re: [web2py] Re: How to add an input field in SQLFORM.grid??

2012-04-13 Thread Richard Vézina
Yes I think I miss understood... What I would have is the capability to insert many records in one operation (one form submission). I thought that what Massimo suggest turn the SQLFORM.grid in a kind of multiples rows form or something like that. It was not actually clear what Massimo was doing

[web2py] SQLFORM.grid Links question

2012-04-13 Thread greenpoise
Based on this: links = [lambda row: INPUT(_name='qty', _value='1'), lambda row: A('+', callback=URL('cart_callback',vars=dict(id=row.id,action='add',qt=request. vars.qty)))] Is there a way to grab the value of the INPUT to pass them to another function??? qt=request.vars.qty does not cut it.

Re: [web2py] Re: db._adapter.reconnect()

2012-04-13 Thread Richard Vézina
This solution look great, because until now web2py was triggering a error if postgres return not unique and won't insert the data... So, maybe as you suggest Johann this is not the case anymore with recent web2py update, I don't know. But I think we would need a confirmation about Massimo or

[web2py] Re: return json with generic.json that is not an object/dictionary

2012-04-13 Thread Massimo Di Pierro
The generic.json view expects a dictionary. You can do def test(): from gluon.serializers import json return json([1,2,3,4]) On Friday, 13 April 2012 10:15:46 UTC-5, selecta wrote: is it possible to do something similar to def test(): response.generic_patterns = ['json'] return

Re: [web2py] Setup virtual hosting with Web2py and apache2 mod wsgi on Ubuntu server 11.10

2012-04-13 Thread Marco Tulio Cicero de M. Porto
Dude, worked like a charm, I own you. :) But it would be nice if this kind of change was also available at web2py scripts... since the other does not work to all versions of ubuntu for ex. Thanks! Marco Tulio 2012/4/13 Bruce Wade bruce.w...@gmail.com You will have to search through the mail

Re: [web2py] Setup virtual hosting with Web2py and apache2 mod wsgi on Ubuntu server 11.10

2012-04-13 Thread Bruce Wade
Yeah I posted it in here hoping someone would have added it hint hint. Glad it worked for you. -- Regards, Bruce On Fri, Apr 13, 2012 at 2:12 PM, Marco Tulio Cicero de M. Porto mtcpo...@gmail.com wrote: Dude, worked like a charm, I own you. :) But it would be nice if this kind of change

[web2py] Re: Default table schema for the Auth tables

2012-04-13 Thread cyan
I think I will just make those fields invisible for now. Defining custom auth tables seem also a little risky, as it is unclear that which fields must be kept (except for auth_user, which is used as an example in the manual) for both current and future releases. Thanks all! On Friday, April

[web2py] Design of a minimal chat-like application in Web2py

2012-04-13 Thread cyan
Hi group, I am trying to make a minimal multiuser chat-like app using Web2py. Nothing too fancy here, I just need the app to be able to do the following: 1. client browsers can send the receive text msgs from a server 2. server may manipulate the msgs received and selectively routes those

[web2py] Re: Design of a minimal chat-like application in Web2py

2012-04-13 Thread pbreit
A good Stack Overflow: http://stackoverflow.com/questions/333664/simple-long-polling-example-code and article: http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery

Re: [web2py] Design of a minimal chat-like application in Web2py

2012-04-13 Thread Bruno Rocha
Simple example with comet + tornado http://vimeo.com/38972256 (in Portuguese, but you can follow the code) On Fri, Apr 13, 2012 at 7:30 PM, cyan cyanasch...@gmail.com wrote: Hi group, I am trying to make a minimal multiuser chat-like app using Web2py. Nothing too fancy here, I just need

Re: [web2py] Database connections speed issue

2012-04-13 Thread Bruce Wade
psql -h connection was instant psql query was very fast no delay python web2py.py -S yaw -M connected without any problems and was fast. Think it maybe related to rotating banners, new feature. On Fri, Apr 13, 2012 at 12:30 PM, Michele Comitini michele.comit...@gmail.com wrote: To debug do

Re: [web2py] Database connections speed issue

2012-04-13 Thread Bruce Wade
Ok I want to add when I go to admin/app/database administration it is also slow On Fri, Apr 13, 2012 at 4:17 PM, Bruce Wade bruce.w...@gmail.com wrote: psql -h connection was instant psql query was very fast no delay python web2py.py -S yaw -M connected without any problems and was fast.

Re: [web2py] Re: How to add an input field in SQLFORM.grid??

2012-04-13 Thread greenpoise
Richard, you know what? maybe it does what you want actually because what I get is a bunch of records with a txt and one submit button at the end. So, basically a grid within a form. I will write it and run it again and send you a screenshot. D On Friday, 13 April 2012 12:36:29 UTC-7,

Re: [web2py] Database connections speed issue

2012-04-13 Thread Bruce Wade
Ok I fixed the Major slow problem. It was a coding bug, where a session variable was checked and if it was not set the database would be queried to count all adviews currently over 12 million. however the session variable was never updated so this query was always called on every link click :(

[web2py] Syntax error - can not find solution

2012-04-13 Thread Jose
Hi all I have an application that works fine on my development machine (tested with versions 1.99.4, 1.99.7, trunk and another version (I forget) in alwaysdata) In WebFaction I have version 1.99.7 and the application throws a syntax error: Traceback (most recent call last): File

Re: [web2py] Syntax error - can not find solution

2012-04-13 Thread Bruno Rocha
The problem is the Python Version, to pass arguments after one list unpacking *works you need to run Python 2.7+ to solve your ptoblem an run it on webfaction Python you need to replace retorno = DIV(*works, _id='submenu2') with this: retorno = DIV(*works, **{_id:'submenu2'}) On Fri, Apr

Re: [web2py] Syntax error - can not find solution

2012-04-13 Thread Jose
Thanks Bruno. It works perfect

[web2py] Admin not saving data

2012-04-13 Thread Bruce Wade
Hi, Having a strange problem. When using admin database administration and trying to update my password when I click save it refreshes the page without any errors but also doesn't save the password. -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com

Re: [web2py] Plugin Wiki, jqgrid, crud.create error

2012-04-13 Thread Simon Ashley
Thanks Johann, Sorry for the delay. Have just had a chance to have another play. and you're right, it does need to be defined first in the models (would have thought that it defeats some of the benefits of the adhoc nature of the plugin, but no matter) On Thursday, 12 April 2012 17:03:14

[web2py] Curious appengine memcache exception

2012-04-13 Thread David Phillips
I am stumped by a problem I am having with memcache on App Engine. It mostly looks like a memcache issue but I am seeing something funny when I step through the code. I am getting an excpetion (TypeError: 'NoneType' object is not callable) when writing an instance to memcache. The instance

[web2py] Viewing web2py tickets on Google's devserver

2012-04-13 Thread David Phillips
How do you view web2py tickets that are generated while running on Google's devserver? When I look at a ticket using the SDK console, it is encoded in a way that I don't recognize. Like this: (dp0 S'output' p1 Stype 'exceptions.TypeError' 'NoneType' object is not callable p2 sS'layer' p3

[web2py] this might be out of Web2py topic. I am trying to change the time on Ubuntu. It kept showing me UTC

2012-04-13 Thread Kenny
I am trying to change the time on Ubuntu. It kept showing me UTC time. I tried all the method. ln -sf /usr/share/zoneinfo/UTC /etc/localtime and dpkg-reconfigure tzdata but no luck I even changed rcS to UTC=no but no goal Any Idea? I am using linode. I am sorry for unrelated topic. but

[web2py] Re: new feature in trunk: full auditing

2012-04-13 Thread tomt
I'm have been trying to test this new audit function in trunk, but so far the mything_archive table has never been created in any of my tests. Is this the current state of the implementation, or am I missing something? I downloaded the latest trunk and used it web2py admin to create a new app.

[web2py] Re: Is there anyone using Linode to host Web2py??

2012-04-13 Thread davidjensen
Rackspace is full root access, they give you phone support, and it is listed on the front page of python.org. In general, the support people at many hosting services have little knowledge of Python. The least expensive cloud server is $11-12. I had Linode and they would not provide phone

[web2py] Re: this might be out of Web2py topic. I am trying to change the time on Ubuntu. It kept showing me UTC

2012-04-13 Thread Kenny
ignore this post. My letc/localtime was corrupted. Just deleted and resymbolinked it. On Friday, April 13, 2012 9:39:02 PM UTC-7, Kenny wrote: I am trying to change the time on Ubuntu. It kept showing me UTC time. I tried all the method. ln -sf /usr/share/zoneinfo/UTC /etc/localtime and