Re: [web2py] Modules not detecting functions

2013-02-04 Thread Johann Spies
But if I do this in default.py: import mymodule def index(): value = mymodule.attribute return value it works and return 'goobye world', so default detects the attribute but not the function, why is this? Maybe I'm not building the module correctly? I've tried to put the module

[web2py] Re: Logging in with applications.

2013-02-04 Thread Vaibhav Kapoor
models/db.py from gluon.tools import Auth,Crud, Service, prettydate from gluon.contrib.login_methods.basic_auth import basic_auth import datetime crud, service = Crud(db), Service(), auth = Auth(db) auth.define_tables(username=True) auth.settings.allow_basic_login = True auth.settings.hmac_key =

Re: [web2py] Re: DAL IntegrityError on MSSQL after upgrade to 2.3.2

2013-02-04 Thread Andrew Buchan
Update: It seems the piece which generates the problematic statement is in the method migrate_table in dal.py and it currently looks like this: 'ALTER TABLE %s ADD %s__tmp %s;' % (t, key, tt), 'UPDATE %s SET %s__tmp=%s;' % (t, key, key), 'ALTER TABLE %s DROP %s;' % (t, key), 'ALTER TABLE %s

Re: [web2py] Using the web2py online debugger

2013-02-04 Thread Johann Spies
Hallo Mariano, Can you send us a minimal example to reproduce this issue? I have tried to get a minimal example but when I create a new app and test it there it works and I could not reproduce the problem. However I cannot get it to work on my other app which is not that minimal. I get

[web2py] Re: Regarding one Ajax call blocked by another Ajax call

2013-02-04 Thread saransh
Its working after using session.forget(response) Thank you for your reply. On Sunday, February 3, 2013 7:45:15 PM UTC+5:30, Anthony wrote: By default, the session file is locked upon each request, so a new request from the same client is blocked until the previous request is completed and

[web2py] Mercurial Plugin

2013-02-04 Thread Ricardo Amézquita
First of all I want to thanks the developers. Web2py really makes easier to develop web apps. I have been trying to use the HG plugin found in http://www.web2pyslices.com/slice/show/1433/mercurial-plugin to be able to update an app using mercurial. When I access the repo using a browser, I

[web2py] requires _ verification = True , no Flash?

2013-02-04 Thread António Ramos
How can i have a flash message telling the user to check and validate the link sent to the user email? without a flash message the users registering for the first time does not know that an email was sent to his mailbox. Thank you -- --- You received this message because you are subscribed

Re: [web2py] requires _ verification = True , no Flash?

2013-02-04 Thread Bruno Rocha
def flash(user): response.flash = Please check your inbox auth.settings.register_onaccept = flash On Mon, Feb 4, 2013 at 12:12 PM, António Ramos ramstei...@gmail.com wrote: How can i have a flash message telling the user to check and validate the link sent to the user email? without a flash

[web2py] Re: Is there a way to display field label or field value (vs. field name) in smartgrid breadcrumb?

2013-02-04 Thread Massimo Di Pierro
db.f_owner._singular = 'Owner' db.f_owner._plural = 'Owners' This should do what you ask. On Sunday, 3 February 2013 20:19:29 UTC-6, Michael Beller wrote: I can't find any way around this and it looks like this is not the desired behavior for the grid breadcrumbs. One option is to change my

Re: [web2py] Modules not detecting functions

2013-02-04 Thread Massimo Di Pierro
@Johann, this is not a good solution because ties the import to the application name. @Wonton, can you email me your app so I can take a look. What os? what python version? what web2py version? On Monday, 4 February 2013 04:47:46 UTC-6, Johann Spies wrote: But if I do this in default.py:

[web2py] How to create, log-in, and delete user in auth via command line

2013-02-04 Thread Ian W. Scott
I need to create a few user accounts as testing fixtures during some unit tests. How can I do the following via the web2py api? - create a new user account using Auth - log that new user in using Auth - log that user out - delete that user account (as part of test tear-down) If I've missed

[web2py] Re: How to create, log-in, and delete user in auth via command line

2013-02-04 Thread Massimo Di Pierro
Look into functional testing: http://web2py.com/books/default/chapter/29/14?search=webclient On Monday, 4 February 2013 08:32:49 UTC-6, Ian W. Scott wrote: I need to create a few user accounts as testing fixtures during some unit tests. How can I do the following via the web2py api? -

