[web2py] Storing Python code in db?

2013-01-18 Thread Kenny Chung
I am testing out to store Python code and run it by extracting it from the database. It looks simple but it's giving me a weird error. *//Code* {{a=row.temp}} //question.temp is "def f(x):\nx = x + 1\ny = 10\n return x + y" same as below {{b="def f(x):\nx = x + 1\ny = 10\nretu

[web2py] Re: Logging in with applications.

2013-01-18 Thread encompass
The last link was the one I was looking at first. Before this post. But """ login_bare returns user if the user exists and the password is valid, else it returns False. username is the email if the "auth_user" table does not have a "username" field. """ doesn't sound like I logged in a user.

Re: [web2py] If I upload a file manually does it check the validators?

2013-01-18 Thread Massimo Di Pierro
filename=(fileApp.filename.replace(' ', '') if fileApp else '') On Friday, 18 January 2013 19:55:56 UTC-6, Tito Garrido wrote: > > > On Fri, Jan 18, 2013 at 10:30 PM, Bruno Rocha > > wrote: > >> db.files.validate_and_insert(file_upload=db.files.file_upload.store(fileApp, >> filename)) >> > >

[web2py] Re: New Plugin: plugin_markitup

2013-01-18 Thread Massimo Di Pierro
Nice work. This will be useful with auth.wiki. Plugin_wiki is going to be deprecated (unless somebody adopts it) and has been removed from the book. On Sunday, 12 February 2012 15:07:04 UTC-6, Ross Peoples wrote: > > I have created another plugin for the MarkItUp widget. I know that > plugin_wik

Re: [web2py] HOSTING FOR web2py ?

2013-01-18 Thread Bruno Rocha
BTW: PythonAnywhere is fantastic! the consoles, the way it integrates with Dropbox etc... the support also is very helpful. Have you tried to contact them? https://www.pythonanywhere.com/ (click on the send feedback link) maybe the guys can give you an option instead of paypal. On Sat, Jan 1

Re: [web2py] HOSTING FOR web2py ?

2013-01-18 Thread Bruno Rocha
webfaction openshift linode --

[web2py] Re: sqlform.grid exporting with_hidden_cols

2013-01-18 Thread Vincent
ok, ticket submitted: http://code.google.com/p/web2py/issues/detail?id=1294 On Wednesday, January 16, 2013 9:46:20 PM UTC-6, Massimo Di Pierro wrote: > > Please open a googlecode thicket pointing here. We will review and > probably accept it. > > On Wednesday, 16 January 2013 11:21:14 UTC-6, Vinc

[web2py] HOSTING FOR web2py ?

2013-01-18 Thread samuel bonilla
I'm doing testing for my application in pythonanywhere.com, but I had some problems with paypal and I could not buy a domain. someone can recommend another hosting web2py to not only accept paypal ? thank you very much. --

Re: [web2py] If I upload a file manually does it check the validators?

