[web2py] NEWINSTALL not working

2012-12-15 Thread Ron McOuat
I did a clean install and ran it as python web2py.py and the NEWINSTALL file remained and welcome.w2p was not created. On Ubuntu 12.04 web2py 2.3.1 Ron --

[web2py] Re: LOAD() and response.js - characters being escaped??

2012-12-15 Thread Brian M
I'm also noticing that my response.flash is getting escaped as well, so everything reads as Some%20flash%20message :( On Saturday, December 15, 2012 10:56:07 PM UTC-6, Brian M wrote: > > So I'm finally getting around to moving from web2py v1.99.4 up to trunk. > Everything seems to be working pre

[web2py] LOAD() and response.js - characters being escaped??

2012-12-15 Thread Brian M
So I'm finally getting around to moving from web2py v1.99.4 up to trunk. Everything seems to be working pretty well except some javascript stuff within LOAD(). I've got a couple of forms pulled in by LOAD(, ajax=True) and when submitted and processed they return instructions via response.j

Re: [web2py] Re: Graph Model (proposal to contribute)

2012-12-15 Thread Ovidio Marinho
Very Well Jose. Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9336 3782 - Claro Brasil 201

Re: [web2py] raspberry pi

2012-12-15 Thread Adnan Smajlovic
brings fantastic memories of early days with zx80 sinclair spectrum, changing eprom for it, building cb radio stations, mono block amplifiers, and so on :) hopefully kids jump on this, and spend some good times programming... On Sat, Dec 15, 2012 at 11:01 AM, Andrew W wrote: > I just bought one

[web2py] Re: Graph Model (proposal to contribute)

2012-12-15 Thread Jose
new patch with small changes Jose -- --- /home/jose/trabajos/dbfw2p/web2py/applications/welcome/controllers/appadmin.py 2012-12-03 23:40:06.0 -0300 +++ /home/jose/trabajos/dbfw2p/web2py/applications/modelografico/controllers/appadmin.py 2012-12-15 21:00:41.0 -0300 @@ -460,3 +4

[web2py] custom form validation doesn't work

2012-12-15 Thread jonas
Hi. I have a default form that is passed in view: {{=form}} using this validation and insertion works. but when I use a custom form none of that works. why? Also form.process().accepted works only when using default form. My second question is: when submitting the form I redirect to index, and

[web2py] Re: Query results from 2 children tables from same parent ordered by date

2012-12-15 Thread Massimo Di Pierro
On Saturday, December 15, 2012 2:04:28 PM UTC-6, Mamisoa Andriantafika wrote: > > Thank you for your answer. > > What do you mean by: > 1) too many records: I have about 1k per dataset > I mean the sorting I suggested is performed in ram, in Python. If that is not slow than ok. > 2) databas

[web2py] Re: Query results from 2 children tables from same parent ordered by date

2012-12-15 Thread Mamisoa Andriantafika
Thank you for your answer. What do you mean by: 1) too many records: I have about 1k per dataset 2) database view? Le samedi 15 décembre 2012 20:23:44 UTC+1, Massimo Di Pierro a écrit : > > If you have lots of records you may be able to do it with a database view > but that may be db specific.

Re: [web2py] Interesting - Brython (python to javascript)

2012-12-15 Thread Massimo Di Pierro
Taking a second look at brython. I think we should include it. On Saturday, 15 December 2012 13:01:16 UTC-6, Mariano Reingart wrote: > > Brython seems great, it even uses a html helper syntax like web2py! > > > t = TABLE() > for i in range(10): > t <= TR(TD(i)+TD(i*i)) > doc <= t > >

Re: [web2py] Interesting - Brython (python to javascript)

2012-12-15 Thread Massimo Di Pierro
I was thinking the same. The issue, do we want the conversion done client-side (like brython) or server side (like ocl, https://github.com/mdipierro/ocl#convert-python-code-into-javascript-code) I'd prefer brython if it is fast. Massimo On Saturday, 15 December 2012 13:01:16 UTC-6, Mariano Rei

[web2py] Re: Add button to form & access from view

2012-12-15 Thread Massimo Di Pierro
{{=A('delete 123',callback=URL('delete',args=123),delete='#row123')}} ... The delete argument indicates that upon success you want to remove the ... from the page. If there is a "delete" argument the confirmation popup is automatic. ;-) On Saturday, 15 December 2012 11:35:28 UTC-6, Danie

Re: [web2py] Re: Auth.wiki() classes in tags