[web2py] Re: How to create, log-in, and delete user in auth via command line

2013-02-04 Thread Ian W. Scott
Ah, perfect! I don't know how I missed that section. Thanks once again, Massimo. Ian On Monday, February 4, 2013 9:34:14 AM UTC-5, Massimo Di Pierro wrote: Look into functional testing: http://web2py.com/books/default/chapter/29/14?search=webclient On Monday, 4 February 2013 08:32:49

Re: [web2py] Re: wiki: how to cache media files?

2013-02-04 Thread paolo.vall...@gmail.com
Hi Niphlod, I am still trying to understand why the wiki uploads are not returned as 304. The function in charged to return either 200 or 304 is stream_file_or_304_or_206 in streamer.py. Moreover, this function is only called in globals.py inside stream(...). Please have a look at globals.py:344,

[web2py] How is MongoDB for web2py DAL?

2013-02-04 Thread Phyo Arkar
Hello Web2py. I haven't update Web2py for long but we are now trying something with Mongodb using DAL. What should i expect. 1- How many percent of current web2py queries needed to be re-written. 2- What are supported by Web2py DAL for MongoDB , what are Not (compare to SQL RDBMS) 3- Any

Re: [web2py] requires _ verification = True , no Flash?

2013-02-04 Thread António Ramos
thank you 2013/2/4 Bruno Rocha rochacbr...@gmail.com def flash(user): response.flash = Please check your inbox -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an

[web2py] Invalid login, how do I know.

2013-02-04 Thread Annet
In the def user() function I have the following lines of code: if request.args(0)=='login': form.element(_type='submit').update(_value='Log in') session.alert='alert-success' The problem is that when login fails the session.alert should be 'alert-error' Is there a way to check

[web2py] Re: How to create, log-in, and delete user in auth via command line

2013-02-04 Thread Massimo Di Pierro
It is a new feature and we could use some testing and feedback. ;-) On Monday, 4 February 2013 08:37:03 UTC-6, Ian W. Scott wrote: Ah, perfect! I don't know how I missed that section. Thanks once again, Massimo. Ian On Monday, February 4, 2013 9:34:14 AM UTC-5, Massimo Di Pierro wrote:

[web2py] Re: How is MongoDB for web2py DAL?

2013-02-04 Thread Massimo Di Pierro
Make sure you use trunk and not stable with MongoDB. I think apart for transactions and joins most of the queries should work although I have not tried it myself. On Monday, 4 February 2013 08:39:00 UTC-6, Phyo Arkar wrote: Hello Web2py. I haven't update Web2py for long but we are now trying

[web2py] Re: How is MongoDB for web2py DAL?

2013-02-04 Thread Phyo Arkar
not bad , i will try it out in a week. Thanks a lot Massimo! On Monday, February 4, 2013, Massimo Di Pierro wrote: Make sure you use trunk and not stable with MongoDB. I think apart for transactions and joins most of the queries should work although I have not tried it myself. On Monday, 4

Re: [web2py] Re: wiki: how to cache media files?

2013-02-04 Thread Niphlod
On Monday, February 4, 2013 3:38:29 PM UTC+1, Paolo valleri wrote: Hi Niphlod, I am still trying to understand why the wiki uploads are not returned as 304. The function in charged to return either 200 or 304 is stream_file_or_304_or_206 in streamer.py. Moreover, this function is only

Re: [web2py] Re: wiki: how to cache media files?

