Re: [Django] #11702: ForeignKey validation should check that to_field is unique

2012-04-09 Thread Django
#11702: ForeignKey validation should check that to_field is unique
-+-
 Reporter:  physicsnick  |Owner:
 Type:  Uncategorized|  marcosmoyano
Component:  Database layer   |   Status:  closed
  (models, ORM)  |  Version:  1.1
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  pycamp2010   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-

Comment (by kmtracey):

 No. The validation is needed especially for databases that don't enforce
 this constraint. Django's !ForeignKey is many-to-one, the Django code
 relies on that characteristic, and you can get odd results if the database
 does not enforce it, see for example this thread:

 https://groups.google.com/forum/?fromgroups#!searchin/django-
 users/QuerySet.count%28%29$20inaccurate$20across$20ForeignKey$20relationships
 /django-users/fMmWVDr0Re8/overview

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11702: ForeignKey validation should check that to_field is unique

2012-04-09 Thread Django
#11702: ForeignKey validation should check that to_field is unique
-+-
 Reporter:  physicsnick  |Owner:
 Type:  Uncategorized|  marcosmoyano
Component:  Database layer   |   Status:  closed
  (models, ORM)  |  Version:  1.1
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  pycamp2010   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by anandjeyahar1):

 * ui_ux:   => 0
 * type:   => Uncategorized
 * severity:   => Normal
 * easy:   => 0


Comment:

 Shouldn't this fix be specific based on the db being used? i.e syncdb
 should check the current db being used and raise an error only for
 postgresql or oracle. Am using mysql and i shouldn't be blocked from using
 a non_unique field as a foreign key.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11702: ForeignKey validation should check that to_field is unique

2010-03-06 Thread Django
#11702: ForeignKey validation should check that to_field is unique
---+
  Reporter:  physicsnick   | Owner:  
marcosmoyano
Status:  reopened  | Milestone:  1.2
 
 Component:  Database layer (models, ORM)  |   Version:  1.1
 
Resolution:|  Keywords:  pycamp2010 
 
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  1 |  
---+
Changes (by kmtracey):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 It's not fixed until patch is committed.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11702: ForeignKey validation should check that to_field is unique

2010-03-06 Thread Django
#11702: ForeignKey validation should check that to_field is unique
---+
  Reporter:  physicsnick   | Owner:  
marcosmoyano
Status:  closed| Milestone:  1.2
 
 Component:  Database layer (models, ORM)  |   Version:  1.1
 
Resolution:  fixed |  Keywords:  pycamp2010 
 
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  1 |  
---+
Changes (by marcosmoyano):

  * status:  assigned => closed
  * resolution:  => fixed

Comment:

 New patch. Moved validation code to django.core.management.validation and
 add test suite.

 I think the validation could be clearear and simpler if we add a line like
 this:
 self.to_field = to_field
 in django.db.models.fields.related on ForeignKey __init__ method.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11702: ForeignKey validation should check that to_field is unique

2010-03-06 Thread Django
#11702: ForeignKey validation should check that to_field is unique
---+
  Reporter:  physicsnick   | Owner:  
marcosmoyano
Status:  assigned  | Milestone:  1.2
 
 Component:  Database layer (models, ORM)  |   Version:  1.1
 
Resolution:|  Keywords:  pycamp2010 
 
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  1 |  
---+
Changes (by ramiro):

  * keywords:  => pycamp2010
  * needs_better_patch:  0 => 1
  * has_patch:  0 => 1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11702: ForeignKey validation should check that to_field is unique

2010-03-06 Thread Django
#11702: ForeignKey validation should check that to_field is unique
---+
  Reporter:  physicsnick   | Owner:  
marcosmoyano
Status:  assigned  | Milestone:  1.2
 
 Component:  Database layer (models, ORM)  |   Version:  1.1
 
Resolution:|  Keywords: 
 
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Comment (by marcosmoyano):

 A humble approach at related field initialization. Don't know how to write
 a test suite for this since it's on initialization. I've ran the test
 suite just to make sure nothing breaks.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11702: ForeignKey validation should check that to_field is unique

2010-03-06 Thread Django
#11702: ForeignKey validation should check that to_field is unique
---+
  Reporter:  physicsnick   | Owner:  
marcosmoyano
Status:  assigned  | Milestone:  1.2
 
 Component:  Database layer (models, ORM)  |   Version:  1.1
 
Resolution:|  Keywords: 
 
 Stage:  Accepted  | Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by marcosmoyano):

  * owner:  nobody => marcosmoyano
  * status:  new => assigned

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11702: ForeignKey validation should check that to_field is unique

2010-02-03 Thread Django
#11702: ForeignKey validation should check that to_field is unique
---+
  Reporter:  physicsnick   | Owner:  nobody
Status:  new   | Milestone:  1.2   
 Component:  Database layer (models, ORM)  |   Version:  1.1   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * needs_better_patch:  => 0
  * needs_docs:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * milestone:  => 1.2

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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