[web2py] Re: request.function=='static' and request.args=='disclaimer' in menu

2013-03-07 Thread Niphlod
ehhmmm. request.args is a list of strings ! :D either you check for request.args(0) == 'disclaimer' or request.args == ['disclaimer'] PS: all those checks only to set the active flag on the li holding the link ? Do that in javascript On Thursday, March 7, 2013 8:25:38 AM UTC+1, Annet

[web2py] Re: Change title of db field in a DAL select

2013-03-07 Thread Niphlod
If you want to do that not using executesql() you need to alter all the Row dicts in the resultset. Altering the colnames is not even documented On Thursday, March 7, 2013 6:55:05 AM UTC+1, at wrote: actually I was looking alternative of sql statement like *select **name, dob

[web2py] Re: How to include headers in gluon.http.HTTP exceptions?

2013-03-07 Thread Niphlod
it **should** work. response.headers = yourdictholdingheaders raise HTTP(status, body) On Thursday, March 7, 2013 4:41:31 AM UTC+1, Alec Taylor wrote: Okay, got it to work; but it's rather messy: raise HTTP(*msg[0:2], **msg[3]) On Thu, Mar 7, 2013 at 1:47 PM, Alec Taylor

Re: [web2py] Web2Py hangs

2013-03-07 Thread Demsar IT
Thank you for your response. Yes I made changes to model (chnages some table name). It could be that its related to this change. I deleted database and it started working. Its just somehow strange that such a problem can hang up everythig. I thought that there culd be some timeouting option. But

[web2py] Re: Book 5th edition out

2013-03-07 Thread Niphlod
I should have kinda automate the whole build process, but it's not automatic for every git commit (i.e. the code running it is at home). If you find the diffbook to lag behind, file an issue on github or send me a PM. On Thursday, March 7, 2013 1:27:34 AM UTC+1, Alan Etkin wrote: kindly

Re: [web2py] how to start Celery worker in web2py