2013-02-04 Thread paolo.vall...@gmail.com
I thought the same about postponing the opening of the file. Moreover, just after globals:344 in the stream(...) function I have added if isinstance(stream, file): stream_file_or_304_or_206(stream.name, chunk_size=chunk_size,

[web2py] XML, sanitize

2013-02-04 Thread Martijn Hermans
I've got a website in wich I want to allow the user some customization. To prevent my site from injection, I use : {{=XML(markup,sanitize=True)}} This works perfect, except it doesn't allow the tags 'font' and 'span'. I know I can override this default behaviour, but I want to know if I expose

[web2py] Error when changing Postgresql password

2013-02-04 Thread Neil
I've changed the user password for my Postgresql database. When I make the update to the DAL connection string, I then get the following error: postgresql error ... class 'psycopg2.ProgrammingError'(relation auth_user already exists) when going to the site. Notes: - I've made no other

Re: [web2py] Using the web2py online debugger

2013-02-04 Thread Mariano Reingart
On Mon, Feb 4, 2013 at 8:41 AM, Johann Spies johann.sp...@gmail.com wrote: Hallo Mariano, Can you send us a minimal example to reproduce this issue? I have tried to get a minimal example but when I create a new app and test it there it works and I could not reproduce the problem. However

Re: [web2py] converting URL to lowercase before dispatching

2013-02-04 Thread Jonathan Lundell
On 1 Feb 2013, at 12:18 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: You could also edit request.controller, request.function, and request.args (if appropriate) in your model, if you're not using controller-specific models at least. I could see adding a case-normalizing option

Re: [web2py] Re: wiki: how to cache media files?

2013-02-04 Thread Massimo Di Pierro
Honestly I would like to refactor all this logic in web2py. It was already done for web3py: https://github.com/mdipierro/web3py/blob/master/web3py/stream.py Anyway, if you can help fix it in web2py, we can merge everything later Massimo On Monday, 4 February 2013 11:46:03 UTC-6, Paolo valleri

[web2py] Re: XML, sanitize

2013-02-04 Thread Massimo Di Pierro
You will be fine. SPAN should be there by default. It is not and that is an oversight. FONT is not there because deprecated tag. On Monday, 4 February 2013 12:06:42 UTC-6, Martijn Hermans wrote: I've got a website in wich I want to allow the user some customization. To prevent my site from

[web2py] Re: The Great Web Framework Shootout

2013-02-04 Thread OJ
I would gladly accept if anyone else could provide me web2py application with same spesifications as this shootout had. I would do it myself but it is unfair for web2py (I'm just getting to know it) if I would do it and test it with other frameworks :) On Sunday, February 3, 2013 12:08:50 AM

[web2py] Scheduler Quick question

2013-02-04 Thread Leonel Câmara
Hey, I don't know if this is relevant but I'm using webfaction with their wiki's install script. I was wondering what's the easy way to make the new Scheduler run automatically when my application reboots. Thanks -- --- You received this message because you are subscribed to the

[web2py] Re: Error when changing Postgresql password

2013-02-04 Thread Limedrop
(a) Because when you changed the DAL connection string, web2py thinks it might be a new database and tries to recreate the tables from scratch. (b) You could try: db = DAL(...,fake_migrate_all=True) run the app and, if successful, then: db = DAL(...,fake_migrate_all=False) But read the

[web2py] skyrocketing memory. How to pinpoint the problem?

2013-02-04 Thread pumplerod
I had been having critical memory overflow problems and finally saw a post about a memory leak in the version I was using (2.1.x) so I have updated to the latest stable version (2.3.2), however I am still seeing my memory climb until the machine crashes. I'm using web2py as my interface which

[web2py] Re: skyrocketing memory. How to pinpoint the problem?

2013-02-04 Thread pumplerod
To further elaborate. I am running my web2py instance on a VPS at dreamhost.com with a memory allocation of 4Gig. It is running under passenger. On Monday, February 4, 2013 12:16:38 PM UTC-8, pumplerod wrote: I had been having critical memory overflow problems and finally saw a post

[web2py] Background M2M communication

2013-02-04 Thread Bernard
Hi web2py users, I've been using web2py for a few months now, thank you to the developers for the great work. I'm working on an interactive web based monitoring and control Application that communicates with ~30 mobile field units at a time to get periodic 'semi-realtime' status reports

[web2py] Re: The Great Web Framework Shootout

2013-02-04 Thread Massimo Di Pierro
This was my previous comment: https://github.com/seedifferently/the-great-web-framework-shootout/issues/14 Notice that some of the frameworks are using native sqlite api and some are using ORMs. A comparison is difficult. On Monday, 4 February 2013 13:26:14 UTC-6, OJ wrote: I would

[web2py] Re: html5 code to load/save textarea or other input

2013-02-04 Thread Derek
Pretty cool. I just started working on something like this last week. My goal was to process CSV files client side though, without having to use Web2py's csv parser (it's good, but not good enough for some of my files). This is a good javascript CSV parser that does meet RFC 4180 specs.

[web2py] Re: The Great Web Framework Shootout

2013-02-04 Thread OJ
Hey Thanks Massimo! I didn't notice that one, sorry! I have to be careful, I know. I'll try to rule out (or measure) all possible moving parts. I fell in love with DAL therefore I took web2py to my agenda to do in 2013 in the first place. All other features has stunned me ever since I've moved

Re: [web2py] Re: wiki: how to cache media files?

2013-02-04 Thread Niphlod
Uhm, I was just thinking to return a string instead of the open stream. attached the patch (some refactoring bits added) @Paolo: turns out that wiki has it's own download() function to handle files . in order to return cache headers you should do: def yourwikiindex(): zero =

[web2py] Re: Error when changing Postgresql password

2013-02-04 Thread Neil
Worked perfectly - thanks. On Monday, February 4, 2013 8:08:47 PM UTC, Limedrop wrote: (a) Because when you changed the DAL connection string, web2py thinks it might be a new database and tries to recreate the tables from scratch. (b) You could try: db = DAL(...,fake_migrate_all=True)

[web2py] Re: Background M2M communication

2013-02-04 Thread Derek
Well, depends on the MFUs I guess. I would probably bypass web2py for this and simply use a javascript based polling reader based on websockets. Of course, you'd have to have a websockets enabler on all the MFUs Is there any reason why you'd use a database for this? If all you are looking for

[web2py] Re: Background M2M communication

2013-02-04 Thread Bernard
Thanks Derek, There is a second requirement that is not realtime based, but I omitted that because the challenges are not as tricky. The workstation has a database to manage historical data and keep configuration information for the field units (GPS location, IP address etc.), but also has

[web2py] Re: Is there a way to display field label or field value (vs. field name) in smartgrid breadcrumb?

2013-02-04 Thread Michael Beller
I already use the Singular and Plural properties for the table but the grid breadcrumbs don't appear to use them. Also, the breadcrumb uses the field name (f_owner) and not the label (Owner). Here is my model ... db.define_table('t_owner', Field('f_name', type='string', label=T('Name')),

[web2py] Re: Image store with open does not work on GAE

2013-02-04 Thread c h
I think the problem is with the open(), i'm not sure that works at all on GAE, and/or the path to the file is not what you expect. I'm not sure how to pragmatically insert an image into the datastore. On Sunday, February 3, 2013 1:30:20 AM UTC-8, Sebastian Cambeo wrote: OK, I created a

[web2py] Invalid view for generic.load on server but works fine locally

2013-02-04 Thread Nicholas Duffy
Hello all, I have a view that looks like this: *studiomaster/index.html* {{extend 'layout.html'}} div id=studiochart class=single-chart/div {{=LOAD('studiomaster', 'grid.load', ajax=True, target='grid', content='Loading...')}} The grid function returns a SQLFORM.grid - after filling in the

[web2py] web2py and handlebars fix

2013-02-04 Thread Francisco Costa
http://stackoverflow.com/questions/12132947/change-default-delimiters-in-ember-js/14697027#14697027 If you don't want to change any delimiters (on web2py or in handlebarshttp://handlebarsjs.com/) you can do it by saving the handlebars template in an external file like * people.hbs* in the

[web2py] Re: The Great Web Framework Shootout

2013-02-04 Thread Massimo Di Pierro
I did not find it myself the first time I looked. ;-) Notice I used sqlite api and not DAL to comare with bottle and flask where the examples also use the sqlite api instead of SQLA. On Monday, 4 February 2013 15:04:07 UTC-6, OJ wrote: Hey Thanks Massimo! I didn't notice that one, sorry! I

