[web2py] removing .load extension from grid pagination and export csv links

2013-08-01 Thread Matt Grham
Hi All, I have a grid in a LOAD component. How can I remove the .load extensions from the grid links (next page and export csv links)? Thanks, Matt -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop

[web2py] Re: Uploading data as blob -- hitting a brick wall

2013-08-01 Thread Joe Barnhart
Hi Niphlod -- Thank you for pointing me in the right direction. Although my application is too complicated to simplify (or more likely I'm not skilled enough to do it quickly) I was able to create a simple "form" example like you tested and put breakpoints in WingIDE to find out what is actual

[web2py] Re: how to send data to the server with web2py_websocket

2013-08-01 Thread lyn2py
I saw the console and there were these error messages, I thought it might help: 1375413960.5:MESSAGE to display:12 ERROR:tornado.application:Uncaught exception POST / (127.0.0.1) HTTPRequest(protocol='http', host='127.0.0.1:', method='POST', uri='/', version='HTTP/1.0', remote_ip='127.0.0.1'

[web2py] Re: minifying the view

2013-08-01 Thread Anthony
You could put more template code and HTML onto a single line rather than on separate lines, though that will result in less readable/maintainable templates. Can you show a specific example of (a) some template code, (b) the HTML it generates, and (c) the HTML you would prefer to see instead? An

[web2py] Re: Copy data from one db into another

2013-08-01 Thread Dave Carlson
Hi Mart I did it without the quotes around the -y and -Y and when the quotes are completely removed, the command line arguments do not get passed completely and incorrectly parse. So I tried it with quotes around -Y and it parses the commands. Still doesn't work. It looks like the DAL creates

[web2py] Re: how to send data to the server with web2py_websocket

2013-08-01 Thread lyn2py
I am trying the websocket on google chrome and encountered this error: Uncaught TypeError: Property 'web2py_websocket' of object [object Object] is not a function I have followed the instructions. What could I be doing wrong? Thanks! On Friday, July 26, 2013 10:48:07 PM UTC+8, Massimo Di Pier

[web2py] Re: How to create a hyperlink from a display field in sqlForm?

2013-08-01 Thread Alex Glaros
need just a little more help to get me over the hump can anyone use the examples of the code and actually make it work? what happens is that the target record in the target database is never isolated and displayed, instead all records are displayed. thanks, Alex On Wednesday, July 31, 2013 5:

Re: [web2py] crud permissions

2013-08-01 Thread Richard Vézina
crud does what it does enforce permission on table... I think you need to create group, membership to this group to one of your user (your user for instance), then create permissions : create permission for table x for group y. You can use the appadmin interface for that at /appname/appadmin Also,

[web2py] Re: minifying the view

2013-08-01 Thread Mark Finkelstein
Sure; instead of calling minify dynamically, which would take extra computation, I was wondering if there was a better way so that the excess spaces do not appear to begin with (by minifying the actual view python file in a way). Also, thanks for being a great help on this forum. On Thursday, A

Re: [web2py] Re: Book register example - how to redirect to other URL

2013-08-01 Thread Jake Angulo
Hi Massimo, It worked like a charm! I changed your code a bit to fit my logic flow, and it worked. I just dont know how you have created such a great framework - and still have the time to respond to silly questions like mine :D FYI: I was choosing between Django & Web2py, and from the rumors I

[web2py] debugging with winpdb

2013-08-01 Thread Mark Finkelstein
I've been trying to get winpdb to play nice with web2py, but I've gotten the following: winpdb python web2py.py -a password -p 8000 Failed to parse arguments: Unknown option -c I saw some previous posts seemingly getting this setup working, any tips? What debugging environments do other people

[web2py] Re: minifying the view

2013-08-01 Thread Anthony
Can you give an example of what you are trying to achieve? On Thursday, August 1, 2013 9:14:41 PM UTC-4, Mark Finkelstein wrote: > > I actually meant minifying the view py file itself to remove the spaces > where they would have been produced? > > On Thursday, August 1, 2013 6:39:52 PM UTC-4, Ant

[web2py] Re: minifying the view

2013-08-01 Thread Mark Finkelstein
I actually meant minifying the view py file itself to remove the spaces where they would have been produced? On Thursday, August 1, 2013 6:39:52 PM UTC-4, Anthony wrote: > > I think something like: > > from gluon.contrib.minify import htmlmin > > def myaction(): > ... > return htmlmin.min

[web2py] Re: ajax() infinite loop

2013-08-01 Thread Marco Prosperi
It was the first thing I tried, using the same view and the following script, but nothing happens in this case when the quantity changes. Maybe it interferes with the 'add' and 'sub' callbacks? jQuery(document).ready(function(){ jQuery('.e').change(function(){ jQuery('#910').slideToggl

[web2py] Re: minifying the view

2013-08-01 Thread Anthony
I think something like: from gluon.contrib.minify import htmlmin def myaction(): ... return htmlmin.minify(response.render(dict(...))) Anthony On Thursday, August 1, 2013 5:57:51 PM UTC-4, Mark Finkelstein wrote: > > I noticed that as it stands, the html response sent is filled with spa

[web2py] minifying the view

2013-08-01 Thread Mark Finkelstein
I noticed that as it stands, the html response sent is filled with spaces due to formatting, I was wondering if there was a way to 'minify' or remove all the spaces and compress the view file to decrease the size of the response and make it more aesthetically pleasing. Thank you in advance. --

[web2py] Re: Validation of forms created in views

2013-08-01 Thread Anthony
I think you should be able to call form.process() in the view, though it's probably a better idea to do this in the controller. Can you show your code? Anthony On Thursday, August 1, 2013 11:12:22 AM UTC-4, Gökçen Eraslan wrote: > > Hello, > > I have a question about the validation of forms crea

[web2py] installation

2013-08-01 Thread Loïc
You should find an answer here : https://groups.google.com/d/msg/web2py/ry8x096dKZQ/eQrnusGVsloJ And here : http://www.web2py.com/books/default/chapter/29/03/overview?search=0.0.0.0 -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To uns

[web2py] link: MPL webagg-backend

2013-08-01 Thread Tim Michelsen
http://matplotlib.org/users/whats_new.html#webagg-backend -- --- 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 opt

[web2py] Force reload from another page

2013-08-01 Thread lyn2py
Ok, I have an idea how I want to do this, but no idea if it is possible to do it in web2py or code-wise. Any input will greatly help me. I have 2 webpages: A and B -> A has a form -> B is a separate display in another room, example, boss's room. I would want to achieve: -> When the form in A sub

[web2py][LDAP] once authenticated with LDAP I got "No fields to update"

2013-08-01 Thread Richard
Hello, I am trying to implement LDAP authentication right now and I am falling on issue "No fields to update". As far as I know the authencation is working since I only start to have this issue once the it happen something else then have the same login blank form again and again. So, I think I

[web2py] Adding to variable to globals() or locals()

2013-08-01 Thread Mark Finkelstein
I was wondering how I would go about adding a variable to globals() or locals() from a module or elsewhere so that it is available to the view. Thanks in advance. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this g

[web2py] installation

2013-08-01 Thread Vicente Deluca
Hi, I've already installed web2py in my server and I look the wellcome webpage well from my localhost, but not from other IP. Did any knows if I must to configure some else? tks Vicente. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group.

[web2py] crud permissions

2013-08-01 Thread GregD
I've turned on auth and attempting to use crud. when I go to my app http://.../data/create/table_name I get "insufficient privileges" NOT Authorized Access Denied What am I missing? db.py is as follows: from gluon.tools import Auth from gluon.tools import Crud db = DAL('sqlite://storage.sqlit

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Jonathan Lundell
On 1 Aug 2013, at 12:30 PM, Niphlod wrote: > ok. so to be on the safe side if env.http_content_type and > env.http_content_length are provided gluon.main should update the env > accordingly, and then the code can happily always use env.content_length and > env.content_type That would be the id

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Niphlod
ok. so to be on the safe side if env.http_content_type and env.http_content_length are provided gluon.main should update the env accordingly, and then the code can happily always use env.content_length and env.content_type On Thursday, August 1, 2013 9:21:28 PM UTC+2, Jonathan Lundell wrote: >

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Jonathan Lundell
On 1 Aug 2013, at 12:11 PM, Niphlod wrote: > ok, thanks for the additional explanation. > > tl;dr: As we don't "want to support" any breaking-spec servers (+1 on that), > the only thing to take care of is to rely for both content-type and > content-length headers to be directly on env and not

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Niphlod
ok, thanks for the additional explanation. tl;dr: As we don't "want to support" any breaking-spec servers (+1 on that), the only thing to take care of is to rely for both content-type and content-length headers to be directly on env and not expecting them to be neither http_content_length nor

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Jonathan Lundell
On 1 Aug 2013, at 11:51 AM, Niphlod wrote: > @derek and @dhmorgan: actually what Iceberg posted is fine, it's really a > subtle bug that needs to be addressed as per the docs posted by out own > omniscient Jonathan, that can happen with some particular (although allowed) > server architectures.

[web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Niphlod
@derek and @dhmorgan: actually what Iceberg posted is fine, it's really a subtle bug that needs to be addressed as per the docs posted by out own omniscient Jonathan, that can happen with some particular (although allowed) server architectures. @jonathan: before diving in rocket's own "patching

[web2py] Re: ajax() infinite loop

2013-08-01 Thread Niphlod
well, you are hooking up to the event that gets fired every time an ajax request completes. you "trial" code just replace the fragment with a fixed value, but if you use ajax instead the ajaxstop will fire in a loop, and it's correct that it does it. Why are you hooking up to the ajaxstop event

[web2py][book typo] book typo

2013-08-01 Thread Richard
Hello, I think I found a typo in book : This : auth_table.username.requires = IS_NOT_IN_DB(db, auth_table.username) Should read as this, I think : auth_table.username.requires = IS_NOT_IN_DB(db,* '*auth_table.username*'*) Chapter : 9, section : Customizing auth http://web2py.com/books/default/

[web2py] ajax() infinite loop

2013-08-01 Thread Marco Prosperi
hello, I would like to update the total in the view below (bottom of the message) when the user changes quantity. The following script works fine (fixed value) jQuery(document).ready(function(){ $(document).ajaxStop(function(){ jQuery('#910').slideToggle(); jQuery('#910').html('

[web2py] Re: Quick contract job

2013-08-01 Thread davedigerati
I've hired someone, thanks for the interest and I look forward to continuing to learn this great framework;) On Thursday, August 1, 2013 12:11:59 AM UTC-4, davedigerati wrote: > > I have been learning web2py for a project and while I am really enjoying > it I am up against a deadline for my clie

[web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Derek
You should not be posting JSON strings to the webserver. The 'post_vars' can contain anything that json itself can represent, and it is more efficient. If you do a post of a json string with $.POST it will convert that json string to http variables because that's what you should be doing. On We

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Niphlod
+1 for the proposed fix. I learned something new in the process ^_^ PS @all: I'd like to backport web3py lazy request.vars, request.get_vars, request.post_vars, request.cookies, and request.env to web2py starting from tomorrow. If other things like this should be patched in globals.py or in mai

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Ray (a.k.a. Iceberg)
On Thursday, August 1, 2013 11:38:17 PM UTC+8, Jonathan Lundell wrote: > > On 1 Aug 2013, at 7:25 AM, "Ray (a.k.a. Iceberg)" > > > wrote: > > Thanks for trying to help Niphlod. More details so far. > > Strangely, that problem does NOT exist when I test with > http://web2py.com/examples/simple_

Re: [web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Jonathan Lundell
On 1 Aug 2013, at 7:25 AM, "Ray (a.k.a. Iceberg)" wrote: > Thanks for trying to help Niphlod. More details so far. > > Strangely, that problem does NOT exist when I test with > http://web2py.com/examples/simple_examples/status > > So I compare the output page between mine and the one from web2p

[web2py] Validation of forms created in views

2013-08-01 Thread Gökçen Eraslan
Hello, I have a question about the validation of forms created in a view, such as this one in the admin application[1]. This form is submitted to upload_file function of the default controller here[2]. In such cases, we don't have a FORM() helper in the controller function[2], so we cannot valida

[web2py] Re: {{include tmpNameVar }} with template name as a variable problem

2013-08-01 Thread Anthony
As an alternative, you might try something like this (not tested): {{import os}} {{from gluon.template import render}} {{for m in app.modules.codes:}} {{=XML(render(filename=os.path.join(request.folder, m, 'left_navig.html' ), path=os.path.join(request.folder, 'views'), conte

[web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Ray (a.k.a. Iceberg)
Thanks for trying to help Niphlod. More details so far. Strangely, that problem does NOT exist when I test with http://web2py.com/examples/simple_examples/status So I compare the output page between mine and the one from web2py.com, then I found something. On my server's output, there are only

[web2py] Re: {{include tmpNameVar }} with template name as a variable problem

2013-08-01 Thread Anthony
The entire template is parsed (including all of the "include" directives) before any template Python code is run, so the include directives cannot include variables defined in the template itself. The code that comes right after the "include" is eval'ed in the view environment, which includes th

[web2py] Re: PunchOut cXML system with web2py

2013-08-01 Thread Niphlod
http://lxml.de/ is the place. On Thursday, August 1, 2013 3:05:17 PM UTC+2, Willoughby wrote: > > Thanks Niphlod. I appreciate your insight AND all you do for web2py! > I'll check out lxml - I don't think I ran across that during my searching. > > On Wednesday, July 31, 2013 3:18:09 PM UTC-4, Nip

Re: [web2py] is_in_db with union select

2013-08-01 Thread Niphlod
the important part is that you cache it somewhere, either using select(..cache) or storing the actual set to pass to the is_in_set validator. On Thursday, August 1, 2013 2:56:40 PM UTC+2, Antonis Konstantinos Tzorvas wrote: > > i don't know much about cache yet, > if i am not mistaken it caches

[web2py] Re: PunchOut cXML system with web2py

2013-08-01 Thread Willoughby
Thanks Niphlod. I appreciate your insight AND all you do for web2py! I'll check out lxml - I don't think I ran across that during my searching. On Wednesday, July 31, 2013 3:18:09 PM UTC-4, Niphlod wrote: > > unfortunately my experience is only with edi parsers that are much harder > to build th

Re: [web2py] is_in_db with union select

2013-08-01 Thread Antonis Konstantinos Tzorvas
i don't know much about cache yet, if i am not mistaken it caches the two queries separated my query is this: years = [i.year for i in union(db(db.table1.station_id==this_station.id).select(db.table1.year),db(db.table2.station_id==this_station.id).select(db.table2.year)).sort(lambda row: row.ye

[web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread dhmorgan
local server will automatically use generic views if a corresponding view is not found, which is the case with those examples; this is disabled by default for production environments but can be overwritten In chapter 4 (the Core), there is this from the book: - If a view is not found, web2p

[web2py] {{include tmpNameVar }} with template name as a variable problem

2013-08-01 Thread David Marko
I'm trying to use include in 'for' statement importing left navigation snippets from separate folders for particular modules. Code is very simple as below. But it fails on line with include saying that 'm' variable doesnt exist. I tried this and that and found out that include can see variables

[web2py] Re: Database showing wrong default value

2013-08-01 Thread Niphlod
because datetime.datetime.now() is NOT deterministic every time you call it, it replies with the current time. What do you need specifically ? On Thursday, August 1, 2013 1:56:48 PM UTC+2, Apoorve Mohan wrote: > > > Hello > > I am storing datetime.datetime.now() as default value of an attribu

Re: [web2py] is_in_db with union select

2013-08-01 Thread Niphlod
I sincerely hope that this gets cached somewhere in your app, because if instead they are in models, you're doing 2 selects for every request On Thursday, August 1, 2013 2:21:07 PM UTC+2, Antonis Konstantinos Tzorvas wrote: > > yes you are right, i was looking also in IS_IN_SET > and finally af

Re: [web2py] is_in_db with union select

2013-08-01 Thread Antonis Konstantinos Tzorvas
yes you are right, i was looking also in IS_IN_SET and finally after your reminder one solution came up easily, IS_IN_SET([i.name for i in rows = union(db().select(db.a.name),db().select( db.b.name)).sort(lambda row: row.name)]) which now displays all the values of a required column from both tab

[web2py] Database showing wrong default value

2013-08-01 Thread Apoorve Mohan
Hello I am storing datetime.datetime.now() as default value of an attribute. But the time stored in the db is changing automatically. Why is this happening. Why the default value is not persistent??? -- Apoorve -- --- You received this message because you are subscribed to the Google Group

Re: [web2py] is_in_db with union select

2013-08-01 Thread Vinicius Assef
I don't think so. The book says IS_IN_DB() can receive a Set, but not Rows. On Thu, Aug 1, 2013 at 8:33 AM, Antonis Konstantinos Tzorvas wrote: >> --- https://groups.google.com/d/msg/web2py/o3GebSeC7j4/Sct76ynB3fsJ >> >> db=DAL()db.define_table('a',Field('name')) >> db.define_table('b',Fiel

[web2py] is_in_db with union select

2013-08-01 Thread Antonis Konstantinos Tzorvas
> > --- https://groups.google.com/d/msg/web2py/o3GebSeC7j4/Sct76ynB3fsJ > db=DAL()db.define_table('a',Field('name')) > db.define_table('b',Field('name')) > db.a.insert(name='Alex') > db.a.insert(name='Max') > db.a.insert(name='Tim') > db.b.insert(name='John') > db.b.insert(name='Jack') > def

Re: [web2py] Re: Book register example - how to redirect to other URL

2013-08-01 Thread Jake Angulo
On Thu, Aug 1, 2013 at 5:13 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > You do not need to modify the registration for this. Instead you do the > following: > > Hi Massimo, Thank you for pointing that out, I will explore it as an alternative logic. Regarding: "redirect('http://p

[web2py] Re: Fail to recognize json payload in a content-type: application/json POST request

2013-08-01 Thread Niphlod
I really can't reproduce it. Can you log somewhere within the parse_get_post_vars function what happens ? On Thursday, August 1, 2013 8:53:09 AM UTC+2, Ray (a.k.a. Iceberg) wrote: > > To whom it may concern: > > I tried posting vars in json format, with content-type: application/json > header, t

[web2py] Re: bootstrap 3

2013-08-01 Thread Niphlod
I think the main reason to switch is the "mobile first" redesign (apart from the fact that given the "push" that bootstrap has, several features/plugins/etc will be built around that). On top of that, js plugins have been improved and rewritten to take care of some bugs. I like the improvements

[web2py] Re: Book register example - how to redirect to other URL

2013-08-01 Thread Massimo Di Pierro
You do not need to modify the registration for this. Instead you do the following: auth = Auth(db) auth.settings.extra_fields=[Field('has_paid','boolean',default=False)] auth.define_tables() if auth.user and not auth.user.has_paid: db(db.auth_user.id==auth.user.id).update(has_paid = True

[web2py] Re: Book register example - how to redirect to other URL

2013-08-01 Thread Jake Angulo
On Thu, Aug 1, 2013 at 3:50 PM, Jake Angulo wrote: > > Where and how should i modify the code? > > So basically, I want to use the built-in Auth register() function - but I want to modify its behavior: Auth.register() checks if the new user is successfully registered & logged in, and then redir

[web2py] Re: packing apps as desktop native apps (windows/os x)

2013-08-01 Thread Massimo Di Pierro
I agree. It would be easy to do. 1) make a copy of web2py 2) compile your app 3) move the compiler app under init 4) re-zip web2py The process is the same for Windows and Mac. On Wednesday, 31 July 2013 12:15:46 UTC-5, VP wrote: > > I know there're some recipes in the book in deploying your app

[web2py] Re: bootstrap 3

2013-08-01 Thread Massimo Di Pierro
Why is 3 better than 2 other than the higher number? The buttons do not look as nice. On Wednesday, 31 July 2013 10:56:39 UTC-5, VP wrote: > > not quite compatible with web2py yet. Navbar are all messed up. Possibly > other things as well. > > I think no more span-12, span-10, etc. new synta