2013-03-07 Thread Niphlod
+1 . Scheduler is a great tool because its feature packed and exploits what is at hand in a normal deployment environment (and it's the best shot at replacing cron likes). The minute I had a redis-backed scheduler at hand (its there, sitting on my disk) I was kinda sad, because what makes the

[web2py] CSV Import Error: ValueError: invalid literal for int() with base 10: ''

2013-03-07 Thread Shawn Wheatley
Hi All, I've been trying to track down an issue importing data from a legacy application I'm converting over to web2py. I have exported the data as described in the documentation (Table Foo, header line, data, 2 rows in-between, END at the end) but I'm getting this traceback when trying to

[web2py] scheduler question, how to use queue_task?

2013-03-07 Thread Tim Richardson
I have an app using the scheduler the old-fashioned way. I have a model which sets up the scheduler. myscheduler = Scheduler(db,dict(import_task_add=import_task_add)) The model also defines the task which the scheduler runs. However, the scheduling of a job is done by a controller, after the

[web2py] Re: Strange problem importing a module

2013-03-07 Thread Daniel Gonzalez
Moving to 2.4.2 did not solve the issue. What did solve it was a reorganizing of my libraries: previously I was importing libraries from a top-level directory, and now I have put all my libraries inside a new namespace, so that instead of doing: from my_module import my_function Now I am

[web2py] Re: scheduler question, how to use queue_task?

2013-03-07 Thread Niphlod
seems perfectly legit in the snippet, maybe there's something else in your complete code. Can you inspect the errors returned by queue_task (i.e. print result_ID and see what does it contain) ? On Thursday, March 7, 2013 11:34:23 AM UTC+1, Tim Richardson wrote: I have an app using the

[web2py] REF: Integrating Web2py with Redactor WYSIWYG

2013-03-07 Thread Teddy Nyambe
I have managed to add the Redactor WYSIWYG into a field with text type. But what I have failed is to have it upload images, anyone who had managed to get the image upload work? Tried this but failed to upload image, but teh provision is showing to upload images: script type=text/javascript

[web2py] Re: scheduler question, how to use queue_task?

2013-03-07 Thread LightDot
I believe I just stumbled on the same problem last night. I was upgrading an app with an old scheduler (1.99.2) to current (2.4.2). I temporarily solved it by continuing to insert the db record manually, as I needed to finish this quickly and had no time to troubleshoot... I'll be able to do

[web2py] Re: scheduler question, how to use queue_task?

2013-03-07 Thread Tim Richardson
On Thursday, 7 March 2013 21:49:12 UTC+11, Niphlod wrote: seems perfectly legit in the snippet, maybe there's something else in your complete code. Can you inspect the errors returned by queue_task (i.e. print result_ID and see what does it contain) ? My bad. Under the old way

[web2py] Re: scheduler question, how to use queue_task?

2013-03-07 Thread Niphlod
pargs and pvars are automatically json-encoded, but needs to be real python objects. If you want to pass strings already converted use args='...' and vars='...' but the whole point of queue_task is to avoid repetition (e.g. json.dumps(this), json.dumps(that)) On Thursday, March 7, 2013

[web2py] Referral Program using sessions

2013-03-07 Thread Abhishek Gupta
Hi, I am working on a referral system in which I would be able to track signups given a referral url. Let us say someone open www.zumbl.com/?u=2102 and then the user signups or login, using this unique URL, I need to create an entry into the database. Is there some way I can do this use using

[web2py] Possible to turn off server logging in local environment?

2013-03-07 Thread Jim Gregory
I run web2py in the background on my PC to monitor my power output when I'm working on my pedal-powered computer. (see http://www.bikesatwork.com/blog/our-pedal-powered-office) The script I'm running does sends a JSON request to my local server every second, which means the log file grows

[web2py] 2.4.2 breaks custom login form

2013-03-07 Thread Eric
I've just upgraded to version 2.4.2. Now the custom login page doesn't work anymore in Firefox and Chrome, on the previous version everything worked nicely on both browsers. What I discovered it that since version 2.4.2 a little # was popping up into the action attribute of our custom login

[web2py] Login not possible in Chrome and Firefox on 2.4.2 (stable) 2013-03-04 03:26:21

2013-03-07 Thread Eric
Hi, We've got a custom layout for our login page using a view with all the needed ({=form.custom.widget.email}}) code elements. On the previous version of Web2Py everything worked nicely on Internet Explorer, Chrome and FireFox. After upgrading to 2.4.2 logging in to our project only works on

[web2py] Re: Login not possible in Chrome and Firefox on 2.4.2 (stable) 2013-03-04 03:26:21

2013-03-07 Thread Niphlod
you can passing the _action attribute, but it should pose no issues at all: I'm perfectly able to submit forms with action # with IE, Firefox and Chrome. Can you pack a sample app in order to reproduce the issue ? On Thursday, March 7, 2013 1:06:57 PM UTC+1, Eric wrote: Hi, We've got a

Re: [web2py] Ajax return a form but does not write in the db (and default value info)

2013-03-07 Thread Richard Vézina
Could you show more code, controller for both component and the views associated Richard On Wed, Mar 6, 2013 at 4:49 PM, Riccardo C r.ceccare...@gmail.com wrote: Thank you very much, that is exactly what I needed... I didn't know components! I have component related question know. I have

[web2py] Re: Web2Py hangs

2013-03-07 Thread Cliff Kachinske
Web2py is robust. While I have experienced hangs after altering a model, these are the only times I have seen Web2py hang. You will have to plan for this if changing your model on a production box. On Wednesday, March 6, 2013 8:16:34 AM UTC-5, Demsar wrote: Hi! I am completely newbie in

[web2py] Re: Book 5th edition out

2013-03-07 Thread wwwgong
I tried Table Inheritance feature, it works like a charm. THANK YOU SO MUCH! On Tuesday, March 5, 2013 3:48:38 PM UTC-5, mdipierro wrote: The fifth edition of the book is out! in HTML: http://web2py.com/book in PDF: https://dl.dropbox.com/u/18065445/web2py/web2py_manual_5th.pdf

[web2py] How to populate a SELECT field from a SQLFORM

2013-03-07 Thread José Manuel López Muñoz
Hi, I'm trying to populate a drop down menu of a form like this: def createOffer(): hotelesUsuario=db(db.Hotel.managerID == auth.user_id) db.Offer.hotel.requires=IS_IN_DB(hotelesUsuario,'Hotel.id','%(name)s') form = SQLFORM(db.Offer) This is my Offer table:

[web2py] Re: Book 5th edition out

2013-03-07 Thread wwwgong
Thanks, your little app may be customized for translation, where to see the source code? On Wednesday, March 6, 2013 7:27:34 PM UTC-5, Alan Etkin wrote: kindly hosted by github. http://niphlod.github.com/diffbook/ Many thanks! -- --- You received this message because you are

[web2py] Re: Book 5th edition out

2013-03-07 Thread Niphlod
Sorry, but I didn't get what you need : are you saying that you'd need the same thing, e.g., for the spanish version ? Are you basing your translation on a translation of the original ? e.g. english -- spanish -- japanese On Thursday, March 7, 2013 3:58:26 PM UTC+1, wwwgong wrote: Thanks,

[web2py] Re: How to populate a SELECT field from a SQLFORM

2013-03-07 Thread Niphlod
you can do as you did with the hotels (i.e. passing a queryset already filtered instead of a table to the IS_IN_DB) or create a dict holding a few cities with as the key the id of the city and the value the name of it. On Thursday, March 7, 2013 3:52:24 PM UTC+1, José Manuel López Muñoz wrote:

Re: [web2py] Re: Book 5th edition out

2013-03-07 Thread António Ramos
Dont forget to get all the goodies we talk in this group and make another book. We already have Web2py Recipes book. Why not a book just for tips and tricks. I see a lot of invaluable info here that can go to a book like that. Best regards António 2013/3/7 Niphlod niph...@gmail.com Sorry, but

[web2py] customize css for auto form

2013-03-07 Thread frasse
Hi How can I use customize css for auto form ? Thanks /F -- --- 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 email to web2py+unsubscr...@googlegroups.com. For more

[web2py] Expecting psycopg2 error but not getting one - anybody got a clue?

2013-03-07 Thread Cliff Kachinske
I don't know why this code does not fail. It seems like it should because there is no file 'sale_product_id' in the table. lots = db.customer_order_product_lots lots[0] = dict( customer_order_product_id=customer_order_product_id,

[web2py] passing vars to form by url but get duplicated value at form accept

2013-03-07 Thread Richard
Hello, Here my problem I want to pass field default form value by the url to like this : http://127.0.0.1:8000/appname/controller/func?fk_id=1 Then in controller I do : db.table.fk_id.default=request.vars.fk_id ... if form.accepts(request.vars, session): # HERE IT FAILED BECAUSE

Re: [web2py] Tip of the day... ajax buttons in grid

2013-03-07 Thread Richard Vézina
What is the purpose? In line edition or something? Richard On Wed, Mar 6, 2013 at 9:09 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Do you know you can do this? db.define_table('thing',Field('name'),Field('active','boolean',default=False)) @auth.requires_login() def index():

Re: [web2py] passing vars to form by url but get duplicated value at form accept

2013-03-07 Thread Niphlod
when you process a form, request.vars holds the POSTed values of the form. What you're experiencing is that fk_id is yet in request.vars because it's a var originated by the GET of the page holding the form. Either you use a different variable in the GET request (e.g.

[web2py] Re: Expecting psycopg2 error but not getting one - anybody got a clue?

2013-03-07 Thread Niphlod
I quite don't get the issue: what are you trying to do with those dicts ? On Thursday, March 7, 2013 4:54:25 PM UTC+1, Cliff Kachinske wrote: I don't know why this code does not fail. It seems like it should because there is no file 'sale_product_id' in the table. lots =

Re: [web2py] Expecting psycopg2 error but not getting one - anybody got a clue?

2013-03-07 Thread Richard Vézina
Maybe it failed silently or it not really get call... Richard On Thu, Mar 7, 2013 at 10:54 AM, Cliff Kachinske cjk...@gmail.com wrote: I don't know why this code does not fail. It seems like it should because there is no file 'sale_product_id' in the table. lots =

Re: [web2py] passing vars to form by url but get duplicated value at form accept

2013-03-07 Thread Richard Vézina
So, if I do understand well I should do : db.table.fk_id.default=request.get_vars.fk_id ?? On Thu, Mar 7, 2013 at 11:01 AM, Niphlod niph...@gmail.com wrote: when you process a form, request.vars holds the POSTed values of the form. What you're experiencing is that fk_id is yet in

Re: [web2py] passing vars to form by url but get duplicated value at form accept

2013-03-07 Thread Richard Vézina
Ok, miss the last line... Generally speaking changing the GET var name is the recommended way. request.get_vars.fk_id doesn't work. Thanks Richard On Thu, Mar 7, 2013 at 11:05 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: So, if I do understand well I should do :

Re: [web2py] passing vars to form by url but get duplicated value at form accept

2013-03-07 Thread Niphlod
you have request.get_vars and request.post_vars to obey the method used. request.vars holds both of them: is it clearer ? On Thursday, March 7, 2013 5:08:37 PM UTC+1, Richard wrote: Ok, miss the last line... Generally speaking changing the GET var name is the recommended way.

Re: [web2py] Tip of the day... ajax buttons in grid

2013-03-07 Thread Niphlod
On Thursday, March 7, 2013 5:00:33 PM UTC+1, Richard wrote: What is the purpose? In line edition or something? a simple one but yes, kinda. Inline editing is a WIP :P -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe

Re: [web2py] passing vars to form by url but get duplicated value at form accept

2013-03-07 Thread Richard Vézina
Yes! Thanks I just can't keep the same name for the passed default variable value except if I wrote more code once form accepted or onaccept and the perefered way of managing this issue is by using a different name then the field name to share the default value between my to function. Richard

[web2py] Re: request.function=='static' and request.args=='disclaimer' in menu

2013-03-07 Thread Annet
Hi, Thanks for your reply, problem solved? PS: all those checks only to set the active flag on the li holding the link ? Do that in javascript My knowledge of JavaScript is to limited to solve this problem that way. Kind regards, Annet -- --- You received this message because

Re: [web2py] Ajax return a form but does not write in the db (and default value info)

2013-03-07 Thread Riccardo C
*index.html* bla bla bla... div class=span12 {{=LOAD('default','maintxt.load',target='chat')}} div id=chat/div bla bla bla... maintxt.load {{=form}} {{for msg in msgList:}} b{{=msg.body}} /b a id=link{{=msg.id}}

[web2py] How to hide the controller from the url using URL() function

2013-03-07 Thread Tito Garrido
Hi folks, I have put some info on my routes.py: default_application = 'myapp'# ordinarily set in base routes.py default_controller = 'default' # ordinarily set in app-specific routes.py default_function = 'index' # ordinarily set in app-specific routes.py I can see that the URL

[web2py] Re: how to put query in sqlform.grid or smartgrid

2013-03-07 Thread Massimo Di Pierro
The syntax is SQLFORM.grid(query) or SQMFORM.smartgrid(table, constraints = dict(tablename = query)) You cannot pass a query instead of a table to the smartgrid. On Wednesday, 6 March 2013 20:49:17 UTC-6, 黄祥 wrote: hi, how to put query in sqlform.grid or smartgrid? *code* def

[web2py] Re: Problem with uploading large file web2py version 2.3.2

2013-03-07 Thread Massimo Di Pierro
Can you show us your code? Web2py is transparent to the upload and does not stores the uploaded file in ram but your app may do it and that may be a problem. On Wednesday, 6 March 2013 20:56:28 UTC-6, Mạnh Trần Đức wrote: When I upload a ~400Mb file: Firstly, After Chrome show upload 100% ,

[web2py] Re: CSV Import Error: ValueError: invalid literal for int() with base 10: ''

2013-03-07 Thread Massimo Di Pierro
Please open a ticket asking for better info on failed import. On Wednesday, 6 March 2013 22:58:47 UTC-6, Shawn Wheatley wrote: Hi All, I've been trying to track down an issue importing data from a legacy application I'm converting over to web2py. I have exported the data as described in

[web2py] Re: Help with admin/errors/

2013-03-07 Thread BlueShadow
One of the tickets I got: Ticket ID 66.249.yy.xxx.2013-03-06.15-43-30.1c957bf8-ba69-4762-8b82-b9c63c2ab027 class 'sqlite3.OperationalError' database is locked Version web2py™ (2, 3, 2, datetime.datetime(2012, 12, 17, 15, 3, 30), 'stable') Python Python 2.7.3: /usr/bin/python Traceback

Re: [web2py] how to start Celery worker in web2py

2013-03-07 Thread Massimo Di Pierro
What I want to know is what do you think celery buys you that the built-in scheduler does not provide? Celery is faster at transferring messages from the application t the workers and vice versa but normally when you want to run background tasks you have different bottle-necks: computation

[web2py] Re: 2.4.2 breaks custom login form

2013-03-07 Thread Massimo Di Pierro
That change originated from this discussion: https://groups.google.com/d/msg/web2py-developers/6J6U6f_VL00/q0GMWvwsl8gJ For now you can do FORM(...,_action=) but I would like to get to the bottom of this. Why does it not work? That is supposed to be the way to do it according to the discussion

[web2py] Re: Login not possible in Chrome and Firefox on 2.4.2 (stable) 2013-03-04 03:26:21

2013-03-07 Thread Massimo Di Pierro
If that change is causing problems we will revert it! I would like to understand why it is causing problems. This is one of those cases where we changed it under the assumption that 1) it was backward compatibile and 2) the new way was the way to do it according to specs. Massimo On Thursday,