Re: [web2py] Re: wiki: how to cache media files?

2013-02-04 Thread Massimo Di Pierro
In trunk! On Monday, 4 February 2013 15:05:05 UTC-6, Niphlod wrote: Uhm, I was just thinking to return a string instead of the open stream. attached the patch (some refactoring bits added) @Paolo: turns out that wiki has it's own download() function to handle files . in order to

[web2py] Re: Is there a way to display field label or field value (vs. field name) in smartgrid breadcrumb?

2013-02-04 Thread Massimo Di Pierro
I see. You are right. I think I now fixed it in trunk. Can you please check it? On Monday, 4 February 2013 16:28:25 UTC-6, Michael Beller wrote: I already use the Singular and Plural properties for the table but the grid breadcrumbs don't appear to use them. Also, the breadcrumb uses the

[web2py] smartgrid custom layout

2013-02-04 Thread Jack
Hi All, Just a question regarding the smartgrid. I was wondering is there anyway to change the layout and format of the smartgrid. For example if I wanted to change the spacing I have for each row or add verticle lines to separate the columns. Ideally what I'm trying to achieve is have the

[web2py] Re: import csv files to update database

2013-02-04 Thread Jack
Ahh. Works wonderful now. Thanks On Wednesday, January 30, 2013 5:02:16 PM UTC-8, Massimo Di Pierro wrote: I think db[form.vars.table].import_from_csv_file(request.vars.csvfile) should be db[form.vars.table].import_from_csv_file(request.vars.csvfile.file) On Wednesday, 30 January 2013

