Re: Bug (very mild) in PostgreSQL version _check_

2008-05-23 Thread Gary Wilson Jr.

Haroldo Stenger wrote:
> I think I've found a bug in Django and a solution :-)

Please file a ticket [1] (after searching first [2]) for this issue if 
you haven't already so that it's not forgotten.

[1] http://code.djangoproject.com/simpleticket
[2] http://code.djangoproject.com/query

Thanks,
Gary

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



Bug (very mild) in PostgreSQL version _check_

2008-05-21 Thread Haroldo Stenger

Dear all,

I think I've found a bug in Django and a solution :-)

In django/db/backends/postgresql/operations.py (svn)

there is a PostgreSQL version check that reads like this:

 if self.postgres_version[0] >= 8 and self.postgres_version[1] >= 1


Bug: When PostgreSQL turns 9.0 (a year from now? ), the test will
yield False, since self.postgres_version[1] will hold 0.


Solution: Use Python's great sequence comparison syntax, something like:

 if self.postgres_version[:] >= (8,1):

Thought about writing a function that specializes in checking
versions, but didn't find any additional value as the latter proposal.

I also looked for more uses of the string "postgres_version" in Django
source code, but besides the aforementioned, the only use is the
loading of postgres_version sequence itself, which does it job nicely.

Hope some developer finds this contribution useful, since I'm new here
but am trying hard to learn, and eventually, be able to contribute to
this Great project that Django is. My $0.02.-

Best regards to all

Haroldo.-

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