[web2py] Re: Web2Py hangs

2013-03-07 Thread Massimo Di Pierro
web2py hangs when applications hang. ;-) On Thursday, 7 March 2013 08:24:38 UTC-6, Cliff Kachinske wrote: Web2py is robust. While I have experienced hangs after altering a model, these are the only times I have seen Web2py hang. You will have to plan for this if changing your model on a

[web2py] Re: 2.4.2 breaks custom login form

2013-03-07 Thread Niphlod
ps, resuming in HTML5 the action doesn't needs to be specified docs here http://www.w3.org/TR/html5/forms.html#attr-fs-action The action and formaction content attributes, if specified, must have a value that is a valid non-empty URL potentially surrounded by

[web2py] Re: Help with admin/errors/

2013-03-07 Thread Niphlod
ehm. you're using sqlite, the only locking-on-write db engine to keep track of each visitor landing on your pages ? You can't fix the error because it happened for a resource-contention: it means that the app was already writing to the SQLite database while your pagestatistic was trying to

[web2py] Wiki with Oracle?

2013-03-07 Thread chicks
Has anyone been able to get the wiki feature working with an Oracle DB? The tables get created successfully with the current version, but any attempt to create a page or search results in a ticket: Create: class 'cx_Oracle.DatabaseError' ORA-00904: WIKI_PAGE.SLUG: invalid identifier

