Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
#12560: Unique validation should not check for null atuo-assigned PK
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Django  
View profile  
 More options Jan 9 2010, 10:34 am
From: "Django" <nore...@djangoproject.com>
Date: Sat, 09 Jan 2010 15:34:04 -0000
Local: Sat, Jan 9 2010 10:34 am
Subject: [Django] #12560: Unique validation should not check for null atuo-assigned PK
#12560: Unique validation should not check for null atuo-assigned PK
---------------------------+----------------------------------------------- -
 Reporter:  kmtracey       |       Owner:  nobody    
   Status:  new            |   Milestone:  1.2      
Component:  Uncategorized  |     Version:  SVN      
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+----------------------------------------------- -
 Initially noted here: http://groups.google.com/group/django-
 developers/browse_thread/thread/b45c4d599ea93b74#

 The model validation unique check code is issuing an unnecessary query
 when adding new instances of models with auto-assigned PKs:

 {{{
 Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49)
 [GCC 4.3.2] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 (InteractiveConsole)
 >>> import django
 >>> django.get_version()
 u'1.2 alpha 1 SVN-12120'
 >>> from ttt.models import Tag
 >>> from django import forms
 >>> class TagForm(forms.ModelForm):
 ...     class Meta:
 ...         model = Tag
 ...
 >>> tf1 = TagForm({'name': 'T1'})
 >>> tf1.is_valid()
 True
 >>> from django.db import connection
 >>> connection.queries
 [{'time': '0.002', 'sql': u'SELECT (1) AS `a`, `ttt_tag`.`id`,
 `ttt_tag`.`name` FROM `ttt_tag` WHERE `ttt_tag`.`id` IS NULL LIMIT 1'}]
 >>>
 }}}

 Besides being unnecessary, that's a query that will potentially return an
 unexpected result on MySQL, see: http://groups.google.com/group/django-
 developers/browse_thread/thread/d4180b8addf5e970/

 This is similar to #12132, only for adding new instances instead of
 changing existing ones.

--
Ticket URL: <http://code.djangoproject.com/ticket/12560>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Django  
View profile  
 More options Jan 9 2010, 11:19 am
From: "Django" <nore...@djangoproject.com>
Date: Sat, 09 Jan 2010 16:19:11 -0000
Local: Sat, Jan 9 2010 11:19 am
Subject: Re: [Django] #12560: Unique validation should not check for null atuo-assigned PK
#12560: Unique validation should not check for null atuo-assigned PK
------------------------------------+-------------------------------------- -
          Reporter:  kmtracey       |         Owner:  nobody
            Status:  new            |     Milestone:  1.2  
         Component:  Uncategorized  |       Version:  SVN  
        Resolution:                 |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  1    
        Needs_docs:  0              |   Needs_tests:  0    
Needs_better_patch:  0              |  
------------------------------------+-------------------------------------- -
Changes (by Honza_Kral):

  * needs_better_patch:  => 0
  * has_patch:  0 => 1
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 Added a quick patch, haven't checked everything, so only take it as an
 idea how to solve this. Unfortunately I don't have time this weekend, but
 I am hoping the sprinters might.

--
Ticket URL: <http://code.djangoproject.com/ticket/12560#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Django  
View profile  
 More options Jan 14 2010, 10:00 am
From: "Django" <nore...@djangoproject.com>
Date: Thu, 14 Jan 2010 15:00:32 -0000
Local: Thurs, Jan 14 2010 10:00 am
Subject: Re: [Django] #12560: Unique validation should not check for null atuo-assigned PK
#12560: Unique validation should not check for null atuo-assigned PK
------------------------------------+-------------------------------------- -
          Reporter:  kmtracey       |         Owner:  nobody
            Status:  new            |     Milestone:  1.2  
         Component:  Uncategorized  |       Version:  SVN  
        Resolution:                 |      Keywords:        
             Stage:  Unreviewed     |     Has_patch:  1    
        Needs_docs:  0              |   Needs_tests:  0    
Needs_better_patch:  0              |  
------------------------------------+-------------------------------------- -
Comment (by wkornewald):

 Any progress? This is just a one-line fix. Maybe it should be limited to
 primary_key fields, I don't know.

--
Ticket URL: <http://code.djangoproject.com/ticket/12560#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »