Re: [web2py] get record id to delete row in table

2014-11-27 Thread Manuele Pesenti
Il 26/11/14 10:32, Yebach ha scritto: > > Hello > > I have a table and a SQLFORM.grid in my view. In SQLFORM.grid I show > list of active workers and in my table I show all inactive workers. I > am not using a SQLFROM for both since showing two results in double > forms after edit/view click > > In

[web2py] add task and wait the result

2014-11-27 Thread Manuele Pesenti
Hi, I would like to add an immediate task to the scheduler and wait for the result within the same submit. Is it possible? How? Thank you very mutch Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://c

Re: [web2py] Re: is_list_of validator question

2014-11-20 Thread Manuele Pesenti
Il 20/11/14 02:36, Massimo Di Pierro ha scritto: > I do not remember but please open a ticket and I will look at this asap. done! https://code.google.com/p/web2py/issues/detail?id=2019 Thank you Massimo M. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://gi

Re: [web2py] Re: is_list_of validator question

2014-11-18 Thread Manuele Pesenti
Il 18/11/14 05:54, Massimo Di Pierro ha scritto: > Problem is that IS_LIST_OF experts to validate a list. Instead you are > passing "" (not a list) and None (also not a list). > I agree that it is odd that interprets '' as [] and None as [None]. > They should either be interpreted as [''] and [None

[web2py] is_list_of validator question

2014-11-12 Thread Manuele Pesenti
Does it makes sense or do you agree with this behaviour? In [5]: IS_LIST_OF(IS_NOT_EMPTY())('') Out[5]: ([], None) In [6]: IS_LIST_OF(IS_NOT_EMPTY())(None) Out[6]: ([None], 'Enter a value') In [7]: IS_NOT_EMPTY()('') Out[7]: ('', 'Enter a value') I mean... I expected that the first result would

Re: [web2py] web2py + OSM (OpenStreetMap) integration?

2014-11-06 Thread Manuele Pesenti
Il 06/11/14 20:37, Manuele Pesenti ha scritto: > Il 06/11/14 12:39, nick name ha scritto: >> Is there an example of using web2py together with OSM, similar to the >> google maps examples? >> >> Or some application I can look at and learn from? >> >> (I'

Re: [web2py] web2py + OSM (OpenStreetMap) integration?

2014-11-06 Thread Manuele Pesenti
Il 06/11/14 12:39, nick name ha scritto: > Is there an example of using web2py together with OSM, similar to the > google maps examples? > > Or some application I can look at and learn from? > > (I'm not a Google Maps or OSM expert, just need to add a small map + > markers to an app) > > Thanks wel

Re: [web2py] Re: language and localization development

2014-10-23 Thread Manuele Pesenti
Il 23/10/14 14:41, Leonel Câmara ha scritto: > I'd like to make a suggestion though - Don't do this. I don't think I'll do it. I don't want to globally change my approach writing all text messages in other language than english. I agree your suggestion. I was just looking for a local workaround for

[web2py] language and localization development

2014-10-23 Thread Manuele Pesenti
Hi, maybe I'm wrong but it seams that during development I have to write messages in english using the translator and than write the corresponding translation in language file I intend to use. Is these a way of using another language during development maybe identifying it every times I use T e.g.

[web2py] common way to star developing a new app

2014-10-21 Thread Manuele Pesenti
Hi! Do you think it could be a good approach for starting to develop all my web2py applications with predefined tools such as a logger and a test unit? https://github.com/manuelep/web2py-new-app Does anybody has a similar approach to share? Thank you very mutch Manuele -- Resources: - http:

Re: [web2py] Re: postgreSQL: restoring pg_dump using executesql

2014-10-08 Thread Manuele Pesenti
Il 08/10/14 19:29, Cliff Kachinske ha scritto: > Do this instead: > > psql -U - h localhost -d < > your_dumpfile.sql > > psql will ask you for a password. Use your web2py user's password. > > Create the database first, but don't create any tables or anything else. It's not for a "una tantum" rest

[web2py] postgreSQL: restoring pg_dump using executesql

2014-10-08 Thread Manuele Pesenti
Hi! Is there a way to restore a dump from an sql file that comes from a pg_dump command using in someway the database object defined in my model for example using the executesql method? I ask because I tried without success... it raises the sequent error in corrispondence of the line where data sta

Re: [web2py] Passing variables from tables to JavaScript

2014-10-08 Thread Manuele Pesenti
Il 07/10/14 06:49, Ben Stuart ha scritto: > |# returns nothing, no alert triggered. > >varx ={{=customername}}; >alert(x) > | try quoting the x variable value: var x = "{{=customername}}"; alert(x) maybe if no alert is triggered the debugger of your browser has some error message

Re: [web2py] ordering in dropdown

2014-09-23 Thread Manuele Pesenti
Il 23/09/14 15:03, liber...@gmail.com ha scritto: > using a query > qry=db(db.pollutants.pollutant_id == > db.pollutants_info.pollutant_id).select(orderby=db.pollutants_info.pollutant_order) well I notice that IS_IN_DB validator accepts db|set while you pass a result of a selection... try this cod

Re: [web2py] Re: log on file

2014-09-18 Thread Manuele Pesenti
Il 18/09/14 18:07, Nico de Groot ha scritto: > There's a slice about logging configured from the app see > http://www.web2pyslices.com/slice/show/1416/logging Great! Thanks Nico. M. > > Nico de Groot -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.

Re: [web2py] Re: log on file

2014-09-18 Thread Manuele Pesenti
Il 17/09/14 21:27, Niphlod ha scritto: > logging.conf should be in the root dir, not in the app dir. uhm it make sense for lots of its contents but in this way I cannot manage the log completely from my application.. or yes? -- Resources: - http://web2py.com - http://web2py.com/book (Documentatio

[web2py] log on file

2014-09-17 Thread Manuele Pesenti
I tryed to set up a logger in my app following the manual but I cannot see any file created under the logs directory. Here they are modifications I made to files... can you see anything wrong? * logging.conf (located under web2py/applications/myapp/) [loggers] - keys=root,rocket,markdown,web2py,r

Re: [web2py] Re: web2py app as proxy... but how?

2014-09-16 Thread Manuele Pesenti
Il 11/09/14 23:02, Niphlod ha scritto: > btw: a session.forget(response) on top of all, if you don't need the > sessions to be persisted, may be a good idea to improve parallel calls. How can I improve parallel calls to get better performances? Thank you Cheers Manuele -- Resources: - http:

Re: [web2py] Beginner issues

2014-09-16 Thread Manuele Pesenti
Il 11/09/14 14:22, Pedro Henrique Correa Ferreira ha scritto: > How is the correct way to do that? This is one possible way: http://web2py.com/books/default/chapter/29/07/forms-and-validators#Validators-with-dependencies M. -- Resources: - http://web2py.com - http://web2py.com/book (Document

Re: [web2py] Login password changed

2014-09-15 Thread Manuele Pesenti
Il 14/09/14 19:18, 'FERNANDO VILLARROEL' via web2py-users ha scritto: > How i can have a log of events for know who is change the password? you can consider to use auth.signature for you auth_user table look theese documentation pages from the manual: http://web2py.com/books/default/chapter/29/06

Re: [web2py] Re: web2py app as proxy... but how?

2014-09-12 Thread Manuele Pesenti
Il 11/09/14 23:02, Niphlod ha scritto: > btw: a session.forget(response) on top of all, if you don't need the > sessions to be persisted, may be a good idea to improve parallel calls. > on the content-length matter: you should pass what the underlying > "resource-site" pass you. The above implement

Re: [web2py] Re: web2py app as proxy... but how?

2014-09-11 Thread Manuele Pesenti
Il 11/09/14 09:12, Manuele Pesenti ha scritto: > > I need to proxy an external application but what happens is that the > first page loading stops at a certain point of the html header, I > suspect after too mutch requests to the same controller because every > requirement (like

Re: [web2py] Re: web2py app as proxy... but how?

2014-09-11 Thread Manuele Pesenti
Il 10/09/14 11:18, Niphlod ha scritto: > too much code will kill you. Start simple, and go from there onwards. > | > > deftest(): > url ='http://creativity103.com/collections/Landscape/golf_course.jpg' > r =requests.get(url) > ifr.status_code ==200: > newheaders =r.headers >

Re: [web2py] Re: web2py app as proxy... but how?

2014-09-10 Thread Manuele Pesenti
Il 10/09/14 11:18, Niphlod ha scritto: > too much code will kill you. Start simple, and go from there onwards. thank you so mutch! M. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/

Re: [web2py] Re: web2py app as proxy... but how?

2014-09-09 Thread Manuele Pesenti
Il 09/09/14 22:22, Niphlod ha scritto: > nope. base64 is just a way to turn binary into text, and you want to > stream a binary, not the text that represents it in base64. I prepared a little example based on my solution. It's a as simple as I can image proxy composed by a module[1] and a controlle

Re: [web2py] Re: web2py app as proxy... but how?

2014-09-09 Thread Manuele Pesenti
Il 19/08/14 10:16, Niphlod ha scritto: > not really, except that it's not streamed. Are these any shrewdness I have to use when I proxy images? Something like base64 encoding before streaming? Thanks a lot M. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http:

Re: [web2py] Re: Reload another component with new params

2014-08-20 Thread Manuele Pesenti
Il 20/08/14 16:47, Niphlod ha scritto: > just use $.web2py.component(url, target, timeout, times). Additional > "bonus points" for emptying the target before loading the new content, > just to be safe. wow it works great! Thanks Nophlod... it's a pity it's not documented in the manual. Cheers

Re: [web2py] Re: Reload another component with new params

2014-08-20 Thread Manuele Pesenti
Il 20/08/14 08:30, Niphlod ha scritto: > nope, you'd have to do it by hand using $.web2py.component can you tell me something more? So in some way is it possible to obtain the same result to reload a component with new params? Thank you Niphlod M. -- Resources: - http://web2py.com - http://

[web2py] Reload another component with new params

2014-08-19 Thread Manuele Pesenti
Hi! Is there a way to reload a LOAD component passing new parameters to it? Thanks Manuele -- 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 rece

Re: [web2py] Re: web2py app as proxy... but how?

2014-08-19 Thread Manuele Pesenti
Il 19/08/14 09:27, Niphlod ha scritto: > from cStringIO import StringIO > def whateveryoumaycall(): > content = fetch_the_resource() > f = StringIO() > f.write(content) > f.seek(0) > #set the correct headers, such as > response.headers['Content-Type'] = 'blablabla' > re

Re: [web2py] Re: web2py app as proxy... but how?

2014-08-18 Thread Manuele Pesenti
Il 18/08/14 15:24, Niphlod ha scritto: > StringIO. Can you be more explicit? Please! Thanks a lot Manuele -- 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)

Re: [web2py] Re: web2py app as proxy... but how?

2014-08-18 Thread Manuele Pesenti
Il 18/08/14 12:24, Niphlod ha scritto: > fetch it, store it in some folder, stream it to the client. uhm... ok but if the resource is not static? In the meanwhile, waiting an answare, I developped a proxy using a controller based on the requests library that seams works... even if it looks quite sl

[web2py] web2py app as proxy... but how?

2014-08-15 Thread Manuele Pesenti
Hi! I need to use my web2py application to link some web resources that the server that hosts my application can reach via vpn and proxy them to the client (not in the vpn). How can I obtain this result? Thanks a lot Best regards Manuele -- Resources: - http://web2py.com - http://web2py.com

[web2py] Help with Application-Specific pattern based routes

2014-08-15 Thread Manuele Pesenti
Hi! Can somebody show me few examples of routes_in and routes_out variables for a pattern based and Application-Specific routes.py file please? Thanks a lot Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - h

[web2py] Re: URL rewrite

2014-08-14 Thread Manuele Pesenti
Il 14/08/14 10:01, Manuele Pesenti ha scritto: > Are there other reason why I have not to do it or can I follow this way? Another question... is it still a right way even if I need a dynamic proxy based on some configuration I have to retrieve from db? M. -- Resources: - http://web2py.

Re: [web2py] web2py grid select all filtred rows

2014-08-14 Thread Manuele Pesenti
Il 13/08/14 21:29, keiser1080 ha scritto: > so on the controler i can get the rows by doing grid.rows? yes > The query is also stored on an accessible grid proprety ? I don't know. The code of the function that defines the grid is not so easy to read but you can try to look into it: https://github.

[web2py] URL rewrite

2014-08-14 Thread Manuele Pesenti
Hi! I need to use one of my web2py application as a reverse proxy to browse some web pages served by other systems. Google-ing for it I found this[1] old documentation page who says: " web2py supports URL rerwite although this is not really recommended. You should really use Apache (or lighttpd) +

Re: [web2py] web2py grid select all filtred rows

2014-08-12 Thread Manuele Pesenti
Il 12/08/14 19:42, keiser1080 ha scritto: > Hi, > > is there a way to get the query or the list of id from a filtred grid? > > for example a grid listing all students with pagination => filter data > using the search widget of the grid student.age > 20 > => 2000 rows (multiple pages) => send d

Re: [web2py] Re: prevent record removal

2014-08-08 Thread Manuele Pesenti
Il 07/08/14 16:09, Niphlod ha scritto: > [...] > > callback: > > | > defdontdelete(s): > ifwhatever: > #you can't delete it > returnTrue > > > db.table._before_delete.append(lambdas:dontdelete(s)) > | > > Thanks Niphlod, I think I'll adopt this solution. M. -- Resou

[web2py] prevent record removal

2014-08-07 Thread Manuele Pesenti
Hi! what's the quickest way to block a record removal to all users. I need an easy method to insert the block and even easy to remove... I hope I've been clear enough :) Thanks in advance Cheers Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://gi

[web2py] Re: unittest application modules

2014-08-03 Thread Manuele Pesenti
Il 03/08/14 10:40, Manuele Pesenti ha scritto: > What's the right way to do it? Ok I got it. It was too simple. I solved writing a standard unittest under /tests/modules/.py and running it using the -R option with something like: $ ./web2py.py -S -M -R applications//tests/modules/.p

[web2py] unittest application modules

2014-08-03 Thread Manuele Pesenti
Hi *, reading the manual I couldn't understand how to do what I need or at least if I'm looking in the wrong direction... I want to write some unittests for an application module that uses current.db so I think it needs to be run under my application environment. What's the right way to do it? Tha

Re: [web2py] grid problem

2014-07-30 Thread Manuele Pesenti
Il 30/07/14 09:30, ceriox ha scritto: > thanks Javier! > but can you explain "must be a function"? > i use this code in other functions (for other tables) and it work fine! > how i need to change it? Dear ceriox, I think here lie the problem: https://github.com/web2py/web2py/blob/master/gluon/sqlht

Re: [web2py] json parsing and db insert problem

2014-07-25 Thread Manuele Pesenti
Il 25/07/14 09:22, Yebach ha scritto: > > > expected string or buffer > > in line data_dict = json.loads(data) > > WHY?? why does insert or smth crashes it on line before it is > executed??? can you paste a print of your data variable value just before the code crashes? M. -- R

Re: [web2py] Re: Direct editing inside a grid

2014-07-17 Thread Manuele Pesenti
Il 17/07/14 18:18, Serge Bourgeois ha scritto: > but, I got a message saying that I couldn't change the objects already > existing ... look for a validator... in case you are using IS_NOT_IN_DB it happens that when you're not updateing a value in a field with this validator but other, because of th

Re: [web2py] Re: How to -- Popup window: Record already exists are you sure you want to upload file?

2014-07-15 Thread Manuele Pesenti
or-html-select) first of all define your web service that check for filename existence and returns a json (for example) with the needed information cheers M. > On Jul 15, 2014 1:39 AM, "Manuele Pesenti" <mailto:manuele.pese...@gmail.com>> wrote: > > Il 14/07/1

Re: [web2py] Re: How to -- Popup window: Record already exists are you sure you want to upload file?

2014-07-14 Thread Manuele Pesenti
Il 14/07/14 21:21, Niphlod ha scritto: > until the user clicks on "submit", there's no way for web2py (or you) > to know the name of the file being uploaded beforehand, using a normal > input type="file". it's just not how the browsers work. what about to set up a javascript event on the upload li

Re: [web2py] SQLFORM: 'str' object has no attribute 'writable' error

2014-07-13 Thread Manuele Pesenti
Il 14/07/14 02:27, Don O'Hara ha scritto: > I'm experimenting with the various field types (mysql) to learn more > about web2py. > I'm not sure why I got this error > > 'str' object has no attribute > 'writable' > > Version > web2py^(TM)Version 2.9.5-trunk+timestamp.2014.07.03.12.21.52 > > > Give

Re: [web2py] Delete Query Not Working

2014-07-09 Thread Manuele Pesenti
Il 09/07/14 10:32, samurai ha scritto: > def pro_del(): > d = request.args > db(db.products.product_id == d).delete() > session.flash = "Product Deleted" > redirect(URL('default','index')) > #return locals() try this: def pro_del(): d = request.args(0) o

Re: [web2py] Re: grid: deletion row callback

2014-07-08 Thread Manuele Pesenti
Il 08/07/14 07:54, Manuele Pesenti ha scritto: > Il 07/07/14 23:49, Anthony ha scritto: >> I'm not sure how easy that would be in the browser without hacking >> web2py.js, but on the server, you can check for when a deletion >> happens and then send back some JS to be

Re: [web2py] Re: grid: deletion row callback

2014-07-07 Thread Manuele Pesenti
Il 07/07/14 23:49, Anthony ha scritto: > I'm not sure how easy that would be in the browser without hacking > web2py.js, but on the server, you can check for when a deletion > happens and then send back some JS to be executed. Not tested, but > maybe something like: > > | > defmygrid(): > ifreq

Re: [web2py] Re: grid: deletion row callback

2014-07-07 Thread Manuele Pesenti
Il 07/07/14 22:43, 黄祥 ha scritto: > pardon me, i'm not sure what do you mean with _javascript_ trigger. > please explain more about it. btw, web2py have ondelete (executed on > HTML Form Side) and before_delete callback (executed on DAL side). Thank you 黄祥 :) I mean that I need to refresh some part

[web2py] grid: deletion row callback

2014-07-07 Thread Manuele Pesenti
Hi! is it possible to setup a _javascript_ trigger on grid row deletion event? Possibly capturing the data of the row that will be deleted? thank you in advance. Cheers Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Sour

Re: [web2py] Create a database table on submission of a form

2014-06-28 Thread Manuele Pesenti
Il 28/06/14 08:17, Massimo Di Pierro ha scritto: > Cool. I did not know about it. yes you did :) https://groups.google.com/forum/#!searchin/web2py/%22but$20why$20sourceforge$3F%22/web2py/cfl9Nb5ejx8/yG7u63Qd1MUJ M. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Create a database table on submission of a form