[web2py] Re: CSV Import Error: ValueError: invalid literal for int() with base 10: ''

2013-03-07 Thread Shawn Wheatley
I have opened ticket 1368: http://code.google.com/p/web2py/issues/detail?id=1368 In the meantime, do you have any suggestions for how to proceed? I'm considering putting the statement in a controller and triggering it from the web so I get a ticket with a stack trace and more info about the

[web2py] Re: scheduler question, how to use queue_task?

2013-03-07 Thread LightDot
Right, my vars dicts seemed a bit odd when I looked at them, now I know why ;) Same thing bit me, apparently. Thanks for reporting back! Regards, Ales On Thursday, March 7, 2013 12:15:16 PM UTC+1, Tim Richardson wrote: On Thursday, 7 March 2013 21:49:12 UTC+11, Niphlod wrote: seems

[web2py] Re: Help with admin/errors/

2013-03-07 Thread BlueShadow
So I guess using the welcome app and modifying it wasn't that good. how do I fix this? and can I keep my database? On Thursday, March 7, 2013 7:05:51 PM UTC+1, Niphlod wrote: ehm. you're using sqlite, the only locking-on-write db engine to keep track of each visitor landing on your pages

[web2py] Re: Run Web2py as a Service? on Ubuntu Lucid?

2013-03-07 Thread Francisco Barretto
Same problem here. Any hints? Did the exact procedure described in http://web2py.com/book/default/chapter/11#Start-as-Linux-Daemon and I get: $ sudo /etc/init.d/web2py start No process in pidfile '/var/run/web2py/web2py.pid' found running; none killed. start-stop-daemon: Unable to start

