[web2py] Re: storing variables between modules

2015-03-23 Thread Leonel Câmara
You could store the array in the session, numpy arrays are pickable if I remember correctly. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Garry Smith
Hi thanks for the reply. What I was trying to do in the original code was return the data to a div not to a specified page, so what you are saying is correct. The part about the table, is that it seems to only iterate over the first record, maybe the code is different for tables, because it has

[web2py] Absolute URL for downloaded image

2015-03-23 Thread Gael Princivalle
Hello everybody. I would like to send a newsletter using a web site news content. In a news I have an uploaded image that I display in the web site like that: {{=IMG(_src=URL('download', args=current_news.image_file))}} The result in the html file is that one: img

[web2py] Catch errors in scheduler task

2015-03-23 Thread flagist0
Hello! Is there any way to catch errors produced by scheduler task (create am error ticket, send mail etc)? Currently nothing happens if some error occurs during scheduler task run, only task's status is set to FAIL. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Catch errors in scheduler task

2015-03-23 Thread Niphlod
and the traceback is stored on the scheduler_run table. What do you need exactly ? On Monday, March 23, 2015 at 12:08:46 PM UTC+1, flagist0 wrote: Hello! Is there any way to catch errors produced by scheduler task (create an error ticket, send mail etc)? Currently nothing happens if some

[web2py] Re: Absolute URL for downloaded image

2015-03-23 Thread 黄祥
is this work? img src=http://server/myapp/admin/download/{{current_news.image_file}}; best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues)

[web2py] Re: Absolute URL for downloaded image

2015-03-23 Thread Gael Princivalle
Thank's for your answer Stifan. Well in this case I will use PHPList for sending emails. I was just thinking about a source page generated template copy and a paste into PHPList. I don't understand why you talk about the carriage return. I need to save this file

[web2py] Re: Absolute URL for downloaded image

2015-03-23 Thread Gael Princivalle
is the image is viewable on browser when you use that link? http://server/myapp/admin/download/news.image_file.9b935275a22c6075.68333632362e6a7067.jpg Yes. So I just have to use that URL. Perfect, I was thinking that the alphanumeric code was not always the same depending of the session. Thanks

[web2py] Re: Absolute URL for downloaded image

2015-03-23 Thread 黄祥
pardon me, carriage return is just an example to show that between the email client might have their own syntax to show or embed image on it. is the image is viewable on browser when you use that link? http://server/myapp/admin/download/news.image_file.9b935275a22c6075.68333632362e6a7067.jpg

[web2py] Re: Absolute URL for downloaded image

2015-03-23 Thread 黄祥
is it auto email generate n send by web2py or you create a template email then execute respnse.render('email_template') in a href=mailto, so that you just open default mail client with the template on it? if the last (using template that pass to mail client), i think it depends on mail

[web2py] Re: Limit view of posts online

2015-03-23 Thread LoveWeb2py
Hi Maurice, You could do something like this: user_posts = db(db.user_posts.posted_by==db.auth_user.id).select(db.user_posts.ALL) then show that data to just the user. Kind of hard to structure without seeing your database model. On Monday, March 23, 2015 at 12:10:22 PM UTC-4, Maurice Waka

[web2py] Limit view of posts online

2015-03-23 Thread Maurice Waka
I tried a Reddit app where one can view posts and comments. My trouble is getting the user t be the only one to view the Posts instead of public view(all postS seen by everyone) How do I limit that? I tried: @auth.requires_signature() def view_posts_by_author(): ...code return locals()

Re: [web2py] Re: last minute web2py hackaton

2015-03-23 Thread Phyo Arkar
AH i just noticed now , i haven't contribute to web2py for so long . On Tue, Mar 24, 2015 at 1:01 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: I don't mind... Fixing PEP8 is not a big deal!! :) Richard On Mon, Mar 23, 2015 at 1:40 PM, Massimo Di Pierro massimo.dipie...@gmail.com

Re: [web2py] Re: Limit view of posts online

2015-03-23 Thread Ron Chatterjee
you may want to try the limitby option. On Monday, March 23, 2015 at 12:49:39 PM UTC-4, Maurice Waka wrote: Hi loveweb2py. Its just the same as the Reddit clone on the tutorials. All wanted is to modify to have such posts to one user only. On Mon, Mar 23, 2015 at 7:23 PM, LoveWeb2py