[web2py] Re: Invalid view for generic.load on server but works fine locally

2013-02-04 Thread Anthony
See http://web2py.com/books/default/chapter/29/10#Generic-views. The framework disables generic views by default, though in db.py of the scaffolding app, they are enabled on localhost only. Set response.generic_patterns to enable generic.load when needed. Anthony On Monday, February 4, 2013

[web2py] Re: Image store with open does not work on GAE

2013-02-04 Thread Sebastian Cambeo
yes it does work ok GAE ;) I am using currently the following workaround, but this should obviously be handled by web2py and not by me, so please fix this: file = open('test.jpg', 'rb') tmpId = db.table1.insert(image = file) if request.env.web2py_runtime_gae:

[web2py] Re: Example JSON Code

2013-02-04 Thread pal4rp
niphold, what do you mean when you say opening directly the URL that fails? On Thursday, January 31, 2013 1:10:18 AM UTC-8, Niphlod wrote: did you try opening directly the url that is failing through ajax ? that 404 could be originated by an incorrect/mispelled url. On Thursday, January 31,

[web2py] Include odbc and mssql support with pypyodbc.py

2013-02-04 Thread Derek
Any way we can add this? http://code.google.com/p/pypyodbc/ It's a pure python implementation of pyodbc. I've tested it with pypy1.9 on web2py 2.3.2 and it works fine (yes, I edited dal.py and renamed all instances of pyodbc to pypyodbc). -- --- You received this message because you are

[web2py] serving php and python in shared hosting

2013-02-04 Thread José Eloy
Hello everybody! I got to install web2py in Hostgator following this instructions: https://groups.google.com/forum/?fromgroups=#!topic/web2py/h8uLiDCerx0 The website made with web2py works very well (http://www.transicion.mx). But I have to serve also php pages (especifically a joomla site).

[web2py] Re: skyrocketing memory. How to pinpoint the problem?

2013-02-04 Thread pumplerod
As a more complete test I did 3 things... 1) replicated what my function through web2py was doing in a separate script and ran that thousands of times on the same server. This did not severely impact memory usage. 2) set up a web2py function in my controller to simply return a json obect.

[web2py] Re: Is there a way to display field label or field value (vs. field name) in smartgrid breadcrumb?

2013-02-04 Thread Michael Beller
Thank you - the breadcrumb now displays the field Label but I found another issue with the breadcrumbs ... I start with an action manage_owners that returns a smartgrid for t_owner. If I select the View button for the first owner, e.g. Joe, I get the following link:

[web2py] Re: Web2py Ajax Problem

2013-02-04 Thread Apoorve Mohan
Thanks Anthonyit worked On Sunday, February 3, 2013 7:46:18 PM UTC+5:30, Anthony wrote: See answer to similar issue here: https://groups.google.com/d/msg/web2py/a8Ovzh__x9o/_d7rckBpg9QJ Anthony On Sunday, February 3, 2013 5:54:00 AM UTC-5, Apoorve Mohan wrote: Hi I am firing Ajax

[web2py] Re: Web2Py on OpenShift

2013-02-04 Thread Andrew
Just an update. Since I often fall behind in keeping the openshift template up to date with web2py releases, I've automated the process with an openshift jenkins gear: https://jenkins-genome.rhcloud.com/ Now the OpenShift_Web2py_Build job will check for changes committed to web2py github

Re: [web2py] smartgrid custom layout

2013-02-04 Thread Johann Spies
On 5 February 2013 01:06, Jack jackzhen...@gmail.com wrote: Hi All, Just a question regarding the smartgrid. I was wondering is there anyway to change the layout and format of the smartgrid. For example if I wanted to change the spacing I have for each row or add verticle lines to separate

Re: [web2py] Using the web2py online debugger

2013-02-04 Thread Johann Spies
I am a bit pressed for time right now, but will try and help you debug this when I can. I have marked your email on my to-do-list. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- --- You received this message