[web2py] Re: track_changes for modules stops working after some time - some observation

2013-08-02 Thread Massimo Di Pierro
Ok. I will look into it asap. If you can provide a simple example to reproduce this behavior would be helpful. The more details (os, python, web2py version) would also help. On Friday, 2 August 2013 12:11:54 UTC-5, David Marko wrote: > > Its in model ... -- --- You received this message bec

[web2py] Re: web2py query filter with datatime field using between

2013-08-02 Thread Annet
I don't think web2py supports 'between'. However, this works: (db.table.startDatetime>datetime1)&(db.table.endDatetimehttps://groups.google.com/groups/opt_out.

[web2py] Scheduler period

2013-08-02 Thread Roberto Perdomo
Hi, I have a little question: Exists a way to disable the period of a scheduler_task row? I have to do a task in a stop_time - n_hours and stop_time, I have set the period to n_hours (in seconds), but in the first run the next_run_time field is set to stop_time + few seconds and this are over t

Re: [web2py] Adjusting the width of the textarea

2013-08-02 Thread davedigerati
I'm bumping up against this on a form as well, and puzzled why using a custom/clean css sheet loaded last in the page header for precedence, with unique divs/classes aren't working on the textareas... not for size, background-color, text color, nothing. I can target the row, the parent divs, e

[web2py] Re: web2py server start issue

2013-08-02 Thread davedigerati
When I've forgotten I've just stopped the server, closed the app or terminal it was running from, reopen and restart with a new password. I'm sorry I'm not familiar with that error number but had you tried above? On Friday, August 2, 2013 10:15:00 PM UTC-4, ndave wrote: > > Hi, > > I was earli

[web2py] web2py query filter with datatime field using between

2013-08-02 Thread Jayakumar Bellie
Hi, Is there any way to filter datetime field using between in web2py? I have not seen anything in the document or in the web. Have anyone tried it? The only way I see is through executesql() function is there any other way? -- --- You received this message because you are subscribed to the Go

[web2py] web2py server start issue

2013-08-02 Thread ndave
Hi, I was earlier able to start the server by choosing a password. The issue is I have forgotten the password and I keep getting the error "Errno 13 Permission denied 'C:\\Program Files\\web2py\\parameters_8000.py" Please help as I am unable to proceed. I also tried copying the folder from the

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

2013-08-02 Thread Matt Grham
Thanks a lot Niphlod. Actually that was the case. I started to use web2py 2.4.6 but my app was built using web2py 1.99.7. I updated web2py.js, web2py_ajax.html and layout.html. It works now. But if I want to refresh the component in every 30 seconds, I am having a problem. Sometimes pagination

[web2py] Re: bootstrap 3

2013-08-02 Thread LightDot
I think Niphlod has some valid points. As far as the design goes, I like Bootstrap 2 and 3 both, they are just different. Hm... I do quite like the looks of BS 2, perhaps even more than 3... As I was starting some of the past web2py projects of mine, I've been constantly saying to myself: "I'll

[web2py] Re: Clarification needed: Multiple forms

2013-08-02 Thread lesssugar
form1 and form2 are just variables' names - they store the same HTML helper code. Notice that *_name='name' *is just a general example. Maybe it would be a little bit clearer if the _name values in the book were different: form_one, form_two. But that's basically it. You need to distinguish the

[web2py] Re: Clarification needed: Multiple forms

2013-08-02 Thread lyn2py
Thanks Niphlod. But I thought that was accomplished with form1 and form2 variables already? Do we still need to use the formname variable? On Saturday, August 3, 2013 12:20:26 AM UTC+8, Niphlod wrote: > > given that forms are submitted to the same page, it's the only way for the > controller to

[web2py] list:string repeats same error message in SQLFORM grid

2013-08-02 Thread step
is it possible to display just one error message of a list:string input right after the last input control, using SQLFORM.grid? With SQLFORM,grid create/update form, when a list:string field with validators has errors it should be possible to hide the error display on all list inputs but the la

[web2py] Re: IS web2py good for largescale

2013-08-02 Thread Aurelio Tinio
Curious to hear, what do you consider large scale? The more detailed you are about your project the better the response the community can provide. Fwiw, having only worked with web2py since the beginning of the year I've been contemplating similar questions too and essentially the answer is... *

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