[web2py] Re: Expecting psycopg2 error but not getting one - anybody got a clue?

2013-03-07 Thread Cliff Kachinske
It's one of the dal shortcuts. Similar to db.mytable[0] = dict(myfield='somevalue') The first one should raise an exception, but instead it inserts a record and ignores the misnamed field. On Thursday, March 7, 2013 11:03:47 AM UTC-5, Niphlod wrote: I quite don't get the issue: what are

[web2py] Re: 2.4.2 breaks custom login form

2013-03-07 Thread Massimo Di Pierro
Same here. Can somebody post an app with the problem so we can test it? Massimo On Thursday, 7 March 2013 12:02:27 UTC-6, Niphlod wrote: ps, resuming in HTML5 the action doesn't needs to be specified docs here http://www.w3.org/TR/html5/forms.html#attr-fs-action The action and

[web2py] Re: Wiki with Oracle?

2013-03-07 Thread Massimo Di Pierro
Why is Oracle giving this error if the tables exist? Can you look at the generated SQL in the Oracle logs and see what may be the problem? On Thursday, 7 March 2013 12:22:44 UTC-6, chicks wrote: Has anyone been able to get the wiki feature working with an Oracle DB? The tables get created

[web2py] Re: Expecting psycopg2 error but not getting one - anybody got a clue?

