₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,153 members, 8,420,585 topics. Date: Friday, 05 June 2026 at 04:59 AM

Toggle theme

Jajad's Posts

Nairaland ForumJajad's ProfileJajad's Posts

1 2 3 4 5 6 (of 6 pages)

ProgrammingRe: Web Application Development Contest: Jajad Wins by jajad: 2:05pm On Nov 09, 2011
Seun:
@jajad: this:
#Consolidate user detail queries
def userDetails(email):
    results = runQuery("select id, availablenaira,nairabalance,dollarbalance from x_user where email =%s;", (email,))
    rr = {}
    rr["id"] = results[0][0]
    rr["availablenaira"] = results[0][1]
    rr["nairabalance"] = results[0][2]
    rr["dollarbalance"] = results[0][3]
    return rr


Is equivalent to:
#Consolidate user detail queries
def userDetails(email):
    return runQuery("select id, availablenaira,nairabalance,dollarbalance from x_user where email =%s;", (email,))[0]
Not really. Your function returns a list e.g. (1, Decimal('84505353.8900'), Decimal('84528775.0000'), Decimal('30454.2300')).
The first one returns a dictionary e.g. {'dollarbalance': Decimal('30454.2300'), 'id': 1, 'availablenaira': Decimal('84505353.8900'), 'nairabalance': Decimal('84528775.0000')}
I thought it was better to use userDetails()["dollarbalance"] than userDetails()[3].

u.dollarbalance would be cleanest though and hopefully that's where I'm headed smiley
ProgrammingRe: Web Application Development Contest: Jajad Wins by jajad: 7:26pm On Nov 07, 2011
Still a long way to go sad. But here goes.
https://github.com/jnhdny/testauction
ProgrammingRe: Web Application Development Contest: Jajad Wins by jajad: 8:09am On Nov 07, 2011
*dhtml:
That person is likely a pirated I.D or something. The writing style is a tad too familiar for a newbie.

Na wa o, so upon all the mouth you guys don make, nobody fit chest out like King Kong, code the shi.t?
Pirated I.D? And when you say newbie do you mean to nairaland or to Python web programming?
Abeg Seun leave the contest open o. I could use the money. Monday and Tuesday are public holidays. I'm surprised more people aren't attempting it though. It would be nice to have someone to share ideas with.
ProgrammingRe: Web Application Development Contest: Jajad Wins by jajad: 11:46pm On Nov 06, 2011
Saw it late (Friday night). Working on it. Maybe I'll win all the money since I'm the only one. smiley
It's an interesting project.
pymysql had some issues with the Decimal field in MySQL 5.5 and I had to change some code in there. Will send a git repo link tomorrow (I hope).

1 2 3 4 5 6 (of 6 pages)