On Tue, Sep 29, 2009 at 8:00 AM, eradman <eric.rad...@gmail.com> wrote:

>
> I have been tasked with migrating a Django app from PostgreSQL (using
> psycopg2 2.0.7) to MySQL (using mysql-python 1.2.2-05), and have
> encountered a problem with custom models definitions that look like
> this:
>
> class CustomIntegerField (models.IntegerField):
>    def __init__ (self, verbose_name = None, **kwargs):
>
>        models.IntegerField.__init__ (self, verbose_name, **kwargs)
>
>    def get_internal_type (self):
>        return "IntegerField"
>
> Under Postgres and SQLite it works fine, but when I switch to MySQL
> queries return Python longs causing unit tests to fail because the
> string representation of, say 5 is now 5L.
>
> I've tried Django 1.1 as well as from SVN. Is this a problem with
> mysql-python?
>
>
It's a characteristic, I don't know that I'd call it a problem.  If you want
your code to be portable across the different DBs then you'll need to adapt
your tests to not depend on the repr details for the data returned.

Karen

--~--~---------~--~----~------------~-------~--~----~
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