2013-03-07 Thread Niphlod
seems that whatever dict you pass only the values pertaining to the table gets filled. It's useful, e.g. for fields coming from multiple tables that needs to be inserted , e.g. in a SQLFORM holding 2 tables. db.define_table('testshortcuts', Field('abcd'), Field('efgh')) Table testshortcuts

Re: [web2py] Ajax return a form but does not write in the db (and default value info)

2013-03-07 Thread Richard Vézina
I get back to you as soon as I can... I a bit busy rigth now. Richard On Thu, Mar 7, 2013 at 12:27 PM, Riccardo C r.ceccare...@gmail.com wrote: *index.html* bla bla bla... div class=span12 {{=LOAD('default','maintxt.load',target='chat')}} div id=chat/div bla bla bla... maintxt.load

[web2py] Re: Help with admin/errors/

2013-03-07 Thread Niphlod
you need to figure out yourself . I'm keen to postgresql, but that's a personal preference. In ANY case, do not use SQLite for everything that is write-intensive (lots of reads are not a problem). The welcome app it's a base-start, not a one-solution-for-all-problems app. On Thursday, March 7,

[web2py] Re: where to set up localization in web2py

2013-03-07 Thread Niphlod
http://web2py.com/books/default/chapter/29/04#Internationalization,-and-Pluralization-with-T On Wednesday, March 6, 2013 7:15:11 AM UTC+1, TestFirstName TestLastName wrote: where to set up localization in web2py -- --- You received this message because you are subscribed to the Google

[web2py] Re: Help with admin/errors/

2013-03-07 Thread BlueShadow
Thanks Niphlod. On Thursday, March 7, 2013 8:55:10 PM UTC+1, Niphlod wrote: you need to figure out yourself . I'm keen to postgresql, but that's a personal preference. In ANY case, do not use SQLite for everything that is write-intensive (lots of reads are not a problem). The welcome app

[web2py] database shootout

2013-03-07 Thread BlueShadow
Hi guys so I learned that using SQLlite for me wasn't a great choice(thanks Niphlod). But since I started using databases when I started to use web2py. I got no clue what database to use. I used sqllite because it was in the welcome app and it worked while having my site offline and with me

Re: [web2py] database shootout

2013-03-07 Thread Richard Vézina
Postgres, full open source, supported by a consortium, commercial support available (ex.: Enterprise DB), build-in Foreing key constraint, PL SQL (so you can migrate to Oracle), Still with commercial build you are still at one/ten the price of Oracle DB... Also, I think many serious web2py user

Re: [web2py] database shootout

2013-03-07 Thread BlueShadow
Thanks Richard. Postgres Pros: Many User in web2py, open source Cons: Speed MySQL Pros: Speed On Thursday, March 7, 2013 9:57:48 PM UTC+1, Richard wrote: Postgres, full open source, supported by a consortium, commercial support available (ex.: Enterprise DB), build-in Foreing key

Re: [web2py] database shootout

