[web2py] Re: Is there a way to use an Alias for a COUNT() field

2012-05-11 Thread Franklin Freitas
t; On Friday, 11 May 2012 23:44:57 UTC-5, Franklin Freitas wrote: >> >> Having the following >> >> def by_country(): >> count = db.procesados.idpublicacion.count() >> rows = db().select(db.procesados.pais, count, >> groupby=db.procesados.pais) >&

[web2py] Is there a way to use an Alias for a COUNT() field

2012-05-11 Thread Franklin Freitas
Having the following def by_country(): count = db.procesados.idpublicacion.count() rows = db().select(db.procesados.pais, count, groupby=db.procesados.pais) return rows.json() It generates the JSON: [{"pais": "", "COUNT(procesados.idpublicacion)": 236}, {"pais": "AE", "COUNT(proc

[web2py] Re: Numbers Format

2011-11-13 Thread Franklin Freitas
Thanks a lot I live in Venezuela and that's the format I need Thanks for your help On Nov 8, 10:12 am, Vinicius Assef wrote: > No. I said probably you're using format() in a version it is not > supported yet. But I'm not sure about it. > > I never lay on server locale dependancy. > > I live in

[web2py] Re: Numbers Format

2011-11-08 Thread Franklin Freitas
Hi Vinicius, You mean I can use str.format() to format numbers with thousand separators instead of my function ?, that would be great Could you give me an example ?? Thanks On Nov 7, 6:42 pm, Vinicius Assef wrote: > Possibly the python version in your production server. > > str.format() is avai

[web2py] Numbers Format

2011-11-07 Thread Franklin Freitas
In order to format numbers with thousands separator and custom number of decimals, I created the following function and included it in my "db.py" model so it could be accessed through the entire application. def number_format(num, places=0): return locale.format("%.*f", (places, num), True) I

[web2py] Re: Ajax sample function does not work on Update form

2011-10-26 Thread Franklin Freitas
it works fine: onkeyup="ajax('/palitan/default/my_function', ['lastname'], 'target');" Thanks for your help, this got me for a few days On Oct 20, 4:25 pm, Anthony wrote: > Can you show some code? > > > > > > > > On

[web2py] Ajax sample function does not work on Update form

2011-10-20 Thread Franklin Freitas
I am using a form very similar to the Ajax sample on chapter 3 to search for customers and once you see the results, you click on the record you want so customer id and name are added to the form fields on my main processing form. This works fine on my "add new" records form. I have another page t

[web2py] Re: connectionstring for mssql ? , DSN ?

2011-02-23 Thread Franklin Freitas
Hi Stef, This is the way I've done it: db = DAL('mysql://username:password@dns_or_ip_of_server/ database_name') Hope it helps Regards Franklin On Feb 23, 3:43 pm, DenesL wrote: > According to the dal.py source you either supply > > mssql://dsn > > or > > mssql://username:password@host:port

[web2py] Re: Need help installing MySQLdb in Mac OSX

2010-10-20 Thread Franklin Freitas
. > > Mart :) > > On Oct 18, 1:49 am, mart wrote: > > > > > > > > > hum.. let me check on my end to make sure I didn't miss mentioning > > something. It has been a little while... > > > On Oct 18, 12:40 am, Franklin Freitas > >

[web2py] Re: Need help installing MySQLdb in Mac OSX

2010-10-17 Thread Franklin Freitas
ll dependencies within my project and reference it there... so, many > possibilities, depends how you prefer to reference it > > Hope it helps, > Mart :) > > On Oct 17, 7:11 pm, Franklin Freitas > wrote: > > > > > Has anyone been able to install MySQLdb in Ma

[web2py] Need help installing MySQLdb in Mac OSX

2010-10-17 Thread Franklin Freitas
Has anyone been able to install MySQLdb in Mac OSX ??? I want to use it with Web2py but haven't been able to make it work. I've read a whole bunch of forums saying how hard it is, I've done everything I've reead about it without any results. I even used macports as recommended by my Web2py teacher