2014-06-27 Thread Manuele Pesenti
Il 27/06/14 11:25, Shubham Jain ha scritto: > I want to create a database table every time a form is submitted. The > table name would be a data from a the field of form submitted. > I tried to create the table by writing the db.define_table() code > in the function in which the form is created

Re: [web2py] Creating table from csv file

2014-06-20 Thread Manuele Pesenti
Il 16/06/14 17:46, Alex Steinkamp ha scritto: > I am trying to import a csv file into a table in a database. I don't > always know the number of columns I will have. This is where I am > having my problems. I can't find anywhere how to dynamically add > columns to a table. Does anyone have any idea

Re: [web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-13 Thread Manuele Pesenti
Il 12/06/14 23:26, LoveWeb2py ha scritto: > So I currently have it like this: > > function init(){ > var json = '{{=XML(json_data_from_controller)}}'; what about to use this code instead? function init() { window.json = {{=XML(json_data_from_controller)}}; }; and then you can find your v

Re: [web2py] Re: plugin_dataTables

2014-06-06 Thread Manuele Pesenti
Il 03/06/14 22:12, Massimo Di Pierro ha scritto: > Could you post some screenshots? ok here they are: https://www.dropbox.com/s/razmyp3f1qpsfik/Screenshot%202014-06-06%2016.53.11.png https://www.dropbox.com/s/w10yzfziqlrx0gk/Screenshot%202014-06-06%2016.53.55.png Cheers M. -- Resources: - h

Re: [web2py] Re: plugin_dataTables

2014-06-06 Thread Manuele Pesenti
Il 03/06/14 22:12, Massimo Di Pierro ha scritto: > Could you post some screenshots? what about a demo site? http://manuele.pythonanywhere.com/demo_plugin_datatables you can browse the 2 pages linked in the "Examples" menu. Cheers M. -- Resources: - http://web2py.com - http://web2py.com/bo

Re: [web2py] Re: plugin_dataTables

2014-06-04 Thread Manuele Pesenti
Il 03/06/14 22:12, Massimo Di Pierro ha scritto: > Could you post some screenshots? off course... I'll do it ASAP... in the meanwhile you can clone the repo under web2py applications and visit pages: * plugin_examples/rpadroni.html * plugin_examples/myjoin.html Cheers Manuele -- Resources:

[web2py] plugin_dataTables

2014-06-03 Thread Manuele Pesenti
I'd like to share this plugin I prepared... maybe I'll produce a web2py slice recipe about how to use it but for the moment if you are interested in it you can browse the demo application or look the code of the plugin_examples files. I hope to collect contributions and comments :) https://github.

Re: [web2py] Google security patch progrem

2014-05-30 Thread Manuele Pesenti
Il 29/05/14 23:29, Michele Comitini ha scritto: > Richard, > LOL > +1, I was thinking just that :D ok just don't tell where the holes are... it'a treasure hunt :) M. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - h