2013-03-07 Thread Richard Vézina
Also you should consider that DAL adapter are not all equal on quality, quality for a given adapter is correlated to the user base for a given (my interpretation) and since Postgres is largely used it adapter is really good. Notice that there is two adapter for postgres psycopg2 and pg8000 the

[web2py] Re: Tip of the day... ajax buttons in grid

2013-03-07 Thread wwwgong
Thanks for the tip, I noticed that the checkbox is not updated after clicking on/off button. how to make active field refresh automatically On Wednesday, March 6, 2013 9:09:41 PM UTC-5, Massimo Di Pierro wrote: Do you know you can do this?

Re: [web2py] database shootout

2013-03-07 Thread Massimo Di Pierro
I have not run my own tests but as I understand it the claim that MySQL is speedier is only true when using it without transactions. If one looks at the web2py dal adapters one can see that the PostgreSQL adapter is the smallest. that is because it is the closest with the standard SQL and has

[web2py] Re: Tip of the day... ajax buttons in grid

2013-03-07 Thread Massimo Di Pierro
It should update it. it does for me. On Thursday, 7 March 2013 15:43:08 UTC-6, wwwgong wrote: Thanks for the tip, I noticed that the checkbox is not updated after clicking on/off button. how to make active field refresh automatically On Wednesday, March 6, 2013 9:09:41 PM UTC-5, Massimo Di

[web2py] Re: How to populate a SELECT field from a SQLFORM

2013-03-07 Thread Anthony
Also, don't use SQLField -- it was deprecated in favor of Field several years ago. On Thursday, March 7, 2013 10:33:35 AM UTC-5, Niphlod wrote: you can do as you did with the hotels (i.e. passing a queryset already filtered instead of a table to the IS_IN_DB) or create a dict holding a few

[web2py] Re: Wiki with Oracle?

2013-03-07 Thread chicks
Here's the truncated query from the web2py error log: SELECT DISTINCT wiki_tag.name, COUNT(DISTINCT wi... ORDER BY COUNT(DISTINCT wiki_tag.wiki_page) DESC I'm trying to get the DBA's to see whether they can tell me what the entire query is. Is there a way to turn on full logging in web2py?

[web2py] Re: Tip of the day... ajax buttons in grid

2013-03-07 Thread wwwgong
I am using v2.4.2 on win7, tried both chrome and firefox, same issue, I have to do a refresh to see Active field checked/unchecked On Thursday, March 7, 2013 4:54:45 PM UTC-5, Massimo Di Pierro wrote: It should update it. it does for me. On Thursday, 7 March 2013 15:43:08 UTC-6, wwwgong

[web2py] How to use auth.requires_permission with record_id?

2013-03-07 Thread Dragan Matic
I'm having problems grasping the mechanism of function decoration with auth.requires_permission(). For instance I have a simple table defined like this: db.define_table('messages', Field('messagetext', 'string')) And I would like users to be able to see just their own messages. I have a

[web2py] Re: Book 5th edition out

2013-03-07 Thread wwwgong
I like the presentation style of one vs the other (side by side), thinking that if the right side is the form to enter target translation. just curious how people do the translation for web2py book, I might be able to help english chinese On Thursday, March 7, 2013 10:30:56 AM UTC-5, Niphlod

[web2py] Re: Wiki with Oracle?

2013-03-07 Thread chicks
BTW, I'm logged into the database via Toad as the same user as web2py. The wiki tables are there, and I can run random queries against them without issue. So, something in the creation of the SQL by the DAL or cx_Oracle is the apparent problem, but I can't see the actual SQL being generated

[web2py] Ballarò vs Agorà vs IS_MATCH

2013-03-07 Thread Jonathan Lundell
I have something like IS_MATCH(ur'(?u)[\w ]+', strict=True) for a field. I added the re.U override because I needed to enter Ballarò and Agorà. Oddly, it accepted Ballarò, but not Agorà. I *think* what's going on is that IS_MATCH ends up looking at the UTF-8 string, not the Unicode string,

[web2py] Re: how to put query in sqlform.grid or smartgrid