[web2py] display date on ajax load

2015-03-23 Thread Dave S
I'm probably having a bad hair day, but I can't quite get the pieces together. I'd like to display the time an ajax load completes so the user can see how fresh the information is when then start cycling through tabs (what, more than 1 tab?). Something like Found X dingbats this visit, at

[web2py] Re: Catch errors in scheduler task

2015-03-23 Thread Niphlod
nope, but it would easy to have such system... a) you have a function def myfunc(): blablabla return 1 you wrap it on a try:except and send a notification def myfunc(): try: blablablabla return 1 except: mail.send(...) b) you code a watcher task

[web2py] Re: Retuning onclick from controller

2015-03-23 Thread Dave S
On Sunday, March 22, 2015 at 10:32:07 AM UTC-7, Garry Smith wrote: Hi is their a way of returning an onclick funtion to a div. This is what I'm trying to return. onclick=jQuery('#id').val('{{=row.id}}');ajax('{{=URL('default', 'album')}}', ['id'], 'playlist');row.album. I can get it to

[web2py] Json issue

2015-03-23 Thread Nico de Groot
Why is the HTML rendered inside a script tag? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to

[web2py] Re: Replacing template engine

2015-03-23 Thread Robin Manoli
I find this to be an interesting idea, to use jinja2 as a sandbox. Why is it that it makes it impossible to compile the web2py app? Is it impossible to do that because of external modules? Den lördag 9 juni 2012 kl. 08:35:04 UTC+2 skrev kirpit: Actually not, if you don't want your designers

[web2py] Re: format='%(name)s' )

2015-03-23 Thread Nico de Groot
It's a typing error: field is misspelled as filed... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are

[web2py] LOADed component with field of type upload now fails where it used to work

2015-03-23 Thread weheh
I have a component form that tries to upload a file. This requires the jquery.Form.js, which I have installed and have been using successfully for quite some time. However, after making some changes to my layout file and juggling the order of my css and js loadings, I'm now getting this error

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Garry Smith
Hi, I have had a look at LOAD and Ajax and tested, which I think could work, the only thinkgI can't get right is to get the data back into the div I want. I tried the following {{=LOAD('default','post.load',target='comments', ajax=True)}} thinking that the data would be put into the target

[web2py] Re: Limit view of posts online

2015-03-23 Thread Jim S
Wouldn't you do this instead? user_posts = db(db.user_posts.posted_by==auth.user.id http://db.auth_user.id/).select() I agree, it would be better if we could see the code you have so far... -Jim On Monday, March 23, 2015 at 11:23:04 AM UTC-5, LoveWeb2py wrote: Hi Maurice, You could do

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread LoveWeb2py
Wouldn't a LOAD/Ajax combo work better in this case and then just include it in your page? On Monday, March 23, 2015 at 8:41:18 AM UTC-4, Garry Smith wrote: Hi thanks for the reply. What I was trying to do in the original code was return the data to a div not to a specified page, so what

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread LoveWeb2py
http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components--LOAD-and-Ajax On Monday, March 23, 2015 at 12:19:34 PM UTC-4, LoveWeb2py wrote: Wouldn't a LOAD/Ajax combo work better in this case and then just include it in your page? On Monday, March 23, 2015 at 8:41:18 AM

[web2py] Re: Catch errors in scheduler task

2015-03-23 Thread flagist0
I want to be notified if error happens. So I'm wondering if scheduler has some callbacks which will be called if error occurs during task run. On Monday, March 23, 2015 at 6:21:38 PM UTC+3, Niphlod wrote: and the traceback is stored on the scheduler_run table. What do you need exactly ? On

Re: [web2py] Re: Limit view of posts online

2015-03-23 Thread Maurice Waka
Hi loveweb2py. Its just the same as the Reddit clone on the tutorials. All wanted is to modify to have such posts to one user only. On Mon, Mar 23, 2015 at 7:23 PM, LoveWeb2py atayloru...@gmail.com wrote: Hi Maurice, You could do something like this: user_posts =

[web2py] Re: Replacing template engine