Re: [web2py] Re: json query

2014-05-27 Thread Manuele Pesenti
Il 27/05/14 13:56, Anthony ha scritto: > I'm not sure if the DAL includes any code to de-code JSON queries, but > I found this web2py slice written around the same time that > Query.as_json was added to the DAL: > http://www.web2pyslices.com/slice/show/1593/class-for-building-db-queries-from-python

[web2py] json query

2014-05-27 Thread Manuele Pesenti
Hi! Looking in the code[1] I noticed that it's possible to serialize Query object into json string... how can I rebuild the query object server side? Thank you very mutch M. [1] https://github.com/web2py/web2py/blob/master/gluon/dal.py#L10430 -- Resources: - http://web2py.com - http://web2

[web2py] datetime smart query

2014-05-19 Thread Manuele Pesenti
Hi, can somebody help me to build up smart queries that involve datetime fields? How format I have to use for the datetime I want use as comparison value? than you very mutch cheers Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2p

Re: [web2py] Re: first() as aggregation function

2014-05-01 Thread Manuele Pesenti
Il 01/05/14 10:16, Manuele Pesenti ha scritto: > ok, I tried without success... > with the solution I found patching the dal source code adding the > array_agg expression method as described I defined this query. > Can you help me to get the same using expressions? well... I solved in