2013-03-07 Thread 黄祥
thank you so much for your explaination massimo. i solve it by *for grid* def category(): query=db.category.is_active==True grid=SQLFORM.grid(query) return locals() * for smartgrid* def category(): query=db.category.is_active==True grid=SQLFORM.smartgrid(db.category,

[web2py] Re: Referral Program using sessions

2013-03-07 Thread 黄祥
you can check it on : http://web2py.com/books/default/chapter/29/13#Sessions-in-database -- --- 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 email to

[web2py] Re: where to set up localization in web2py

2013-03-07 Thread 黄祥
for whole site purpose you can set it on : layout.html : html class=no-js lang={{=T.accepted_language or '*en*'}} -- --- 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] Re: Tip of the day... ajax buttons in grid

2013-03-07 Thread 黄祥
nice tips, thank you. just a suggestion if user use the signature in the table, i think it can be implement in field : is_active please correct me if i'm wrong -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group

[web2py] Having trouble with user_signature

2013-03-07 Thread weheh
For extra security I'm adding user_signature=True to a critical ajax calls, but it isn't working for me. In my view, I have the following call after the page is created: ajax({{= URL(c='my_controller', f='do_something', vars=dict(x=session.x, y=session.y), user_signature=True)}}, [],

[web2py] Can not check True/False on this field?

2013-03-07 Thread Mika Sjöman
Hi trying to check true false in a string set, but does not work ## db.py db.define_table('answer', Field('description'), Field('is_correct', type='list:string'), Field('belongs_to_quiz',type='reference quiz',writable=False), ) db.answer.is_correct.requires=IS_IN_SET(('y','n'))

[web2py] Re: Can not check True/False on this field?

2013-03-07 Thread weheh
What kind of error message are you getting? I assume the request.vars['lesson'] and request.vars.answer are both indices into their respective tables. However, request.vars will be holding these values as strings. Without knowing more, I would suggest putting an int() around those two vars, as

[web2py] Re: database shootout

2013-03-07 Thread Vineet
The only con with postgres is that it doesn't support autoincrement field by default. We need to create a 'sequence' and an 'after insert trigger' for it. :( MySQL has built-in support for auto-increment field.:) But otherwise, postgres is totally free for any purpose (they say that no

[web2py] Re: database shootout

2013-03-07 Thread Massimo Di Pierro
This is not true. In fact web2py uses the PostgreSQL auto increment feature: create table something { id SERIAL PRIMARY KEY } This is all you need. This is even simpler the mySQL: CREATE TABLE something ( id MEDIUMINT NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) ) ENGINE=InnoDB; This

[web2py] Web2Py csv export over Select sum, count and multiple tables

2013-03-07 Thread eruhenon
I trying to get an export over my tablestructure in a readable Form (csv) and can't get a single object as a return value. my (simplified) table structur: table: workshops title table: event_date workshop reference workshops date table: extra_cost workshop reference workshops

[web2py] Re: How to populate a SELECT field from a SQLFORM

2013-03-07 Thread José Manuel López Muñoz
Thank you Niphlod, I've do it with the Cities, but now I've to populate the hotels dropdown with the hotels available in a City. I want to do it with a JavaScript (Onchange), this way when a City is selected I can populate the hotels dropdown with the hotels available. I've the request (is

[web2py] Re: How to populate a SELECT field from a SQLFORM

2013-03-07 Thread José Manuel López Muñoz
I've change all my db model :). Thank you for the tip Anthony. On Thursday, March 7, 2013 10:54:59 PM UTC+1, Anthony wrote: Also, don't use SQLField -- it was deprecated in favor of Field several years ago. On Thursday, March 7, 2013 10:33:35 AM UTC-5, Niphlod wrote: you can do as you

[web2py] How to validate a field using data being entered from a field next to it in same table

2013-03-07 Thread Alex Glaros
I want to limit IS_IN_DB to a table whose fields match what is being entered in an adjoining field in the same table. Tables: *Taxonomy* is the taxonomy type and contains the types of taxonomies, e.g., plants taxonomy, computer languages taxonomy. *TaxonomyData* is the detail taxonomy of

[web2py] Re: Run Web2py as a Service? on Ubuntu Lucid?

2013-03-07 Thread jc
I run web2py on shared hosting. I don't have root access so I had a similar problem getting it to run as a started task. I ended up with a totally different solution which still makes sure web2py runs for me at all times. It's a bit of a hack. I created a bash script called run_web2py and put