2012-12-15 Thread Massimo Di Pierro
In default MAKRMIN mode you can create blocks with classes with ``hello``:classname (standard markmin class) To switch from markmin to HTML you do: auth.wiki(render='html') (assuming you don't have data already in db) Then if you have a wysiwyg plugin you just attach it to the textarea. Fo

[web2py] Re: Query results from 2 children tables from same parent ordered by date

2012-12-15 Thread Massimo Di Pierro
If you have lots of records you may be able to do it with a database view but that may be db specific. If you don't have too many records you can do: rows = ( db(db.dataset1).select() | db(db.dataset2).select() ).sort(lambda row: row.date) On Saturday, 15 December 2012 08:43:35 UTC-6, Mamiso

Re: [web2py] Re: lot's of X's in error responses

2012-12-15 Thread Massimo Di Pierro
If no objection I will remove those. On Saturday, 15 December 2012 08:12:24 UTC-6, Niphlod wrote: > > nope. I'm +1 on all the line "remove those characters". > My point was to eliminate that from http alltogether, or (but it will > require more checks) remove that from restful AND @service calls.

[web2py] Re: Upload file from bash script

2012-12-15 Thread Massimo Di Pierro
auth.settings.allow_basic_login = True db.define_table('test',Field('storedfilename','upload')) @auth.requires_login() def upload(): return db.test.insert(storedfilename = db.test.storedfilename.store(request.body, filename=request.args(0)) curl -X POST -d @localfilename http://user:pass@m

[web2py] Query results from 2 children tables from same parent ordered by date

2012-12-15 Thread Mamisoa Andriantafika
Hi, I have this db model: db.define_table('patients', Field('name', 'string', length=32), Field('firstname', 'string', length=32), Field('dob', 'date'), format='%(name)s') db.define_table('dataset1', Field('date', 'date', length=32), Field('param1', 'string', length=50),

[web2py] NEWINSTALL not working

2012-12-15 Thread Andrew W
Hi, Trying to get an updated welcome.w2p file. I've added a NEWINSTALL file (which usually works), but not today ! The last time it worked successfully was 18 Nov. Anyone else getting this ? --

Re: [web2py] many things break with multiple controllers

2012-12-15 Thread Mariano Reingart
You should not have problems with multiple controllers (I also worked in splitting large controllers without issues). Can you send a minimal but complete app to reproduce this issue? What version of python are you using? Are you using T()? Are you compiling your app? Best regards Mariano Reingar

[web2py] Re: Add button to form & access from view

2012-12-15 Thread Daniele
I want to do something very simple but it's taking me eons to do this~ When the button is clicked, I want a javascript alert to pop up that asks, are you sure? Yes/No. If Yes, then run this code: auth.del_membership('role') No redirection, just delete the role. That's all -_- this is taking me w

Re: [web2py] Re: Auth.wiki() classes in tags

2012-12-15 Thread Andrew W
On developers forum, Massimo mentioned: > auth.wiki() supports html tags (float divs, tables, image uploading, etc.)? "yes. " How do I enter a generic tag like a div with a class? Also, "Notice that auth.wiki() can use wysiwyg if you simply set it up that way and including an appropriate js

[web2py] Re: Not simple to use multiple controller files

2012-12-15 Thread Lewis
That's nice to know. The auth stuff is very tricky. Is it a class? The one challenge is that I have two controller, each presenting a very different UI. One contains user() and the other contains mini_user(). Mini_user creates it's own custom form. Use() simply returns dict(form = auth()).

Re: [web2py] response.view being ignored

2012-12-15 Thread Jonathan Lundell
On 15 Dec 2012, at 8:34 AM, Lewis wrote: > I put response.view at the top of the offending action and it worked. > Previously, I always put response.view = right before the return statement to > make clear what view would be used with the returned dict. > > In this action, there was a redire

Re: [web2py] response.view being ignored

2012-12-15 Thread Lewis
I put response.view at the top of the offending action and it worked. Previously, I always put response.view = right before the return statement to make clear what view would be used with the returned dict. In this action, there was a redirect prior to the appearance of response.view= and th

[web2py] Re: Graph Model (proposal to contribute)

2012-12-15 Thread Jose
El sábado, 15 de diciembre de 2012 13:23:30 UTC-3, Massimo Di Pierro escribió: > > Thank you! I will look at this asap. > > please use this latest patch -- --- /home/jose/web2py/applications/welcome/controllers/appadmin.py 2012-11-25 09:32:54.0 -0300 +++ /home/jose/trabajos/dbfw2p/

[web2py] Re: Graph Model (proposal to contribute)

2012-12-15 Thread Massimo Di Pierro
Thank you! I will look at this asap. On Saturday, 15 December 2012 09:58:19 UTC-6, Jose wrote: > > > > El sábado, 15 de diciembre de 2012 12:29:27 UTC-3, Massimo Di Pierro > escribió: >> >> Did you code this already? Can you send the code. I like it a lot. > > > Hi Massimo, > > Lack control if in

[web2py] Re: Python keywords in db Field names

2012-12-15 Thread Kurt Grutzmacher
True, I was just hoping there was a way DAL could use an "alias" for the field name so we could do db.table.password but the Field() would actually reference the "pass" field in the table. Seems like an odd corner case that I'll have to work around with using executesql instead of full DAL abst

Re: [web2py] raspberry pi

2012-12-15 Thread Andrew W
I just bought one with the goal that its a clever "toy" that the kids to learn and have some fun at the same time, --

[web2py] Re: Graph Model (proposal to contribute)

2012-12-15 Thread Jose
El sábado, 15 de diciembre de 2012 12:29:27 UTC-3, Massimo Di Pierro escribió: > > Did you code this already? Can you send the code. I like it a lot. Hi Massimo, Lack control if installed pygraphviz! [design.html.patch] -> in admin [appadmin.html.patch] -> in welcome [appadmin.py.patch] ->

[web2py] Re: Add button to form & access from view

2012-12-15 Thread Massimo Di Pierro
None. You are asking to ":eval" the result. It meas the action is supposed to return JS def test(): return "alert('hello')" anyway, you should debug this with the JS console in chrome. We do not know exactly how your code looks like. On Saturday, 15 December 2012 09:08:37 UTC-6, Daniele wr

[web2py] Re: Python keywords in db Field names

2012-12-15 Thread Massimo Di Pierro
pass is a python keyword. You would would not be able to do db.table.pass: >>> class A(object): pass ... >>> a=A() >>> a.pass File "", line 1 a.pass ^ SyntaxError: invalid syntax On Saturday, 15 December 2012 08:51:28 UTC-6, Kurt Grutzmacher wrote: > > Ok. > > I want to utilize

[web2py] Re: Graph Model (proposal to contribute)

2012-12-15 Thread Massimo Di Pierro
Did you code this already? Can you send the code. I like it a lot. On Saturday, 15 December 2012 08:49:48 UTC-6, Jose wrote: > > Hi > > I modified the admin and welcome, to allow create a model graph. > > >

Re: [web2py] response.view being ignored

2012-12-15 Thread Jonathan Lundell
On 14 Dec 2012, at 7:02 PM, Lewis wrote: > In one action, I generate the following link for the user to edit an item: > > A('edit', > _href=URL('edit_joke', > vars=dict(id=joke.joke.id, > backto=self.request.controller + '/' + sel

[web2py] Re: Add button to form & access from view

2012-12-15 Thread Daniele
I am trying with: {{=A('Delete Role', _class="btn btn-danger", _id="del_role_tutor", callback=URL('test'), target=":eval")}} and in my controller: def test(): return "Hello" or def test(): return dict() but nothing happens. Why is this?? On Monday, December 10, 2012 9:15:30 PM UTC,

[web2py] Re: Add button to form & access from view

2012-12-15 Thread Daniele
Please pardon my ignorance, I didn't know there was a button helper. And thanks Massimo, I'll give the A with the class btn a try now! On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote: > > When I use form.add_button() I am able to add a button to a form, which I > can display with {{=f

[web2py] Re: Python keywords in db Field names

2012-12-15 Thread Kurt Grutzmacher
Ok. I want to utilize DAL to read data from a database, build forms, grid, tables, etc. One of the tables looks like this: db.define_table('credentials', Field('id', type='id'), Field('user', type='string'), Field('pass', type='string'), ) The 'pass' field does not pass the REGEX_PYTHON_K

[web2py] Graph Model (proposal to contribute)

2012-12-15 Thread Jose
Hi I modified the admin and welcome, to allow create a model graph. The click in button "grahp model" shows something like:

[web2py] many things break with multiple controllers

2012-12-15 Thread Lewis
Spending hours debugging new errors after splitting a big controller into two files. It seems like web2py is not robust with multiple controllers in a single applications. Suddenly, Python thinks that I can't use the format method on a string. In a form to edit categories, a user can press a s

[web2py] html comments in view not being ignored in {{if ... }} block

2012-12-15 Thread Lewis
I have this in a template: {{if response.menu:}} {{='auth' in globals() and auth.navbar(action='user',separators=(' ',' | ',''))}} {{is_mobile=request.user_agent().is_mobile}} {{=MENU(response.menu, _class='mobile-menu' i

[web2py] response.view being ignored

2012-12-15 Thread Lewis
In one action, I generate the following link for the user to edit an item: A('edit', _href=URL('edit_joke', vars=dict(id=joke.joke.id, backto=self.request.controller + '/' + self.request.function,

[web2py] Upload file from bash script

2012-12-15 Thread Alfonso Pastor Sierra
Hi, I want upload a file to a "upload" field in a table automatically, sending the file from a bash script using wget. How can I do it?. Thanks --

[web2py] Interesting - Brython (python to javascript)

2012-12-15 Thread ionel
http://www.brython.info/index_en.html --

[web2py] Re: Add button to form & access from view

2012-12-15 Thread Massimo Di Pierro
As NIphlod says there is a BUTTON helper. Yet instead of Delete Role I would do: {{=A('Delete Role', _id="b_normal", _class="btn btn-danger", callback=URL('test'), target=':eval')}} which will look the same. Why use BUTTON when you can use A with class "btn" and works the same? On S

[web2py] Re: Prevent calling compute when doing an update

2012-12-15 Thread Massimo Di Pierro
You can set db.table.field.compute = lambda: only in the actions that need it. On Saturday, 15 December 2012 04:26:33 UTC-6, Daniel Gonzalez wrote: > > Hi, > > I am implementing a password update feature. I am doing something like > this: > > def change_pass(email, new_pass): > my_que

Re: [web2py] raspberry pi

2012-12-15 Thread Massimo Di Pierro
This is good to know. I should get one. On Friday, 14 December 2012 20:44:48 UTC-6, wwwgong wrote: > > yes, I bought a 512MB Raspberry Pi for $35 as a gift to my kid 2 weeks ago. > > In less than 5 mins, I am able to run web2py (v2.3.1) on this tiny and > cheap platform. > installed 2 of my apps,

[web2py] Re: Not simple to use multiple controller files

2012-12-15 Thread Massimo Di Pierro
You are trying to solve the problem in the wrong way. You just need to tell auth where the user action is. auth assumes: auth = Auth(db, controller='default') you need to change this if you move "def user(): ..." in a different controller. Then {{=auth.navbar()}} will work. On Friday, 14 Dece

Re: [web2py] Re: Auth.wiki() documentation

2012-12-15 Thread Massimo Di Pierro
I can do that. On Friday, 14 December 2012 19:24:26 UTC-6, Alan Etkin wrote: > > > El viernes, 14 de diciembre de 2012 13:00:37 UTC-3, Massimo Di Pierro > escribió:Thanks. Can I use it for the book? > > Of course, but it would need some rewriting to fit with the book style > (and perhaps a more

Re: [web2py] Re: lot's of X's in error responses

2012-12-15 Thread Niphlod
nope. I'm +1 on all the line "remove those characters". My point was to eliminate that from http alltogether, or (but it will require more checks) remove that from restful AND @service calls. On Saturday, December 15, 2012 12:50:17 AM UTC+1, howesc wrote: > > is anybody using request.restful *and

[web2py] Re: Python keywords in db Field names

2012-12-15 Thread Niphlod
tell us more about what you're trying to do, and the model, also if throws errors, that are you willing to use On Saturday, December 15, 2012 3:23:23 AM UTC+1, Kurt Grutzmacher wrote: > > I need to access a static third-party data source that uses some Python > keywords in the Field name. Th

[web2py] Re: Add button to form & access from view

2012-12-15 Thread Niphlod
Don't take it in the wrong way, I'll start with a little introduction: web2py is a framework that can do a lot of stuff. When it generates an HTML page the way you told him so, it returns it to the browser. From then on, it's just how HTML works: any button (without javascript intercepting the

[web2py] Re: Add button to form & access from view

2012-12-15 Thread Daniele
I tried putting this HTML Delete Role which I saw on a stackoverflow post. However, even when I do that and click the button, the form ALWAYS gets submitted. I already have a submit button so I don't understand why the form is being submitted via other buttons as well. Does anyone know why this

[web2py] Re: Add button to form & access from view

2012-12-15 Thread Daniele
It's quite pathetic that web2py doesn't provide a BUTTON helper by the way... On Monday, December 10, 2012 9:15:30 PM UTC, Daniele wrote: > > When I use form.add_button() I am able to add a button to a form, which I > can display with {{=form}} in my view. > > However, if I'm making a custom for

[web2py] Prevent calling compute when doing an update

2012-12-15 Thread Daniel Gonzalez
Hi, I am implementing a password update feature. I am doing something like this: def change_pass(email, new_pass): my_query = db[auth.settings.table_user_name].email == email my_set = db(my_query) my_set.update(password = new_pass) The problem is that this is calling one of my comp

Re: [web2py] Re: custom form validation

2012-12-15 Thread Jonas Fredriksson
ok. another thing is that if I use a regular form, {{=form}}, then validation works but not if I use the custom form. Also form.process() works, so the problem seems to be related to custom forms. On Sat, Dec 15, 2012 at 4:06 AM, Anthony wrote: >> form=crud.create(db.comments) >> if form.