[web2py] smartgrid, linked tables and columns

2011-09-28 Thread andrej burja
hi i have def person_manage(): columns = ['t_person.id','t_person.f_name','t_oseba.f_surname','t_oseba.f_email'] linked_tables = ['t_message'] form = SQLFORM.smartgrid(db.t_oseba,linked_tables=linked_tables,columns=columns,onupdate=auth.archive) return locals() without columns=

Re: [web2py] Re: Heroku supports Python

2011-09-28 Thread Vasile Ermicioi
quite expensive, my bit

[web2py] Re: password storage with per-user salt

2011-09-28 Thread Massimo Di Pierro
Perhaps the safer bet is to continue along your original idea of tweaking auth. In general it may not be a good idea to have validators access the record before validation, it could cause DoS problems. Massimo On Sep 28, 9:47 pm, Dave wrote: > I struggled with that a little bit as I was followi

[web2py] Re: book version 3.1 online

2011-09-28 Thread Omi Chiba
Massimo, Thank you for the info. Can you send me the markmin files for 3rd (3.0) ? We need to update it with our translation, then work on diff. >or you prefer I can simply link it. We will discuss which one is better. You mean like if language setting for the browser is Japanese, then they are

Re: [web2py] help on routes

2011-09-28 Thread Jonathan Lundell
On Sep 28, 2011, at 9:31 PM, Bruno Rocha wrote: > Ok, now I got it to work with this: > > routers = dict( > # base router > BASE = dict( > default_application = 'pytalks', > default_controller = 'default', > controllers=['appadmin','default'], > application

Re: [web2py] help on routes

2011-09-28 Thread Bruno Rocha
Ok, now I got it to work with this: routers = dict( # base router BASE = dict( default_application = 'pytalks', default_controller = 'default', controllers=['appadmin','default'], applications=['pytalks','admin'], ), ) Thank you

Re: [web2py] help on routes

2011-09-28 Thread Jonathan Lundell
On Sep 28, 2011, at 8:00 PM, Bruno Rocha wrote: > With this setup, I have no access to admin... > > https://pythonbrasil.web2py.com.br/admin/design/pytalks > > This worked before, any change on routes? > > -

Re: [web2py] Re: help on routes

2011-09-28 Thread Bruno Rocha
How can I have this behavior now? I want pythonbrasil.web2py.com.br/index /otherfunction /appadmin but I want to keep admin working...

Re: [web2py] Re: help on routes

2011-09-28 Thread Jonathan Lundell
On Sep 28, 2011, at 9:09 PM, Bruno Rocha wrote: > I am sure something have changed on this, > I used this same setup before and worked well.. > > works here: www.serafimnatural.com.br (web2py 1.82.x) > > but not here: pythonbrasil.web2py.com.br > > --- > default_

[web2py] Re: help on routes

2011-09-28 Thread Bruno Rocha
I am sure something have changed on this, I used this same setup before and worked well.. works here: www.serafimnatural.com.br (web2py 1.82.x) but not here: pythonbrasil.web2py.com.br --- default_application = 'init'# ordinarily set in base routes.py default_

Re: [web2py] help on routes

2011-09-28 Thread Ovidio Marinho
Does it use http://docs.python.org/library/filecmp.html, we can do a version comparison to really know where the code was changed? Ovidio Marinho Falcao Neto ovidio...@gmail.com 83 8826 9088 - Oi 83 9334 0266 - Claro Paraiba-

[web2py] Subdomain based on blog users in routes.py

2011-09-28 Thread Farsheed Ashouri
Hi everyone, I have a blog system and I need a pages like: mysite.com/myappName/pages/blog?u=user1 map to something like this: user1.mysite.com I've read many posts here, the book and other resources i idea how this regexpr thing works. Could you please show me *exactly* how this example works i

[web2py] help on routes

2011-09-28 Thread Bruno Rocha
With this setup, I have no access to admin... https://pythonbrasil.web2py.com.br/admin/design/pytalks This worked before, any change on routes? default_application = 'pytalks'# ordinarily set

[web2py] Re: password storage with per-user salt

2011-09-28 Thread Dave
I struggled with that a little bit as I was following the application flow particularly in the login method. All the other methods (well, except the reset request method) are after login and there is already a user object. That's why it was so easy for me to just put onvalidate modifications in t

[web2py] Re: What is the recommended method for retrieving a file which was uploaded manually via SQLFORM.factory?

2011-09-28 Thread TheSweetlink
Awesome, thank you pbreit. I cannot get over helpful this community is. -David On Sep 28, 9:01 pm, pbreit wrote: > I store my images in a different folder and serve them directly: > >     Field('image', 'upload', uploadfolder=request.folder+'static/uploads', >             requires=IS_EMPTY_OR(I

[web2py] Re: Adding hidden field to a form

2011-09-28 Thread Anthony
I think the 'hidden' argument goes inside FORM() -- looks like you've got it inside DIV(). Anthony On Wednesday, September 28, 2011 10:14:40 PM UTC-4, Joseph Jude wrote: > > Hi, > I define the below form in controller but the hidden field is not present > in the view. Note that, field 'totalite

[web2py] Adding hidden field to a form

2011-09-28 Thread Joseph Jude
Hi, I define the below form in controller but the hidden field is not present in the view. Note that, field 'totalitems' is not in the db. Let me know how to add hidden fields to FORM. form = FORM( DIV( LABEL("Checklist Items:"), UL( SPAN(INPUT(_type="text", _name="citems"), IMG(_class="add", _

[web2py] Re: password storage with per-user salt

2011-09-28 Thread Massimo Di Pierro
Anyway, I have not looked into this with sufficient detail to know what is cleaner (or dirtier). I we pass an optional record argument to validate we will need to change sqlhtml as well. Massimo On Sep 28, 8:11 pm, Dave wrote: > That may be an even better way to accomplish this task.  I actually

Re: [web2py] Re: GAE - DAL problem

2011-09-28 Thread Felixdm || Augusto Félix Dal Mas
=D I fix it Now I'm using role no more description tid = db.auth_group(role='Teacher').id http://imageshack.us/f/28/screenshot1gvq.png/ But i dont know how select description any way or if the problem was the read/write property of description http://imageshack.us/f/51/screenshot2uy.png/ On Wed

[web2py] Re: password storage with per-user salt

2011-09-28 Thread Dave
That may be an even better way to accomplish this task. I actually considered using some sort of self-reference first, but didn't find it there. On Sep 28, 9:00 pm, Massimo Di Pierro wrote: > I was thinking about this... how about editing the validate function > in dal.py and allow it to pas

[web2py] Re: What is the recommended method for retrieving a file which was uploaded manually via SQLFORM.factory?

2011-09-28 Thread pbreit
I store my images in a different folder and serve them directly: Field('image', 'upload', uploadfolder=request.folder+'static/uploads', requires=IS_EMPTY_OR(IS_IMAGE())),

[web2py] Re: password storage with per-user salt

2011-09-28 Thread Massimo Di Pierro
I was thinking about this... how about editing the validate function in dal.py and allow it to pass the current record to the validators? We cannot change the APIs but a validator is an object so we can just pass the current record by attaching it as an attribute to the validator object. CRYPT coul

[web2py] Re: What is the recommended method for retrieving a file which was uploaded manually via SQLFORM.factory?

2011-09-28 Thread TheSweetlink
Thanks to Carlos Galindo for the tip. He helped me earlier today. "I am not using web2py's auth to download the uploaded files, I just reference them directly with URL('static', 'myfolder/' + uploadfieldvalue) ... where uploadfieldvalue is the uploaded file name stored in the field." I believe h

[web2py] Re: set initial dropdown selection

2011-09-28 Thread Anthony
Maybe use server-side DOM parsing: http://web2py.com/book/default/chapter/05#Server-side-DOM-and-Parsing Something like: form.element('option', _value='value')['_selected'] = 'selected' or: form.element('select').update(value='value') # adding the 'value' attribute to SELECT causes that opti

[web2py] Re: What is the recommended method for retrieving a file which was uploaded manually via SQLFORM.factory?

2011-09-28 Thread TheSweetlink
Hi Massimo! It is not my intention to bypass anything as I'd prefer you experts to do the framework business. Rather, I wish to know what the best course of action would be. I cannot retrieve a file which was uploaded using SQLFORM.factory My SQLFORM.factory renames and places my file on the fi

[web2py] set initial dropdown selection

2011-09-28 Thread Ed Greenberg
I've tried and tried, but can't find a google search term that answers this. I have a FORM(), not a SQLFORM(), with a SELECT and a bunch of options in it, and I need to set the _selected attribute on one of them. When I construct the SELECT, I don't know which one needs to be selected until late

[web2py] Re: book version 3.1 online

2011-09-28 Thread mikech
Time to donate again.

[web2py] Re: password storage with per-user salt

2011-09-28 Thread Dave
I've made this work. I still need a little bit of time to make it backward compatible with non-salted passwords though. First things first, I had to disable the CRYPT validator. Although it makes handling passwords easier, encrypting them at the validator level really limits a lot of account enf

[web2py] Re: What is the recommended method for retrieving a file which was uploaded manually via SQLFORM.factory?

2011-09-28 Thread Massimo Di Pierro
Before we get into this discussion. Why are you bypassing the normal mechanism? Massimo On Sep 28, 5:51 pm, TheSweetlink wrote: > SQLFORM.factory renames and uploads my file to uploads/ dir via > store() in dal.py  great. > > In form.accepts (will refactor code to use .process() soon) I store >

[web2py] Re: Heroku supports Python

2011-09-28 Thread Massimo Di Pierro
They do not have a writable file system. It is not clear to me what are the implications for web2py. I would be great if you could give it a try. pip is supposed to work. On Sep 28, 5:20 pm, pbreit wrote: > Uses Pip to install dependencies. Our pip install is ready to go, right? > Looks like it's

[web2py] Re: book version 3.1 online

2011-09-28 Thread Massimo Di Pierro
As soon as I announce the book 4th ed. please ask me a I will send you a diff so you can translate the diffs. If you send me the translated book as makrmin files (one per chapter) I can post it on web2py.com/book or you prefer I can simply link it. On Sep 28, 2:03 pm, Omi Chiba wrote: > Massimo,

[web2py] Re: GAE - DAL problem

2011-09-28 Thread Massimo Di Pierro
This does not prove that you have a record auth_group with description='Teacher'. Perhaps your record has description='Teacher \n'?

[web2py] Re: Dynamic Model

2011-09-28 Thread Andrew
Exactly Jose, That is what I'm doing for one app. The Table, and Fields are defined in metadata. On Sep 29, 11:31 am, Jose wrote: > http://groups.google.com/group/web2py/browse_thread/thread/99cd6e8d11...

[web2py] What is the recommended method for retrieving a file which was uploaded manually via SQLFORM.factory?

2011-09-28 Thread TheSweetlink
SQLFORM.factory renames and uploads my file to uploads/ dir via store() in dal.py great. In form.accepts (will refactor code to use .process() soon) I store the new filename in a currently unsupported db. What is the safe/proper/best way to retrieve my file? I know the renamed filename but sinc

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Phyo Arkar
Cool thanks alot i will look into it too . Try nginx or cherokee as http server then scgi. We using that type of configuration in production with at least 180K json requests a day and very complex business logic with high concurrency. scgi is not much tunable but is really simple: on a machine li

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Phyo Arkar
I really hate apache i will never use it. So if i am going to change underlying web engine i want something that support long polling with concurrency , how about tornado web ? would it be good On Thu, Sep 29, 2011 at 4:59 AM, Michele Comitini < michele.comit...@gmail.com> wrote: > I wrote: > >

[web2py] Re: Dynamic Model

2011-09-28 Thread Jose
http://groups.google.com/group/web2py/browse_thread/thread/99cd6e8d1141336/0670fb6370961c26?lnk=gst&q=meta+Jose#0670fb6370961c26

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Michele Comitini
I wrote: > uwsgi uses many different models.  Using uwsgi a mix of event + > prefork could give a big boost, but if you care about performance > avoid apache. > I should have been: uwsgi uses many different models.  Using uwsgi a mix of event + prefork could give a big boost -->and<-- if you care

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Michele Comitini
Ok so your machine really behaves concurrently it could be that you stumbled in some threading problem, probably at db driver level, I am quite confident about rocket, so the next questions are ;-) do you use a database? which database? mod_wsgi is not so bad it is difficult to tune IMHO and doe

[web2py] Re: Heroku supports Python

2011-09-28 Thread pbreit
Uses Pip to install dependencies. Our pip install is ready to go, right? Looks like it's there but version 1.98.2.

Re: [web2py] Dynamic Model

2011-09-28 Thread Phyo Arkar
Couch ? Mongo? I really have to try them , not started yet. On Thu, Sep 29, 2011 at 4:28 AM, pbreit wrote: > NoSQL

Re: [web2py] Dynamic Model

2011-09-28 Thread pbreit
NoSQL

Re: [web2py] Dynamic Model

2011-09-28 Thread Phyo Arkar
Thank you very much for that technique. I will check it. Yeah i also thought about writing schema_0-1-2-3-4.py file for each of the table for each users. But Letting python write its own Python code , wont it introduce security concern :| ? On Thu, Sep 29, 2011 at 4:11 AM, Ismael Serratos wrote:

[web2py] Super Dynamic Memberships

2011-09-28 Thread Ismael Serratos
Hi everybody!! I'm currently working on a really dynamic app.. basically we are trying to automate a lab... Here is the issue, I need to have a fully customizable database... In short a new project is created and a custom model file is written for that project, also I generate two groups in auth_g

[web2py] Heroku supports Python

2011-09-28 Thread Francisco Costa
Today Heroku started to also support Python (they only supported Ruby before): http://blog.heroku.com/archives/2011/9/28/python_and_django/ Who wants to give a try with web2py on it?

Re: [web2py] Dynamic Model

2011-09-28 Thread Ismael Serratos
Hi Phyo!!! I needed almost the same, and I found the EAV Modeling technique (http://en.wikipedia.org/wiki/Entity-attribute-value_model) useful, but due the complexity of my project I write the model as a file, I mean open the *.py, write, append. On Wed, Sep 28, 2011 at 4:31 PM, Phyo Arkar wro

[web2py] Re: book version 3.1 online

2011-09-28 Thread DenesL
Excellent! Thank you. On Sep 28, 9:54 am, Massimo Di Pierro wrote: > I have updated the online book, the content, not the app, with my most > recent edits. > Not everything is documented yet but lot more stuff is. The book is > about 10% bigger already. > When done should be 20-30% bigger than

[web2py] Dynamic Model

2011-09-28 Thread Phyo Arkar
Here is what i was asked for, weird that i haven't see in any application yet. A Dynamic Model : A dynamic table schema. They want a feature to add a column dynamically , for example a table do not have comment field. they want a button to add a new field on the fly and add the data into it. so

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Phyo Arkar
Server machine is 32 cores 64 GB RAM :) WSGI limitation is bad at concurrency right? I am thinking to move to more Concurrent setup. Coz version 1 of this software gonna use Qooxdoo for UI and there will be a lot more concurrency. What are the advantages of uwsgi can use uevent right? On Thu, Se

Re: [web2py] Re: GAE - DAL problem

2011-09-28 Thread Felixdm || Augusto Félix Dal Mas
Ok but if the record exist http://imageshack.us/f/198/dbgroup.png/ only if i do this the problem is fixed if i change for this if request.args(1)=="teacher": username_id = db.auth_user(username=request.vars['username']).id

[web2py] Re: Download of web2py fails

2011-09-28 Thread Massimo Di Pierro
Which link are you looking at? We only download zip files. On Sep 28, 2:56 pm, cvkluka wrote: > Your download link to a Linux-compatible version of web2py takes me > to /tmp/D4veujvc.zip.part, which my laptop doesn't recognize as a > valid file extension. I did some research and Mozilla is suppos

[web2py] Re: GAE - DAL problem

2011-09-28 Thread Massimo Di Pierro
It is not finding the record db.auth_group(description="Teacher") Not sure it is a dal problem, On Sep 28, 2:50 pm, felixdm wrote: > I have this problem in GAE > > Traceback (most recent call last): >   File "/base/data/home/apps/s~book-on/1.353593485285740911/gluon/ > restricted.py", line 194, i

[web2py] Re: How do I get the encoded filename from SQLFORM.factory upload field.

2011-09-28 Thread TheSweetlink
Thank you so much Carlos. How noobtastic of me to not think of that one. -David On Sep 28, 3:03 pm, Carlos wrote: > Hi, > > This occurred to me too, and I had to use the 'table_name' argument in the > SQLFORM that handles the factory. > > I hope this helps. > >    Carlos

Re: [web2py] Re: Enable request_reset_password

2011-09-28 Thread Kenneth Lundström
Yes, a couple of rows before that I have mail=Mail(). But now I found it. I have splitted db.py into four different files. For some strange reason I had auth=Auth(globals(),db) twice, I removed the second one and now everything works. Thanks to everyone helping me. Kenneth Have you confir

[web2py] Download of web2py fails

2011-09-28 Thread cvkluka
Your download link to a Linux-compatible version of web2py takes me to /tmp/D4veujvc.zip.part, which my laptop doesn't recognize as a valid file extension. I did some research and Mozilla is supposed to recognize this file type I think, perhaps I'll need to reconfigure it somehow. But in my experi

[web2py] GAE - DAL problem

2011-09-28 Thread felixdm
I have this problem in GAE Traceback (most recent call last): File "/base/data/home/apps/s~book-on/1.353593485285740911/gluon/ restricted.py", line 194, in restricted exec ccode in environment File "/base/data/home/apps/s~book-on/1.353593485285740911/ applications/bookon/controllers/defaul

Re: [web2py] Re: PyCon Brasil app - help me test it

2011-09-28 Thread Richard Vézina
Hello Bruno, Pretty nice and clean... I notice one thing in light talk : http://labs.blouweb.com/pytalks/default/light When user need to be logged to accomplish the works, maybe he could be redirect to the login page?? Richard On Wed, Sep 28, 2011 at 6:14 AM, David Marko wrote: > Looks very

[web2py] SQLFORM.grid Errors With Latest Commit

2011-09-28 Thread Ross Peoples
The following commit has caused an error when columns/fields are not specified: http://code.google.com/p/web2py/source/detail?r=48e6f24a4ed36bb35bcd3f37e9ebc955dc9868a1 I have been trying to figure out where this error has been coming from and finally narrowed it down. Here is the code I have b

[web2py] Re: How do I get the encoded filename from SQLFORM.factory upload field.

2011-09-28 Thread Carlos
Hi, This occurred to me too, and I had to use the 'table_name' argument in the SQLFORM that handles the factory. I hope this helps. Carlos

[web2py] Re: book version 3.1 online

2011-09-28 Thread Omi Chiba
Massimo, web2py Japan finished the tranlation for ver 3.0 at the following site. https://sites.google.com/site/web2pyjapan/book/01 Editing to (ja) is disabled now and we're kind of waiting. Now, I'm confused how we proceed it. What the best way to do the translation work ? 1. Wait for the 4th e

[web2py] Re: How do I get the encoded filename from SQLFORM.factory upload field.

2011-09-28 Thread TheSweetlink
A different but related problem. Now that I have the file on the filesystem with the nice web2py renaming to prevent directory traversal attack, I cannot use the default download function to download my newly uploaded file. ('no_table') This is because I'm using SQLFORM.factory and dal.py store(

Re: [web2py] book version 3.1 online

2011-09-28 Thread Ovidio Marinho
ok Ovidio Marinho Falcao Neto ovidio...@gmail.com 83 8826 9088 - Oi 83 9334 0266 - Claro Paraiba-Brasil 2011/9/28 Massimo Di Pierro > I have updated the online book, the content, not the app, with my most > recent edits.

[web2py] Re: smartgrid: currency format

2011-09-28 Thread Omi Chiba
Oh it worked !! My smartgrid looks so smart !!! On Sep 28, 12:07 pm, Massimiliano wrote: > This one should work... > > db.Product.List_Price.represent = lambda value, row: DIV('€ %.2f' % (0.0 > if value == None else value), _style='text-align: right;') > > > > > > > > > > On Wed, Sep 28, 2011 a

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Michele Comitini
Can you try with a setup without rocket? I.e. scgi or uwsgi or fastcgi. Is the server machine multicore? mic Il giorno 28/set/2011 18:48, "Phyo Arkar" ha scritto: > Happened once again > > THis time 1st json request went ok and another request failed like it > did before. > > On 9/28/11, Phyo A

[web2py] out topic antipattern db design question

2011-09-28 Thread Richard
Hello, I had to fix a old model design flaw. The old schema implies multiple FK that are nullable depending of the context... I would use the "base parent table" antipattern that Bill Karwin is proposing to normalised db and keep referential integrity... I would like to know what you think about

[web2py] Re: TinyMCE

2011-09-28 Thread juanduke
Hi: Are you importing the required files? Load your view in firefox, and check if firebug show some error loading the required files or maybe is coding typo. Then show us the code you use it. HTH, Bye

[web2py] issues with multiple grids on a page

2011-09-28 Thread apple
A couple of issues with the new grid. In particular I have a page that includes a "customer" form and multiple grids on the same page: 1) Clear buttons for each list clears the first search box on the page. 2) Add button passes the table name but not the other args. I want to pass the customerid

[web2py] Re: How do I get the encoded filename from SQLFORM.factory upload field.

2011-09-28 Thread TheSweetlink
Got it! My problem was using request.vars.bridgetroll.filename when I should have used form.vars.bridgetroll_newfilename Will read more carefully next time. -David

Re: [web2py] Re: smartgrid: currency format

2011-09-28 Thread Massimiliano
This one should work... db.Product.List_Price.represent = lambda value, row: DIV('€ %.2f' % (0.0 if value == None else value), _style='text-align: right;') On Wed, Sep 28, 2011 at 6:26 PM, Omi Chiba wrote: > It's smartgrid so nothing really in default.py. > > just this one. > > def admin(): >

[web2py] Re: Fast CGI

2011-09-28 Thread Omi Chiba
Michele, Thank you for the info but it's kind of hard to follow because I use IIS 7.5 and also I'm not sure if we should point c:\web2py for local path (If it's the place we have web2py source version.) I appreciate if you have step by step guide somewhere. On Sep 27, 5:36 pm, Michele Comitini

Re: [web2py] Re: Never happened before Rocket errors come up. version 1.98.2

2011-09-28 Thread Phyo Arkar
Happened once again THis time 1st json request went ok and another request failed like it did before. On 9/28/11, Phyo Arkar wrote: > Yeah i love screen coz i can search back easily and interactively debug > infos. > > Yes its doing concurrent , the problem happen again yesterday but just > for

[web2py] Modal form window

2011-09-28 Thread Vineet
My question is regarding displaying modal window (jquery-ui) After clicking a link in table row, the modal window appears momentarily & vanishes. Code in View--- {{extend 'layout.html'}} Department Master Department ID Department Name Link {{for department in departments:}}

[web2py] Re: How do I get the encoded filename from SQLFORM.factory upload field.

2011-09-28 Thread TheSweetlink
I spoke too soon. SQLFORM.factory is doing the proper renaming and uploading of the file to the filesystem but I still cannot get the new filename no_table.sirgallahad.823497htn7crh743uo5e4.ext I can only retrieve the original filename with no path a la request.vars.sirgallahad.filename After se

[web2py] Re: smartgrid: currency format

2011-09-28 Thread Omi Chiba
It's smartgrid so nothing really in default.py. just this one. def admin(): products = SQLFORM.grid(db.Product,deletable=False, paginate=10) return dict(products = products) This is my table. db.define_table('Product', Field('Part_Number'), Field('List_Price', 'decimal(13,2)'))

[web2py] Re: How do I get the encoded filename from SQLFORM.factory upload field.

2011-09-28 Thread TheSweetlink
Please disregard and forgive the list spam. I adapted some of the file renaming code from store() in dal.py to manually rename the file and everything worked out. Thanks Massimo and contributers once again for the amazing code we all benefit from. -David

[web2py] Re: suggestion re folders in web2py

2011-09-28 Thread pbreit
As has been suggested, updating those files can be tricky and is best left to the developer to figure out the best approach. If you want to consolidate non-web2py files, how about a "project" (or whatever name) directory in "static"?

Re: [web2py] Re: smartgrid: currency format

2011-09-28 Thread Jim Steil
Can you post the relevant code from default.py? -Jim On 9/28/2011 11:02 AM, Omi Chiba wrote: Jim, close but I got a following error. Traceback (most recent call last): File "/home/www-data/web2py/gluon/restricted.py", line 194, in restricted exec ccode in environment File "/hom

[web2py] Re: smartgrid: currency format

2011-09-28 Thread Omi Chiba
Jim, close but I got a following error. Traceback (most recent call last): File "/home/www-data/web2py/gluon/restricted.py", line 194, in restricted exec ccode in environment File "/home/www-data/web2py/applications/pricelist/controllers/ default.py", line 95, in @auth.requires_signa

Re: [web2py] Re: smartgrid: currency format

2011-09-28 Thread Jim Steil
untested db.Product.List_Price.represent = lambda value, row: XML(DIV('$ %.2f' % (0.0 if value == None else value),_style='text-align: right;')) On 9/28/2011 10:42 AM, Omi Chiba wrote: Um, actually one more question. Now I have two represent and riht now either one of them work but not both.

Re: [web2py] Re: suggestion re folders in web2py

2011-09-28 Thread Richard Vézina
view/layout.html Is one of the file you don't want to update for sure... ;-) Richard On Wed, Sep 28, 2011 at 12:23 AM, encompass wrote: > They pretty much are. > All your files should be in the applications folder. But there may be > a few exception most you don't have to worry about. At leas

[web2py] Re: smartgrid: currency format

2011-09-28 Thread Omi Chiba
Um, actually one more question. Now I have two represent and riht now either one of them work but not both. How I can combine them together ?? # Currency format db.Product.List_Price.represent = lambda value, row: '$ %.2f' % (0.0 if value == None else value) # text-align: right db.Product.List_Pr

[web2py] Re: smartgrid: currency format

2011-09-28 Thread Omi Chiba
Wow ! This is what I want. Thanks !! On Sep 28, 9:53 am, Massimiliano wrote: > Is there a reason that you want to format on the grid? > >  because you can do it in field.represent: > > db.yourtable.yourfield = lambda value, row: '$ %.2f' % (0.0 if value == None > else value) > > On Wed, Sep 28, 2

Re: [web2py] Re: 1.99 gluon/tools.py replace_id mishandling url [SOLVED]

2011-09-28 Thread Jonathan Lundell
On Sep 28, 2011, at 8:10 AM, Anthony wrote: > I think this is still a bug, though. Shouldn't that have been: @auth.requires_login @requires_session_option def index(): return dict() ? > > On Wednesday, September 28, 2011 10:17:26 AM UTC-4, Jim Karsten wrote: > I found a work around.

[web2py] Re: 1.99 gluon/tools.py replace_id mishandling url [SOLVED]

2011-09-28 Thread Anthony
I think this is still a bug, though. On Wednesday, September 28, 2011 10:17:26 AM UTC-4, Jim Karsten wrote: > > I found a work around. I had two decorators on the index controller > functions. I separated that function into two putting a decorator on each. > > Previously: > @requires_session_op

[web2py] Re: MongoDB supported by DAL

2011-09-28 Thread Samuele Santi
On Aug 8, 3:30 pm, DenesL wrote: > I was, a while back, just before the new dal. > The changes in the dal plus a busier work day conspired to kill the > effort. > > On Aug 7, 1:54 pm, Francisco Costa wrote: > > > Is anyone working on the MongoDBAdapter? Are you planning to resume development? I'

Re: [web2py] smartgrid: currency format

2011-09-28 Thread Massimiliano
Is there a reason that you want to format on the grid? because you can do it in field.represent: db.yourtable.yourfield = lambda value, row: '$ %.2f' % (0.0 if value == None else value) On Wed, Sep 28, 2011 at 4:48 PM, Omi Chiba wrote: > Can we format 500.00 to $500.00 on smartgrid ? --

[web2py] smartgrid: currency format

2011-09-28 Thread Omi Chiba
Can we format 500.00 to $500.00 on smartgrid ?

[web2py] Re: Select values from form and perform db search and display values on different page

2011-09-28 Thread Will
Thanks, that solved the problem, didn't realize i wasn't saving in session, i was trying to transfer by url following examples, so i made following changes to code and now it is transferring values correctly redirect(URL('index',vars ={'bla' :request.vars.color})) def index(): var = request

[web2py] Re: 1.99 gluon/tools.py replace_id mishandling url [SOLVED]

2011-09-28 Thread Jim Karsten
I found a work around. I had two decorators on the index controller functions. I separated that function into two putting a decorator on each. Previously: @requires_session_option @auth.requires_login def index(): return dict() Now: @auth.requires_login def index(): redirect(URL('get_se

[web2py] Re: Select values from form and perform db search and display values on different page

2011-09-28 Thread Anthony
The way you're doing it, when you get to the index() function, 'blah' will be in request.vars.blah, not in session.vars (you never saved anything to the session). If you want it in the session, you'd have to do session.blah = request.vars.color in your formentry() function. Anthony On Wednesda

[web2py] Re: Empty HTML input array issue

2011-09-28 Thread Anthony
That's tricky. You might get ideas from this: https://groups.google.com/d/topic/web2py/UK8NZ1VMlNk/discussion. Maybe others have suggestions. Anthony On Wednesday, September 28, 2011 9:48:16 AM UTC-4, Joseph Jude wrote: > > Thanks Anthony for the reply. > > 1) With your answer, I understand why

[web2py] book version 3.1 online

2011-09-28 Thread Massimo Di Pierro
I have updated the online book, the content, not the app, with my most recent edits. Not everything is documented yet but lot more stuff is. The book is about 10% bigger already. When done should be 20-30% bigger than the 3rd edition. Here is a list of new features that are documented in 3.1 but n

Re: [web2py] Re: Clean up unused string

2011-09-28 Thread Richard Vézina
I think I forgot to mention... Take care if you clear the whole file, you will probably lost your good translation... So maybe make a copy of the file and then you can write a simple script that compare both dict the old one and the new generated dict store into tranlation file than import just t

[web2py] Re: Empty HTML input array issue

2011-09-28 Thread Joseph Jude
Thanks Anthony for the reply. 1) With your answer, I understand why the ['',''] is displayed. But is there a way to change it? 2) [] is appended since I wanted an array. But in the mean-while I experimented without [] and just having 'items' as the variable name for all the three fields and got

[web2py] Re: Select values from form and perform db search and display values on different page

2011-09-28 Thread Will
Thanks for clearing up the displaying unique dropdown value code. Anyone have any thoughts on how to take a select variable and display those values from a table in the new url? For instance I am getting None in the bla variable on the index page. After selecting my form and redirecting there. O

[web2py] Re: smartgrid: can we add field type class on th, td in web2py_table ?

2011-09-28 Thread Omi Chiba
Martin, You know what ? it works ! On Sep 28, 7:33 am, Martín Mulone wrote: > I'm not sure if this work cause I didn't test it, but did you tried with > represent?. > > something like this: > > db.mytable.price.represent = lambda price, row: > XML(DIV(price,_style='text-align: right;')) > >

[web2py] Re: Empty HTML input array issue

2011-09-28 Thread Anthony
You've given the same name to three fields ('item[]'). web2py treats that as one field, so it puts all the values submitted in those fields into a single list to represent the value of the field. When an error is returned, web2py populates the form with the previously submitted values, so it is

Re: [web2py] Re: Clean up unused string

2011-09-28 Thread Thomas Bellembois
That is exactly what I needed ! Thanks a lot. Regards, Thomas Le 27/09/2011 22:52, Richard Vézina a écrit : And since the file is always rebuild... If he wants to clear old stuff he just can earase the entire file if he wants. Also, imagine you want to keep some translation into DB... You ca

[web2py] TinyMCE

2011-09-28 Thread Philip Kilner
Hi All, Has anyone got the jQuery-specific version of TinyMCE working with web2py? Any hints? It's driving me potty, as it simply doesn't fire for me! In an attempt to understand it, I've cut and pasted the example from the TinyMCE site, and even that doesn't fire (in the sense that there are

[web2py] Compile web2py application in release mode

2011-09-28 Thread vortex
How do I compile web2py application in release mode?

  1   2   >