2013-01-18 Thread Tito Garrido
On Fri, Jan 18, 2013 at 10:30 PM, Bruno Rocha wrote: > db.files.validate_and_insert(file_upload=db.files.file_upload.store(fileApp, > filename)) > Seems that it is firing the validator but there is an issue: 'NoneType' object has no attribute 'filename' Version web2py™ (2, 3, 2, datetime.datet

Re: [web2py] displaying and editing joined tables

2013-01-18 Thread Bruno Rocha
There is this Slice: https://www.web2pyslices.com/slice/show/1427/single-form-for-linked-tables --

[web2py] displaying and editing joined tables

2013-01-18 Thread Alex Glaros
Here is an example from: http://web2py.com/books/default/chapter/29/07 db.define_table('person', Field('name', unique=True)) db.define_table('dog', Field('name'), Field('owner', db.person) db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s', zero=T('choose

Re: [web2py] If I upload a file manually does it check the validators?

2013-01-18 Thread Bruno Rocha
db.files.validate_and_insert(file_upload=db.files.file_upload.store(fileApp, filename)) it should fire the validator (I guess) --

[web2py] If I upload a file manually does it check the validators?

2013-01-18 Thread Tito Garrido
Can I use imageutils RESIZE on a manual upload like: aux=db.files.file_upload.store(fileApp, filename) Just wondering if I can resize an image uploaded by http://www.web2pyslices.com/slice/show/1576/html5-file-uploads-with-jquery -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._

Re: [web2py] New Plugin: plugin_markitup

2013-01-18 Thread LightDot
How are you using the plugin? Can you post some code? As to getting the code from BitBucket, go to: https://bitbucket.org/PhreeStyle/web2py_markitup/downloads And select "Tags" or "Branches", you'll see options to download as .zip, .tar.gz or .tar.bz2. Regards, Ales On Saturday, January 19, 201

[web2py] Re: Auth login with Firefox

2013-01-18 Thread villas
Can't figure it out so I shall rebuild the app on top of the latest welcome. That seems to work ok. Thanks, D --

Re: [web2py] New Plugin: plugin_markitup

2013-01-18 Thread Tito Garrido
Hi Ross! Nice addition... I am trying to use it but I am getting: global name 'markitup' is not defined Version web2py™ (2, 3, 2, datetime.datetime(2012, 12, 17, 15, 3, 30), 'stable') Python Python 2.6.6: /usr/bin/python Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. Traceback (mos

[web2py] Re: how to call sqlform from a view

2013-01-18 Thread Derek
I'd just like to point out, that couldn't he also do this: return dict(form2=form2, form1=form1) then in the view you can have this: {{=form1}} {{=form2}} On Friday, January 18, 2013 10:04:22 AM UTC-7, Anthony wrote: > > If you go to the URL /yourapp/default/index, when the index.html view is >

[web2py] Re: how to select current id record for record updat

2013-01-18 Thread Massimo Di Pierro
I am not sure I fully understand. You can do this: id = db.sales.insert(invoice=invoice) old_invoice = db.sales[id].invoice new_invoice = old_invoice db(db.sales.id==id).update(invoice=new_invoice) Does this answer your question? On Friday, 18 January 2013 15:36:30 UTC-6, greaneym wrote: > > H

[web2py] Re: Auth login with Firefox

2013-01-18 Thread villas
Firefox posts the form OK. Irrespective as to whether the credentials are correct or not, I get the login form again. With incorrect credentials I would at least expect a flash of 'Invalid login' on screen, but I do not even get that. Strange. Can you suggest anything specific I should look ou

[web2py] Re: Logging in with applications.

2013-01-18 Thread Alan Etkin
> > My current app runs with only JSON calls is there a way to make the login > occure with JSON? > Did you check this? http://www.web2py.com/books/default/chapter/29/10#Services-and-Authentication http://www.web2py.com/books/default/chapter/29/09#Access-Control-and-Basic-Authentication http://

[web2py] how to select current id record for record updat

2013-01-18 Thread greaneym
Hello, I am working on a shopping cart, using the stable version of web2py, with an sql lite database. In a checkout function, the order information is being inserted into a sales db,(for example it has db.sales[id] == 2 then in a buy function, after a user enters their card information in orde

Re: [web2py] Re: Not able to upload files using SQLFORM.grid in a component

2013-01-18 Thread Tito Garrido
Niphlod, Do you have any slice using HTML 5? Thanks! Tito On Fri, Jan 18, 2013 at 4:30 PM, Niphlod wrote: > uploads via ajax are not supported. that's true even for a SQLFORM loaded > via ajax. > > it's not a limitation on web2py per se, more of an ajax limit if you don't > want to use the n

Re: [web2py] Do we have to have first_name in auth tables?

2013-01-18 Thread Jason Brower
durp durp custome table. On Fri, Jan 18, 2013 at 9:26 PM, encompass wrote: Sorry for the late reply.  Yes, I was using a customer table. BR, Jason On Tuesday, January 1, 2013 9:59:34 PM UTC+2, Niphlod wrote: @alec: that was to change the default behaviour of having a first_name accompanied by l

Re: [web2py] Re: Aren't we not able to translate SQLFORM.grid buttons?

2013-01-18 Thread Massimo Di Pierro
I think this is trunk and nighlty only. On Friday, 18 January 2013 13:30:42 UTC-6, Tito Garrido wrote: > > Massimo is it available on 2.3.2? > > Thanks! > > Tito > > > On Wed, Dec 19, 2012 at 10:00 AM, Tito Garrido > > > wrote: > >> Thanks! >> >> >> On Tue, Dec 18, 2012 at 11:28 PM, Massimo Di P

Re: [web2py] Re: auth.wiki doesn't find pages without tags

2013-01-18 Thread Massimo Di Pierro
The issue to be considered is that this will not work on Google App Engine and it may considerable slow down searches for many wiki pages. Should we make this optional? Or always on? Or make it conditional to non-GAE? Should we break request.var.q in tokens and search that each of them is in tag

Re: [web2py] Re: Aren't we not able to translate SQLFORM.grid buttons?

2013-01-18 Thread Tito Garrido
Massimo is it available on 2.3.2? Thanks! Tito On Wed, Dec 19, 2012 at 10:00 AM, Tito Garrido wrote: > Thanks! > > > On Tue, Dec 18, 2012 at 11:28 PM, Massimo Di Pierro < > massimo.dipie...@gmail.com> wrote: > >> Yes, that was missing. I now added it. >> >> >> On Tuesday, 18 December 2012 16:2

[web2py] Re: Not able to upload files using SQLFORM.grid in a component

2013-01-18 Thread Niphlod
uploads via ajax are not supported. that's true even for a SQLFORM loaded via ajax. it's not a limitation on web2py per se, more of an ajax limit if you don't want to use the new html5 features. On Friday, January 18, 2013 7:58:49 PM UTC+1, Tito Garrido wrote: > > Hi Folks, > > I guess I have

[web2py] Re: Not able to upload files using SQLFORM.grid in a component

2013-01-18 Thread Tito Garrido
I guess I have found a workaround on Antony's reply: https://mail.google.com/mail/u/0/?shva=1#search/label%3Aweb2py+upload+component/138ff34d2e7d0039 Anyway is there any ticket to fix this problem? On Fri, Jan 18, 2013 at 3:58 PM, Tito Garrido wrote: > Hi Folks, > > I guess I have found a bug.

[web2py] Re: Auth login with Firefox

2013-01-18 Thread Niphlod
not that I can think of. did you try inspecting what happens with firebug ? On Friday, January 18, 2013 8:13:37 PM UTC+1, villas wrote: > > Using trunk / Win Vista / > Login works OK with Chrome and IE, but fails with Firefox. > I enter User and Password and click Login. The fields are cleared

Re: [web2py] Do we have to have first_name in auth tables?

2013-01-18 Thread encompass
Sorry for the late reply. Yes, I was using a customer table. BR, Jason On Tuesday, January 1, 2013 9:59:34 PM UTC+2, Niphlod wrote: > > @alec: that was to change the default behaviour of having a first_name > accompanied by last_name and so on on the auth_user table. This is a > different probl

[web2py] Logging in with applications.

2013-01-18 Thread Jason Brower
I want to allow external devices, like phones, to login to my web2py. My current app runs with only JSON calls is there a way to make the login occure with JSON? BR, Jason --

[web2py] Auth login with Firefox

2013-01-18 Thread villas
Using trunk / Win Vista / Login works OK with Chrome and IE, but fails with Firefox. I enter User and Password and click Login. The fields are cleared and the login form redisplayed, but no login. I tried clearing session files and all cookies and other browser data, but cannot get it working

[web2py] Not able to upload files using SQLFORM.grid in a component

2013-01-18 Thread Tito Garrido
Hi Folks, I guess I have found a bug... db.define_table('test', Field('pic', 'upload' uploadseparate=True, autodelete=True)) create a function for your component: def test_function(): form=SQLFORM.grid(db.test) return dict(form=form) load your grid via component: {{=LOAD(f="test_function

[web2py] Re: Need webvtt entry in gluon/contenttype.py

2013-01-18 Thread Magnitus
It's good, thank you :). On Friday, 18 January 2013 11:00:30 UTC-5, Massimo Di Pierro wrote: > > Please. check if the solution in trunk is correct. > > On Friday, 18 January 2013 04:19:01 UTC-6, Magnitus wrote: >> >> http://dev.w3.org/html5/webvtt/#text/vtt >> >> http://www.w3.org/community/texttr

[web2py] bug in smartgrid groupby

2013-01-18 Thread Mark
For web2py 2.2.1. When I use groupby in smartgrid, the number of records found usually displays a wrong number. Often displays "1 records found" even there are many records in the grid. Sometime, for examples, displays 11 when there are 9 records in grid, displays 2 when there are 4 records. T

Re: [web2py] Re: Strange ajax error GET http://192.168.1.167:8000/empre2/default/user/not_authorized 403 ( forbidden)

2013-01-18 Thread Niphlod
given that you fixed 'echo' with something like '/app/default/echo' the problem may be that in your controller, echo() is restricted. It make *Total Sense* (titlecase, yes :-P) that a @auth.requires_signature wouldn't let you access that function without the _signature parameter attached to the

[web2py] Re: Are there conditions under which labels are not shown in SQLForm ?

2013-01-18 Thread Anthony
On Friday, January 18, 2013 12:02:53 PM UTC-5, GeeksRule wrote: > Found the issue ! > The labels are case sensitive !! > > I think we should update the documentation for SQLForm, saying if you are > using "labels", make sure that the keys in the dictionaries are exactly the > same case as mentio

[web2py] Re: Are there conditions under which labels are not shown in SQLForm ?

2013-01-18 Thread Niphlod
given that you must pass a python dictionary and that {'Label1' : 'label for 1', 'label1' : 'label for 1 lowercase'} is a totally standard compliant python dictionary is it really necessary ? the same things goes for headers, col3, etc etc etc. On Friday, January 18, 2013 6:02:53 PM UTC+1

Re: [web2py] Re: How to use formargs, createargs, editargs, viewargs?

2013-01-18 Thread Tito Garrido
That is it! Thanks! Tito On Fri, Jan 18, 2013 at 2:04 PM, Niphlod wrote: > not with createargs, editargs, etc etc etc . in fact, the thing you want > to do isn't accompilished by passing a parameter in a SQLFORM, so these > "args" are useless to your ends. > to "prefill" a value just set i

[web2py] Re: how to call sqlform from a view

2013-01-18 Thread Anthony
If you go to the URL /yourapp/default/index, when the index.html view is executed, it will only have available to it whatever is returned by the index() function in the default.py controller. If you want to display the form created in the display_form() action, you have to create a /views/defau

Re: [web2py] Re: How to use formargs, createargs, editargs, viewargs?

2013-01-18 Thread Niphlod
not with createargs, editargs, etc etc etc . in fact, the thing you want to do isn't accompilished by passing a parameter in a SQLFORM, so these "args" are useless to your ends. to "prefill" a value just set its default before returning the grid. logic is up to you. def test(): db.

[web2py] Re: Are there conditions under which labels are not shown in SQLForm ?

2013-01-18 Thread GeeksRule
Found the issue ! The labels are case sensitive !! I think we should update the documentation for SQLForm, saying if you are using "labels", make sure that the keys in the dictionaries are exactly the same case as mentioned in your db.py. On Friday, 18 January 2013 03:40:54 UTC-5, Niphlod wrot

[web2py] Re: how to call sqlform from a view

2013-01-18 Thread Niphlod
you're two or more steps ahead than your brain def display_form(): in a controller named "thecontroller.py" will work ok as long as in a view views/thecontroller/display_form.html there's a {{=form}} written inside. If you want to copy/paste examples in the book at least read the

Re: [web2py] Re: Strange ajax error GET http://192.168.1.167:8000/empre2/default/user/not_authorized 403 ( forbidden)

2013-01-18 Thread António Ramos
yes i know i´m just confused because of the error. That is why i went to the console to test it the ajax function does not work if it is get called by a view that has a controller with @auth.requires_signature() Its that right? Thank you António 2013/1/18 Niphlod > 'echo' is the url you're t

[web2py] Re: how to call sqlform from a view

2013-01-18 Thread Alex Glaros
I (1) created the "person" table in models, (2) typed in the function displayed in my original post in the controller, then (3) inserted {{=form}} in /views/default/index.html but receive this error: name 'form' is not defined I'm just trying to make the example in the documentation work so tha

Re: [web2py] Re: How to use formargs, createargs, editargs, viewargs?

2013-01-18 Thread Tito Garrido
Sorry, I still don't get how to use it... example: db.define_table('table1', Field('name', requires=IS_NOT_EMPTY()), ) db.define_table('table2', Field('name', requires=IS_NOT_EMPTY()), Field('table1', 'reference table1', requires = IS_IN_DB(db,db.table1.id ,'%(name)s')), ) Then

Re: [web2py] Re: auth.wiki doesn't find pages without tags

2013-01-18 Thread Vinicius Assef
Massimo, in Wiki.search() method, there is this code: if query is None: query = (db.wiki_page.id == db.wiki_tag.wiki_page) &\ (db.wiki_tag.name.belongs(tags)) query = query | db.wiki_page.title.contains(request.vars.q) So, search touc

[web2py] Re: Strange ajax error GET http://192.168.1.167:8000/empre2/default/user/not_authorized 403 ( forbidden)

2013-01-18 Thread António Ramos
i have @auth.requires_signature() in my controller function behing the view when calling the ajax function if i remove it the error i get in javascript console is http://192.168.1.167:8000/empre2/default/showemp/echo 500 (INTERNAL SERVER ERROR) Does it have to do with auth? Thank you 2013/1/

[web2py] Re: Strange ajax error GET http://192.168.1.167:8000/empre2/default/user/not_authorized 403 ( forbidden)

2013-01-18 Thread Niphlod
'echo' is the url you're trying to call .. usually is /app/controller/function . 'echo' alone gets evaluated depending on the page you're on, appending to (or replacing the last bit of) the current url. On Friday, January 18, 2013 5:06:01 PM UTC+1, Ramos wrote: > > hello > > i made this si

[web2py] Re: Grid with multiple left joins

2013-01-18 Thread Massimo Di Pierro
Looks good. Can you please send me a patch applied to the trunk version? On Friday, 18 January 2013 05:47:20 UTC-6, Felipe Meirelles wrote: > > Did anyone saw it? > > On Monday, January 14, 2013 5:41:36 PM UTC-2, Felipe Meirelles wrote: >> >> Please desconsider the sorter_icons parameter, its a c

[web2py] Strange ajax error GET http://192.168.1.167:8000/empre2/default/user/not_authorized 403 ( forbidden)

2013-01-18 Thread António Ramos
hello i made this simple test in javascript chrome console i typed ajax('echo', ['name'], 'target') to call my function and it returns GET http://192.168.1.167:8000/empre2/default/user/not_authorized 403 (FORBIDDEN) thank you António --

[web2py] Re: how to support video in an app

2013-01-18 Thread Massimo Di Pierro
from gluon.contrib.autolinks import expand_one {{=expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA')}} On Friday, 18 January 2013 04:58:20 UTC-6, sasogeek wrote: > > at the moment, i can let users upload pictures and use the img tag to > allow the image to be displayed on a page, when user

[web2py] Re: Need webvtt entry in gluon/contenttype.py

2013-01-18 Thread Massimo Di Pierro
Please. check if the solution in trunk is correct. On Friday, 18 January 2013 04:19:01 UTC-6, Magnitus wrote: > > http://dev.w3.org/html5/webvtt/#text/vtt > > http://www.w3.org/community/texttracks/2012/08/23/webvtt-support-in-browsers/ > > I know the format is still pretty bleeding edge, but it s

[web2py] Re: change string format of date picker

2013-01-18 Thread Massimo Di Pierro
You can do db.table.field.requires = IS_DATE(format = '%D-%M-%Y') this can be done globally or in one action only. It will affect forms. You also need to change the format in JS calendar. This is in the code in web2py_ajax.html: