On Mon, 2007-10-29 at 22:47 +0000, [EMAIL PROTECTED] wrote:
> So I have a function in views:
> #################################
> def getEntries(user):
>   """Returns unique entries and page views for each of last 30 day
>   """
>   cursor = connection.cursor()
>   query = cursor.execute('SELECT COUNT(DISTINCT(ip)) AS uniqs,
> COUNT(ip) AS views, date FROM pw_logs GROUP BY date LIMIT 30')
>   return query.fetchall()
> #################################
> The query in phpMyAdmin returns the correct data. In Django-SVN
> cursor.execute returns LONG - a number. I used SQLite yesterday with
> simillar query (and others) and it worked. Now what I se on MySQL all
> or almost all my cursor.execute give LONGs. What's going on?

I'm not quite sure what you're saying here. Are you saying it returns
the string "LONG", or that it returns something that has Python type
'long' -- such as 1L, rather than 1? In the latter case, there's no
problem at all here. A long is just a number. Just use it as you
normally would. MySQL always returns longs (for historical reasons, due
to the need for explicit conversions between Python ints and longs in
older Python versions).

Regards,
Malcolm

-- 
Works better when plugged in. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to