On Mar 14, 1:35 am, Russell Keith-Magee <freakboy3...@gmail.com>
wrote:
> It's possible that this is a known bug that has been fixed since v0.96
> was released. Where exactly did metrics object come from? Is is a
> newly created object, or was it obtained as the result of a query?

It was created as a result of a query.

> If metrics isn't a newly created object, then it would help if you
> could provide a test case that would let us reproduce the problem.

I'm not sure that I can reliably reproduce it, but I can provide what
code I have.

There's a background process that is receiving messages as an IPC
mechanism, and storing the numbers in the metrics table via the
TugMetrics class. The numbers are all strings initially but the daemon
casts them before calling save().

The code populating it looks like this

       metrics.user_licenses_ca = int(
            details.get('Max_users', '0/0/0').split('/')[2])

The Max_users field contains a '/' delimited sting of three numbers,
which is why I'm splitting like that.

The int() call should enforce an integer.

What's really odd is that when I use a django shell, all of the
properties seems to be integers instead of this one. I'm not sure why.

I'm currently working around it by calling int() when I pull the value
out again.

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

Reply via email to