Re: [web2py] Re: first() as aggregation function

2014-05-01 Thread Manuele Pesenti
Il 28/04/14 22:39, Manuele Pesenti ha scritto: >> there's no need to introduce a new method you can use expression >> > themselves in the select, and extract the field as usual >> > >> > myexpr = 'first_value(b_field) over (partition by a_field

Re: [web2py] Re: first() as aggregation function

2014-04-28 Thread Manuele Pesenti
Il 28/04/14 21:06, Niphlod ha scritto: > seems to me that you should use windowing functions instead > > there's no need to introduce a new method you can use expression > themselves in the select, and extract the field as usual > > myexpr = 'first_value(b_field) over (partition by a_field

Re: [web2py] Re: first() as aggregation function

2014-04-28 Thread Manuele Pesenti
Il 28/04/14 16:05, Carlos Costa ha scritto: > I think he is looking for the first record of each group, not the > first record of the entire result. > I think there is no such function in web2py yet. > > I have performed a similar task for reporting using this: > https://docs.python.org/2/library/i

[web2py] first() as aggregation function

2014-04-28 Thread Manuele Pesenti
Hi! does exists or can be implemented an aggregation function that returns the first element of a group instead of the sum, max, min or avg result? Thank you... as usual :) Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (

Re: [web2py] parallel shell cause portal block

2014-04-24 Thread Manuele Pesenti
Il 24/04/14 21:03, Marin Pranjić ha scritto: > It might be that database is blocking because you never end a transaction. > Do you have db.commit() in your task? > > Marin Hi Marin, thanks for you replay. The only commit explicitly called is inside a scheduler function where afaik is necessary beca

[web2py] parallel shell cause portal block

2014-04-24 Thread Manuele Pesenti
Hi! I want to notify a strange behaviour. If I run any kind of parallel command, such as calling web2py.py with -K option to run my scheduled task or with -S -M to test manually some function in my environment it cause a portal block. The portal will reply again only from the moment I kill the par

Re: [web2py] list:string

2014-04-03 Thread Manuele Pesenti
Il 03/04/14 14:01, horridohobbyist ha scritto: > Well, I added data by using db.update() instead of SQLFORM. The data > is definitely in there, and it works. However, in admin, *the data is > not visible* in the list:string field (it's empty), so I can't edit > it. The behaviour of the list:string

Re: [web2py] list:string

2014-04-02 Thread Manuele Pesenti
Il 03/04/14 06:23, horridohobbyist ha scritto: > I've added a 'list:string' field to my table, but when adding a new > record from admin (using the new record form), I can't figure out how > to enter the data. I don't understand what format it expects. > > I tried "['item1','item2']". I tried "|'it

Re: [web2py] .json in url does not like "contruções"

2014-03-18 Thread Manuele Pesenti
Il 18/03/14 11:07, António Ramos ha scritto: > hello, i have a controller function > > if i call it just by http://app.xx.pt/default/myfunc > > if shows the resulting array from myfunc > > but if i call it like > http://app.xx.pt/default/myfunc.json > i get the error > utf8' codec can't decode byt

[web2py] workflow recipe

2014-02-28 Thread Manuele Pesenti
on to distribute. I'll be glad of any suggestion. Cheers Manuele Pesenti [1] https://pypi.python.org/pypi/docflow [2] http://www.web2pyslices.com/slice/show/1950/docflow-integration -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web

Re: [web2py] Re: 'datetime.datetime' has no attribute 'datetime' in scheduler

2014-02-21 Thread Manuele Pesenti
Il 20/02/14 21:51, Niphlod ha scritto: > that is an unfortunate misnaming in the datetime module > > the datetime module holds: > - datetime > - timedelta > - tzinfo > - time > as "submodules". Thanks Niphold! That was the problem. I user request.now instead of datetime.now and just import timedelt

[web2py] 'datetime.datetime' has no attribute 'datetime' in scheduler

2014-02-20 Thread Manuele Pesenti
Hi! trying to schedule a task with the scheduler in this way: scheduler.queue_task('test_networking', pvars=dict(body=oldbody), # do un minuto per riavviare l'interfaccia start_time = datetime.now() + timedelta(minutes=1), # periodo di test (default 10 min)

[web2py] Re: manage scheduler result with smartgrid

2014-02-14 Thread Manuele Pesenti
Il 14/02/14 12:13, Manuele Pesenti ha scritto: > Hi! > does anybody can tell me what's wrong in this controller? Ok.. thanks to Mirek Zvolský I found that the main problem was linked to that I set up my scheduler db with lazy_tables=True. Now (changed that option to False) for every

[web2py] manage scheduler result with smartgrid

2014-02-14 Thread Manuele Pesenti
Hi! does anybody can tell me what's wrong in this controller? def task(): if 'view' in request.args: sdb.scheduler_task.vars.represent = lambda v,row: myBEAUTIFY(loads(v), body=PRE) grid = SQLFORM.smartgrid(sdb.scheduler_task, linked_tables=['scheduler_run'], deletable=Fals

[web2py] application depencencies

2014-02-13 Thread Manuele Pesenti
Hi! If my web2py application needs third-party packages is there a way to check out I got every python library I need or list in one time all dependencies I need to install? Cheers Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/

Re: [web2py] datetime column with milliseconds precision

2014-02-12 Thread Manuele Pesenti
Il 10/02/14 12:06, Alex ha scritto: > Is it possible to update a datetime column with milliseconds precision? > > e.g. I have a field > Field('invoice_date', 'datetime') > > and I'm updating the field: > now = datetime.datetime.now() > db(db.invoice.id == 743).update(invoice_date=now) > > the currr

Re: [web2py] Re: mini web2py and logs

2014-02-01 Thread Manuele Pesenti
Il 01/02/14 21:13, Niphlod ha scritto: > what is a "minified" version of web2py ? > usually, logs are where you configured them on logging.conf, while > tracebacks are stored into every app's error/ folder... Thank you Niphold... this is a minified version of web2py: http://web2py.com/books/default

[web2py] mini web2py and logs

2014-01-31 Thread Manuele Pesenti
Hi! where can I find logs of errors tracebacks when I work on a minified version of web2py? Thanks a lot Manuele -- 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

Re: [web2py] Re: How to add a column?

2014-01-17 Thread Manuele Pesenti
Il 17/01/14 00:18, 黄祥 ha scritto: > very detail and clear explaination with the examples, why not put this > on the book on dal chapter? > > best regards, > stifan +1 M. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: Error with virtual field

2014-01-10 Thread Manuele Pesenti
Il 10/01/14 12:47, rif ha scritto: > I meant a few updates to web2admin :) thank you very mutch rif for your interest!! :) I'll use old style viertual fields for the moment M. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

Error with virtual field (was: Re: [web2py] [ANN] Started development on web2admin)

2014-01-09 Thread Manuele Pesenti
Il 10/09/12 15:49, rif ha scritto: > I started the development of a new django-like admin interface. > > You can find it here: https://github.com/rif/web2admin > > It is very basic but still usable because it uses SQLFORM.smartgrid. > > I am announcing it early because I need your feedback and fea

Re: [web2py] Re: OT: movuca internal error on comment

2014-01-03 Thread Manuele Pesenti
Il 03/01/14 10:25, Alan Etkin ha scritto: > > > that's what I get trying to add a comment to a post of mine. > > > Manuele, can you please try to add the comment now? here it is: http://www.web2pyslices.com/slice/showcomment/1500 anyway I found that in spite of the error I got yesterday t

[web2py] OT: movuca internal error on comment

2014-01-02 Thread Manuele Pesenti
@rochabruno I guess... Internal error Ticket issued: init/94.36.44.58.2014-01-02.21-55-54.40671429-3f5a-47a1-9dac-f68a7103160b that's what I get trying to add a commen

Re: [web2py] Re: create doc files

2013-12-29 Thread Manuele Pesenti
Il 28/12/13 22:20, Diego Tostes ha scritto: > here is my code: > > http://pastebin.com/qh5AV8Xh > > but the download don't start when i access this controler. I would try something like this code for the csv file format: http://web2py.com/books/default/chapter/29/10/services#CSV M. -- Resour

Re: [web2py] how to define adal model at runtime

2013-12-20 Thread Manuele Pesenti
Il 19/12/13 11:53, Giuseppe D'Amico ha scritto: > Hi I am new to web2py I need to connect to a legacy database that > could be postgresql or mysql, I would like to know if there is a way > to define the model of the database at runtime? could it be of any help? http://www.web2pyslices.com/slice/s

Re: [web2py] dal store data in more than 1 database

2013-12-16 Thread Manuele Pesenti
Il 14/12/13 01:29, 黄祥 ha scritto: > hi, > > is it possible for dal store data in more than 1 database? heve you read this part of the documentation? http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Replicated-databases M. > > let say i use database 'production1' with my

Re: [web2py] Re: RuntimeError: no driver available... but not in interactive shell

2013-11-14 Thread Manuele Pesenti
Il 14/11/13 18:41, Massimo Di Pierro ha scritto: > I assume you are using Oracle. You need to install cx_Oracle. I beg your pardon Massimo, the problem is that cx_Oracle is already installed and I can correctly connect to the Oracle database using the web2py interactive shell (using -S and -M optio

[web2py] RuntimeError: no driver available... but not in interactive shell

2013-11-14 Thread Manuele Pesenti
Hi, I get this error[1] but running interactive shell using same web2py.py with options -S myapp -M everythig runs ok... where can I look for the problem? At the following link[2] you can find the daemon script content I use to run my application. Thank you a lot Best regards Manuele [1] DE

Re: [web2py] geocode() return value

2013-10-09 Thread Manuele Pesenti
Il 24/09/13 15:44, Ricardo Cárdenas ha scritto: > Hi Manuele, > > Thanks for your email. (0,0) in effect represents two possible > outcomes: "/I could not geocode this address/" and also "/please try > again later/". How can I know if it makes sense to retry later? > > best regards -Ricardo Hi Rica

Re: [web2py] from devel list (was Re: [web2py-dev] Here they come...)

2013-10-01 Thread Manuele Pesenti
Il 26/09/13 20:49, Gour ha scritto: > Not to clutter dev list, I'm replying here on the comment which was > posted recently on Quora... > > (http://www.quora.com/Wei-Wei-1/Posts/10-reasons-not-to-use-web2py) Perché tanto odio?!? I mean... why a post again something he do not know instead a post on

Re: [web2py] geocode() return value

2013-09-25 Thread Manuele Pesenti
Il 24/09/13 15:44, Ricardo Cárdenas ha scritto: > Hi Manuele, > > Thanks for your email. (0,0) in effect represents two possible > outcomes: "/I could not geocode this address/" and also "/please try > again later/". How can I know if it makes sense to retry later? > good quest... another solution

Re: [web2py] geocode() return value

2013-09-24 Thread Manuele Pesenti
Il 24/09/13 15:13, Ricardo Cárdenas ha scritto: > The gluon.tools geocode() function is great. > > A minor suggestion. Right now it returns (0,0) on any execption. It > would be nice if the function distinguished between /unable to geocode > this address/ and other problems (such as quota reached).

[web2py] download url

2013-09-21 Thread Manuele Pesenti
Hi! what's the correct way to get the download url from a table record which model contains a field of type upload? thank you best regards Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google

Re: [web2py] Re: one to many using list:reference

2013-09-19 Thread Manuele Pesenti
Il 19/09/13 17:11, Massimo Di Pierro ha scritto: > No because that would be inefficient. Yet in forms the elements of a > list:reference that correspond to deleted records are filtered out. So > when you edit the record they are deleted. Great! Thank you Massimo and Richard. Cheers Manuele >

<    1   2   3   4   5   6   >