2013-08-02 Thread Niphlod
did you start with an old (pre 2.6.0) app and updated web2py ? if yes, you need to overwrite your app's web2py.js with welcome/static/web2py.js I think that the most straightforward example is (assuming working on localhost, hence having generic views enabled): take your welcome, put this in def

[web2py] Re: viewScope variables implementation - your comments and ideas are welcome ...

2013-08-02 Thread Anthony
You might consider sessions in memcacheor redis . If using the standard session, I suppose you could store items with a tim

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

2013-08-02 Thread Matt Grham
Hi Niphlod, Actually I did not change web2py.js or layout.html. Can you provide a very small example of a LOADed grid? My current structure might be wrong. Thanks, Matt On Friday, August 2, 2013 1:46:16 AM UTC-7, Niphlod wrote: > > something is wrong with your layout (and possibly with web2py.

[web2py] Re: viewScope variables implementation - your comments and ideas are welcome ...

2013-08-02 Thread Niphlod
the general problem with this machinery (using either cache or session, although session are definitely nicer to use) is determine exactly when a page needs to be "closed", hence clearing your stored-so-far variables. On Friday, August 2, 2013 9:30:27 PM UTC+2, David Marko wrote: > > I tried to

[web2py] Re: viewScope variables implementation - your comments and ideas are welcome ...

2013-08-02 Thread David Marko
I tried to avoid serialize these data structures from different forms to disk (default session storage). But you are probably right, that is can be a good solution ... Dne pátek, 2. srpna 2013 21:19:26 UTC+2 Anthony napsal(a): > > Is there a reason this can't be done using the session? > > Antho

[web2py] Re: viewScope variables implementation - your comments and ideas are welcome ...

2013-08-02 Thread Anthony
Is there a reason this can't be done using the session? Anthony On Friday, August 2, 2013 3:10:55 PM UTC-4, David Marko wrote: > > I'm trying to implement the viewScope variables for web2py controller > methods. Idea behind is to mimic a behaviour of JAVA frameworks like JSF or > Spring that us

[web2py] viewScope variables implementation - your comments and ideas are welcome ...

2013-08-02 Thread David Marko
I'm trying to implement the viewScope variables for web2py controller methods. Idea behind is to mimic a behaviour of JAVA frameworks like JSF or Spring that use the concept of viewScope variables. Such variables live during the all posts to same controller action / to the same form. This is ve

[web2py] Re: minifying the view

2013-08-02 Thread Niphlod
yep. as a total offtopic (but related) real-world scenario, in 2013 all the cpu power that a server provides can be (and I strongly believe it **must** be) used to gzip the page: in such case minifying the HTML has very little impact (if no impact at all) in the loading speed of a page. On Frid

[web2py] Re: minifying the view

2013-08-02 Thread Anthony
Every line with a {{...}} (that doesn't start with "=") results in a blank line being written to the view output. To avoid that, you have to move all {{...}} code onto lines that generate output so you don't get any extraneous blank lines. For example, the code generating all the whitespace you

[web2py] Re: minifying the view

2013-08-02 Thread Mark Finkelstein
Well an example would be the default page that appears in web2py (reached by, for example, http://127.0.0.1:8000/welcome/default/index), there is a large amount of spaces in there that needlessly inflate the file; in that file, for example, there is this: Hello World How did you get here?

[web2py] Re: debugging with winpdb

2013-08-02 Thread Mark Finkelstein
Checked it out, pretty nice. Are there any editors that correctly highlight the scaffolding syntax? On Friday, August 2, 2013 5:21:33 AM UTC-4, Neil wrote: > > Now that PyCharm officially supports web2py, I've playing around its > debugger. So far, so good. Note that the latest PyCharm 3.0 EAP b

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

2013-08-02 Thread Niphlod
> > >> Also, this might be a good opportunity for var laziness, depending on how >> it works. For json-rpc apps like mine, parsing incoming application/json >> payloads into vars is a complete waste of time. >> >> PS: you're right. If we parse POST with application/json already automatically,

[web2py] Re: track_changes for modules stops working after some time - some observation

2013-08-02 Thread David Marko
Its in model ... -- --- 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 options, visit https://groups.google.com/gr

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

2013-08-02 Thread Niphlod
let me rephrase: I sent a patch for lazyness including also the content-type fix ^_^ lets see what @massimo thinks of it, I think this is a good occasion to refactor lots of bits and pieces added from time to time in a more general and consistent way On Friday, August 2, 2013 6:37:52 PM UTC+2,

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

2013-08-02 Thread Jonathan Lundell
On 2 Aug 2013, at 9:19 AM, Niphlod wrote: > hold still a few hours, I'm going to submit a patch for request that uses > lazy evaluation of vars (ala web3py): should be a good occasion to do a > general cleanup of all those bits !? No reason not to hold off, but content_type can't be lazy. BTW,

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Niphlod
yep, but that's not playing fair ^_^ happy that you resolved the problem though. On Friday, August 2, 2013 2:49:00 PM UTC+2, Marco Prosperi wrote: > > > > the solution (simple as a solution must be) is changing the > 'cart_callback' to update the entire (always little) . Sorry, you > haven't pa

[web2py] Re: adding to head under view

2013-08-02 Thread Niphlod
in recent welcome layout there's a block head just for it. https://github.com/web2py/web2py/blob/master/applications/welcome/views/layout.html#L65 On Friday, August 2, 2013 3:46:27 PM UTC+2, Anthony wrote: > > One option is to use a block: > http://web2py.com/books/default/chapter/29/05/the-views

[web2py] Re: Clarification needed: Multiple forms

2013-08-02 Thread Niphlod
given that forms are submitted to the same page, it's the only way for the controller to know what form was indeed submitted :D On Friday, August 2, 2013 6:19:20 PM UTC+2, lyn2py wrote: > > From the book: > > def two_forms(): > > form1 = FORM(INPUT(_name='name', requires=IS_NOT_EMPTY()), >

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

2013-08-02 Thread Niphlod
hold still a few hours, I'm going to submit a patch for request that uses lazy evaluation of vars (ala web3py): should be a good occasion to do a general cleanup of all those bits !? On Friday, August 2, 2013 4:12:23 PM UTC+2, Jonathan Lundell wrote: > > On 2 Aug 2013, at 12:11 AM, Massimo Di Pi

[web2py] Clarification needed: Multiple forms

2013-08-02 Thread lyn2py
>From the book: def two_forms(): form1 = FORM(INPUT(_name='name', requires=IS_NOT_EMPTY()), INPUT(_type='submit')) form2 = FORM(INPUT(_name='name', requires=IS_NOT_EMPTY()), INPUT(_type='submit')) if form1.process(*formname='form_one'*).accepted:

[web2py] Re: track_changes for modules stops working after some time - some observation

2013-08-02 Thread Massimo Di Pierro
Where did you put track_changes? It is supposed to be in a model not in a module, certainly not in the module you are trying to reload. On Friday, 2 August 2013 05:01:42 UTC-5, David Marko wrote: > > It has been reported a few times by different users. track_changes for > modules stops working a

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

2013-08-02 Thread Richard Vézina
Response : INFO:web2py.auth.ldap_auth:[serverName] Initialize ldap connection So, I guess I should search somewhere... It seems to come from a non closing bracket leaved somewhere cause of refactoring for LDAP... Thanks Richard On Fri, Aug 2, 2013 at 4:23 AM, szimszon wrote: > Could you try

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

2013-08-02 Thread Jonathan Lundell
On 2 Aug 2013, at 12:11 AM, Massimo Di Pierro wrote: > Our policy is that request.env is just the wsgi environment, without computed > variables. Except for fixup_missing_path_info. > Perhaps this? > > if not request.env.content_type and request.env.http_content_type: > request.content_ty

[web2py] Re: onvalidate fails with compute=lambda field

2013-08-02 Thread Anthony
You mean you get an error when inserting duplicate data? Note, unique=True is enforced by the database, not web2py, so violating it will simply result in a database error (which results in a web2py ticket if you don't explicitly catch the error yourself). Instead, you want to use the IS_NOT_IN_

[web2py] Re: adding to head under view

2013-08-02 Thread Anthony
One option is to use a block: http://web2py.com/books/default/chapter/29/05/the-views#Blocks-in-views Another is something like: {{=globals().get('head_script', '')}} Then have the controller return a 'head_script' variable, or define the variable in the view *before* the {{extend 'layout.html

[web2py] Re: remove or add custom attribute to tag

2013-08-02 Thread Anthony
> > ok, say i have an INPUT like: > INPUT(_name="dude", _type="text", _id="dude_int") > > how can i remove the name attribute from the tag? > form.element('[name=dude]').attributes.pop('_name') or del form.element('[name=dude]')['_name'] The attributes of an HTML helper act like a dictionary

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Marco Prosperi
the solution (simple as a solution must be) is changing the 'cart_callback' to update the entire (always little) . Sorry, you haven't passed the test :-P thank you for your time! Marco On Friday, August 2, 2013 10:22:23 AM UTC+2, Niphlod wrote: > > well, given that you're not an expert on ja

[web2py] remove or add custom attribute to tag

2013-08-02 Thread lucas
hello one and all, ok, say i have an INPUT like: INPUT(_name="dude", _type="text", _id="dude_int") how can i remove the name attribute from the tag? also, say i want to add a non-standard attribute to the tag like: form.element(_id="dude_int").update(_custom_attr1="attr1_data") will web2py co

Re: [web2py] POSTing application/json request to web2py

2013-08-02 Thread Michele Comitini
Ray, Just to be sure... after upgrading to 2.5.1 did you restart apache? If you did and still does not work open a ticket on googlecode. In the meantime you can try with reading request.body that should work. mic 2013/8/1 Ray (a.k.a. Iceberg) > To whom it may concern: > > I tried posting v

Re: [web2py] Re: Quick contract job

2013-08-02 Thread Michele Comitini
"Good job!" ;-) 2013/8/1 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

[web2py] adding to head under view

2013-08-02 Thread lucas
hello one and all, under a view html file, what is the best way to add a SCRIPT helper to the head of the final output. using layout.html as the template. thanx in advance, lucas -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsub

Re: [web2py] IS web2py good for largescale

2013-08-02 Thread Vinicius Assef
Why not? Generally speaking, what doesn't scale is your platform and infrastructure. With any framework you'll need to use dynamic and static caches, load balancing protocols and make many optimizations in your code to adhere to performance specifications. It's more a project concern than languag

[web2py] GET request from kendo ui returning an invalid argument

2013-08-02 Thread Simon Ashley
Have been playing with Kendo UI and have an issue where a GET request to a w2p service returns an invalid argument error. Kendo places a callback at the end of the address in the form of: http://127.0.0.1:8000/dogsfleas/dogs/api/dogs* ?callback=jQuery1910806812594877556_1375342185702&_=1375342185

[web2py] IS web2py good for largescale

2013-08-02 Thread hello world
Hey I would like to know if web2py framework ...is a good framework for making large scale websites...???.. -- --- 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 t

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

2013-08-02 Thread lyn2py
Ok I found a solution online, maybe Massimo can confirm that there is a bug in web2py_sockets.py https://groups.google.com/forum/#!msg/python-tornado/kgCoVCUkdeM/99yS2ZEhkVAJ Ah, OK. Looks like a web2py bug then. web2py's websocket support contains > handlers that return "true" or "false"; th

[web2py] Problem with function [pyfpdf] add_font() on GAE.

2013-08-02 Thread Brez Yl
Hello! I'm writing an app, which results with pdf file with some text with unicode characters. On local GAE it works good, but after deploy it can't import crash after add_font() (pyfpdf). The code is: # -*- coding: utf-8 -*- def fun1(): from gluon.contrib.pyfpdf import FPDF, HTMLMixin

[web2py] track_changes for modules stops working after some time - some observation

2013-08-02 Thread David Marko
It has been reported a few times by different users. track_changes for modules stops working after several reloads of page in browser. I can see typical scenario ... I'm working with module and changes are detected correctly . After 6-7 changes and reloads cycle in browser during the coding pro

[web2py] Re: debugging with winpdb

2013-08-02 Thread Neil
Now that PyCharm officially supports web2py, I've playing around its debugger. So far, so good. Note that the latest PyCharm 3.0 EAP build can be used for free for a few more weeks. On Friday, 2 August 2013 02:21:46 UTC+1, Mark Finkelstein wrote: > > I've been trying to get winpdb to play nice w

[web2py] Re: Force reload from another page

2013-08-02 Thread lyn2py
I'm sorry I missed out the link: https://groups.google.com/forum/m/#!topic/web2py/NwYcjtOLJJ4 -- --- 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+unsub

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

2013-08-02 Thread Niphlod
something is wrong with your layout (and possibly with web2py.js). Any LOADed grid has links that are trapped by default, and all links lead to change only the fragment where the grid has been loadeddid you fiddle with web2py.js or layout.html ? On Friday, August 2, 2013 10:43:47 AM UTC+2,

[web2py] Re: Force reload from another page

2013-08-02 Thread lyn2py
I posted details here I hope you can help! -- --- 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 options, visit htt

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

2013-08-02 Thread Matt Grham
with .load, page 2 of table opens without any layout. It does not work like a component in that regard. I need to refresh the table every 30 seconds. That is why, I use LOAD and reload the component in a script statement in every 30 seconds. Matt On Friday, August 2, 2013 12:43:40 AM UTC-7, N

[web2py] Re: Force reload from another page

2013-08-02 Thread lyn2py
Thank you guys, yes you have said my problem very well and the solution has to be websockets. I'm using the one that comes with web2py and have run into some errors with the JavaScript side. I'm sure it is something simple but I can't tell what I do wrong -- --- You received this message bec

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

2013-08-02 Thread szimszon
Could you try setting the logging_level to debug? from gluon.contrib.login_methods.ldap_auth import ldap_auth auth.settings.login_methods.append(ldap_auth(mode='ad', bind_dn='userName', bind_pw='passWord', manage_groups=False, server='serverName', base_dn='ou=OU,ou=OU,dc=DC,dc=DC', lo

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Niphlod
well, given that you're not an expert on javascript events (:-P) I'd use response.js in both the add and the sub functions to trigger the changes in your total field. This is one of the reasons that pushed me to create a new web2py.js (will be available from 2.6.0) , but you need to be comfortab

[web2py] onvalidate fails with compute=lambda field

2013-08-02 Thread Mika Sjöman
hi Got this field, to make sure that a booking is unique. Field('booking_hash', unique=True, compute=lambda r: make_secure_val(str(r['bo_teacher_id']) + str(r['bo_lesson_date']) + str(r['bo_start_lesson_time'])+ str(r['bo_student_id']) )), Instead of getting an error poping up saying the reco

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Marco Prosperi
I've started from the PosOnLine demo appliance. There with the 'add' and 'sub' buttons you can change the quantity of the products you want to buy, but there is no total. I've tried to add a total in the view so that when the the customer 'adds' a product both the quantity and the total changes

[web2py] Re: ajax() infinite loop

2013-08-02 Thread Niphlod
uhm. the change event must be hooked to an input that changes, not to a piece of the page ... let me understand: you have a page with a total that needs to be refreshed via ajax after having submitted with ajax the "add" or the "sub" function ? On Friday, August 2, 2013 12:45:17 AM UTC+2, Marco

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

2013-08-02 Thread Niphlod
is it an aesthetic request or something doesn't work ? if you loaded the grid with a .load extension, pagination links needs to have .load as well else when you change the page it will load in the fragment the whole layout.html again, and that's probably something you don't want On Friday,

[web2py] Re: Force reload from another page

2013-08-02 Thread Niphlod
@massimo suggested the best possible implementation, because without websockets you can't "push" any event to the boss computer. However, if the B boss doesn't need an instant update (i.e. can wait a few seconds between the A submit and B's browser reloading the page ) you can hook up in B's pa

[web2py] Re: Quick contract job

2013-08-02 Thread Massimo Di Pierro
:-) On Thursday, 1 August 2013 12:17:20 UTC-5, davedigerati wrote: > > 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 proj

[web2py] Re: crud permissions

2013-08-02 Thread Massimo Di Pierro
The problem is that you never give the current use the permission to create. You only run this line auth.add_permission(group_id, 'create', db.contacts) after the call to create. You need to call it once before, or create the permission via appadmin. This is fine but I want to point out that

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

2013-08-02 Thread Massimo Di Pierro
Folks here are the best. For start we tend to be nice to and respectful of people who use other frameworks and we try to learn from them to improve ours. On Thursday, 1 August 2013 20:20:48 UTC-5, Jake Angulo wrote: > > > Hi Massimo, > > It worked like a charm! > I changed your code a bit to fit

[web2py] Re: Force reload from another page

2013-08-02 Thread Massimo Di Pierro
You want an event on the server (form submit) trigger an event in the client (reload a page). This is not how http work. It cannot be done with http. It must be done using websockets. I.e. Both pages must open a web socket (using for example gluon/contrib/websocket_messaging.py) and the server

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

2013-08-02 Thread Massimo Di Pierro
Our policy is that request.env is just the wsgi environment, without computed variables. Perhaps this? if not request.env.content_type and request.env.http_content_type: request.content_type = request.env.http_content_type else: request.content_type = request.http_content_type On Thur