2015-03-23 Thread Massimo Di Pierro
You can use jinja2 with web2py. I do not endorse it but you can, like you can use any template engine. Just replace def index(): return dict(a=1,b=2) with from jinja2 import Environment, PackageLoader def index(): env = Environment(loader=PackageLoader('yourapplication',

[web2py] Example of how to use slickgrid with Web2py?

2015-03-23 Thread LoveWeb2py
Hello, I'm looking for any example of how to use the slick grid https://github.com/mleibman/SlickGrid with web2py which includes posting the data back to the database. I'm trying to use it to replace smartgrid for one of my projects where we have a large database. Thanks! -- Resources: -

[web2py] Re: storing variables between modules

2015-03-23 Thread Massimo Di Pierro
I had to try this to believe it... import numpy import pickle a = numpy.zeros(10) pickle.dumps(a) cnumpy.core.multiarray\n_reconstruct\np0\n(...). indeed they are! On Monday, 23 March 2015 08:05:22 UTC-5, Leonel Câmara wrote: You could store the array in the session, numpy arrays are

[web2py] Re: last minute web2py hackaton

2015-03-23 Thread Massimo Di Pierro
This did not get as many responses as I expected but the four people doing significative work during the week-end were: Paolo (ilvalle) Giovanni(gi0baro) Simone (niphlod) BuhtigithuB So I will a $50 gift certificate to each of them as soon as 2.10.1 is released. Congratulations! Massimo

[web2py] Re: Json issue

2015-03-23 Thread Massimo Di Pierro
should be {{from serializers import json}} script type=text/javascript language=javascript var news_feed = {{=XML(json(feed))}}; /script OR script type=text/javascript language=javascript {{=ASSIGNJS(var news_feed = feed)}}; /script @Nico. This is correct. The XML is not

Re: [web2py] Re: last minute web2py hackaton

2015-03-23 Thread Richard Vézina
I don't mind... Fixing PEP8 is not a big deal!! :) Richard On Mon, Mar 23, 2015 at 1:40 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: This did not get as many responses as I expected but the four people doing significative work during the week-end were: Paolo (ilvalle)

[web2py] Re: Limit view of posts online

2015-03-23 Thread Ron Chatterjee
There are various ways to do it. I will put a breakpoint and start typing on the shell to figure out what you want to print. One way I can think of, db().select(db.user_posts.ALL,orderby=auth.user.id, limitby=(0, whatever_number_of_post_you_want_to_display); On Monday, March 23, 2015 at

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Dave S
Ooops.. On Monday, March 23, 2015 at 5:28:26 PM UTC-7, Dave S wrote: On Monday, March 23, 2015 at 1:43:26 PM UTC-7, Garry Smith wrote: [...] That doesn't happen with the code I use , which I referred to in your other thread. But I use c= and f= explicitly, rather than positional

[web2py] Re: Replacing template engine

2015-03-23 Thread Robin Manoli
Doesn't it sandbox designers from accessing the files from the web2py file system? The subset is a feature in this case, even if it's not a complete security fix. (I would appreciate some example of those javascript issues). I've also had trouble with nesting blocks (from different files) in

[web2py] Re: Limit view of posts online

2015-03-23 Thread Anthony
See the answer here: http://stackoverflow.com/a/29222859/440323 On Monday, March 23, 2015 at 12:10:22 PM UTC-4, Maurice Waka wrote: I tried a Reddit app where one can view posts and comments. My trouble is getting the user t be the only one to view the Posts instead of public view(all postS

[web2py] Re: Ractive example

2015-03-23 Thread Tim Richardson
I'd be really curious to see a web2py app deploying ractive.js, to get a feel for how an experienced user gets value from ractive on top of web2py's helpers. Kind of best practice beyond changing the delimiters. For example, do you take a hybrid approach to mark up/add to what web2py does via

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Dave S
On Monday, March 23, 2015 at 1:43:26 PM UTC-7, Garry Smith wrote: Hi, I have had a look at LOAD and Ajax and tested, which I think could work, the only thinkgI can't get right is to get the data back into the div I want. I tried the following

[web2py] Re: Limit view of posts online

2015-03-23 Thread Anthony
On Monday, March 23, 2015 at 7:26:44 PM UTC-4, Ron Chatterjee wrote: There are various ways to do it. I will put a breakpoint and start typing on the shell to figure out what you want to print. One way I can think of, db().select(db.user_posts.ALL,orderby=auth.user.id, limitby=(0,

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Anthony
On Monday, March 23, 2015 at 4:43:26 PM UTC-4, Garry Smith wrote: Hi, I have had a look at LOAD and Ajax and tested, which I think could work, the only thinkgI can't get right is to get the data back into the div I want. I tried the following

[web2py] Re: Absolute URL for downloaded image

2015-03-23 Thread Anthony
The first alphanumeric code is part of a UUID, and the second code (after the .) is the original filename encoded -- both of which are fixed when the file is saved. If you want to generate an absolute URL, you can use URL(..., host=True, scheme=True). Anthony On Monday, March 23, 2015 at

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Anthony
LOAD generates a div with an id set to the value of the target attribute, so you do not want to put LOAD inside a div that already has that id (then you will get nested divs with the same id). On Monday, March 23, 2015 at 8:44:51 PM UTC-4, Dave S wrote: Ooops.. On Monday, March 23, 2015 at

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Dave S
On Monday, March 23, 2015 at 6:27:25 PM UTC-7, Dave S wrote: On Monday, March 23, 2015 at 5:52:46 PM UTC-7, Anthony wrote: LOAD generates a div with an id set to the value of the target attribute, so you do not want to put LOAD inside a div that already has that id (then you will get

[web2py] pyquery, pyjs and web2py

2015-03-23 Thread Ron Chatterjee
I don;t know much javascript hence this question. I see some packages like pyquery, pyjs. So I am asking... After we include our .js, .css file in the static folder, Is there a way that jquery/javascript can be called using simply python syntax? like {{my_jquery}} rather than script.I try

[web2py] Re: Ractive example

2015-03-23 Thread Massimo Di Pierro
Please look into this: https://github.com/mdipierro/w3 I could very much use your opinions. I am working on it actively these days. On Monday, 23 March 2015 18:04:47 UTC-5, Tim Richardson wrote: I am really curious to see a web2py app deploying ractive.js, to get a feel for how an experienced

[web2py] how to set a css class on sqlformat.factory

2015-03-23 Thread Anthony
SQLFORM.factory(..., _class='myclass') Just like any other HTML helper. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message

[web2py] Re: Ractive example

2015-03-23 Thread JorgeH
Impressive , Massimo! On a quick view, you seem to have wrapped up ractive.js into web2py. What does W3 stand for? On Monday, March 23, 2015 at 9:55:25 PM UTC-5, Massimo Di Pierro wrote: Please look into this: https://github.com/mdipierro/w3 I could very much use your opinions. I am working

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Dave S
On Monday, March 23, 2015 at 5:52:46 PM UTC-7, Anthony wrote: LOAD generates a div with an id set to the value of the target attribute, so you do not want to put LOAD inside a div that already has that id (then you will get nested divs with the same id). You're right, I do, as I noted

[web2py] Re: last minute web2py hackaton

2015-03-23 Thread KPlusPlus
Good tactic to push the community forward to contribute and help improve the framework continuously. On Friday, March 20, 2015 at 6:41:16 PM UTC+3, Massimo Di Pierro wrote: We want to release 2.10.1 next week. We will try closing as many issue as possible in the next three days. You

Re: [web2py] Re: Install in hostgator

2015-03-23 Thread Carlos Costa
Have you seen this? http://www.web2pyslices.com/slice/show/1567/running-web2py-on-hostgator-shared-host 2015-03-22 23:24 GMT-03:00 LoveWeb2py atayloru...@gmail.com: Did anyone ever find a complete solution to this? I'm using web2py on hostgator and after following this tutorial I can only get

[web2py] Re: SQLFORM.factory adding dynamic form

2015-03-23 Thread Val K
I think, there is no problem, but I am not sure that I understand what you want: - do you want to edit/insert multiple records of/to the same table (person-address-relation for example) at once, per single form's accept? - do you want to edit/insert single records of/to few tables at once? or

[web2py] Re: Working with MSSQL with codepage other than latin1 or unicode

2015-03-23 Thread Val K
Hi! If you haven't solved this problem yet try something like this: def MSACCESS_adapt(s,f): for it in f.items(): if type(it[1])==str: f[it[0]]=it[1].decode('utf8').encode('1251') elif type(it[1])==datetime.datetime: f[it[0]]=it[1].strftime('%Y-%m-%d %H:%M:%S')

[web2py] Table Migration on GAE

2015-03-23 Thread Sébastien Loix
Hi, I am having difficulties with table migration on GAE. I deployed perfectly in the Google App Engine and everything is working fine. I then needed to make some change in the auth_user adding some extra field but when I deploy again the new version, the migration doesn't occur and the new

[web2py] Re: format='%(name)s' )

2015-03-23 Thread KPlusPlus
The issue is in line 10 where format='%(name)s') , but what causes this issue ,That's why I'm asking ;) On Monday, March 23, 2015 at 4:50:01 AM UTC+3, Massimo Di Pierro wrote: which one is line 23? Perhaps some hidden character creeped in. On Sunday, 22 March 2015 20:43:08 UTC-5, KPlusPlus

[web2py] how to set a css class on sqlformat.factory

2015-03-23 Thread Matheus Suffi
I wonder if there is a parameter to set a css class within the sqlformat.factory -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this

[web2py] Re: Json issue

2015-03-23 Thread Dereje
I only posted part of the code from the view that is giving me problems, which uses *response.json*. The code i posted reads variables sent from the controller into a JavaScript format, these variables are then used by an external JavaScript file associated with the same view to render some

[web2py] WEB2PY Certificate ?

2015-03-23 Thread KPlusPlus
Hello I was wondering if there's an organization/institution can offer a WEB2PY Certificate with or without Course ? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report

[web2py] Re: Dropbox in the book

2015-03-23 Thread Gray Kanarek
Line 2: use_janrain(auth_filename='private/dropbox.key') Line 1 imports use_dropbox, not use_janrain. Should use_janrain in line 2 be: use_dropbox(auth_filename='private/dropbox.key') instead? Or is use_dropbox imported and then never called? Or should it be use_janrain which is imported? I

[web2py] get controller instance at runtime

2015-03-23 Thread Michel Krav
hi all, I d like to use getattr(controller , function) as a dispatcher from the controller itself at runtime. usually I use __file__ or sys.modules[__name__] but in web2py the first one do not return an instance and the other raises an error as accessing __name__ is restricted. thanks. --

[web2py] Re: PythonAnywhere performance is significantly slower than locally

2015-03-23 Thread NeoToren
1. I have installed the EXACT configuration Web2Py app on MySQL DB with a different email on your machines. Performance still is unacceptable - but it is twice as better than the one on the original ICD10 installation ! I am talking about AVERAGE of 4-6 seconds on the

[web2py] Re: format='%(name)s' )

2015-03-23 Thread KPlusPlus
Thanks for noticing that , I've fixed it , but the problem still persist and it indecats it's in format='%(name)s') Here is the updated code # -*- coding: utf-8 -*- #Products Table db.define_table=('product', Field('name', notnull=True, unique=True),

[web2py] get controller instance at runtime

2015-03-23 Thread Anthony
request.controller and request.function. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to

[web2py] Re: returning data to web page div (Partly Solved)

2015-03-23 Thread Dave S
On Monday, March 23, 2015 at 6:44:15 PM UTC-7, Dave S wrote: [...] Looking again at URL: http://www.web2py.com/books/default/chapter/29/12/components-and-plugins?search=LOAD%28%29#LOAD , it seems the example DOESN'T have a pre-existing DIV. To clean up my code, I need to do the

[web2py] Re: Replacing template engine

2015-03-23 Thread Massimo Di Pierro
yes. the sandbox prevents the code in templates from accessing the file system. What I am saying is that it is not the only problem you can have with templates and developer should check the code no matter what. A template could include, for example, code that allows the designer to steal

Re: [web2py] Re: Limit view of posts online

2015-03-23 Thread Maurice Waka
And thanks everybody too. On Tue, Mar 24, 2015 at 6:25 AM, Maurice Waka mauricew...@gmail.com wrote: Thanks Anthony. I saw the answer you posted about 4 hrs ago. Kind regards On Tue, Mar 24, 2015 at 3:38 AM, Anthony abasta...@gmail.com wrote: See the answer here:

Re: [web2py] Re: Limit view of posts online

2015-03-23 Thread Maurice Waka
Thanks Anthony. I saw the answer you posted about 4 hrs ago. Kind regards On Tue, Mar 24, 2015 at 3:38 AM, Anthony abasta...@gmail.com wrote: See the answer here: http://stackoverflow.com/a/29222859/440323 On Monday, March 23, 2015 at 12:10:22 PM UTC-4, Maurice Waka wrote: I tried a Reddit