Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2014-11-17 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by carljm):

 Replying to [comment:16 kylegibson]:
 > I apologise if this isn't the proper place for this comment, but what
 would it take to get this fix backpatched to 1.4?

 I'm afraid it won't be. 1.4 is in security-fix-only mode.

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.cdcda18485a75d73095a39aff368bbca%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2014-11-17 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by kylegibson):

 I apologise if this isn't the proper place for this comment, but what
 would it take to get this fix backpatched to 1.4?

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.68450f59a059c47c4629b8d06e9ca801%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2013-10-04 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by akaariai):

 I am pretty sure this one was fixed in #21203 and #21126, both of which
 got backpatched to 1.5.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.c81f7190c50cf0e2682b9c835fa97989%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2013-10-04 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by timo):

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


Comment:

 @anonymous, please open a new ticket with a test case if you can reproduce
 the issue on master. I tried the attached test based on your vague
 description but it passes on master and 1.5.x.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.64de5082df5cd8ffe97d87ecf654bb59%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2013-04-05 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by anonymous):

 The problem only occurs when using .defer()

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2013-04-05 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by anonymous):

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


Comment:

 I am having this problem in 1.5.1 -- 0 when using select related, but
 False when not. I am using mysql.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2012-10-25 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by Luke Plant ):

 In [changeset:"142f69eb8c79ea5a54799354231b219f7c53b1cc"]:
 {{{
 #!CommitTicketReference repository=""
 revision="142f69eb8c79ea5a54799354231b219f7c53b1cc"
 [1.5.x] Fixed #15040 - Boolean fields return 0 and 1 when loaded through
 select_related

 Thanks to homm for the report and ramiro for the patch.

 Backport of f3a2bcdee906f7ca1434b6275fdc09b3a454cf46 from master
 }}}

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2012-10-25 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by Luke Plant ):

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


Comment:

 In [changeset:"f3a2bcdee906f7ca1434b6275fdc09b3a454cf46"]:
 {{{
 #!CommitTicketReference repository=""
 revision="f3a2bcdee906f7ca1434b6275fdc09b3a454cf46"
 Fixed #15040 - Boolean fields return 0 and 1 when loaded through
 select_related

 Thanks to homm for the report and ramiro for the patch.
 }}}

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2012-10-22 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by anonymous):

 * version:  1.2 => 1.4


Comment:

 In my opinion this is a fairly significant issue. I spent all morning
 trying to figure out why a ModelForm (which was working perfectly locally
 on SQLite) had broken checkbox fields when deployed with a mysql backend.

 {{{
 parent = ParentModel.objects.select_related('child').get(pk=id)
 # BooleanFields won't work with this form if using MySQL because their
 values are rendered as ints due to select_related()
 child_form = ChildModelForm(instance=parent.child)
 }}}

 If there's no easy fix to this in Django itself I think there should at
 least be a warning in the documentation letting users know of this issue.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2012-08-22 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by benjaoming):

 * cc: benjaoming@… (added)


Comment:

 *bump* there is a patch for this! It even contains a very neat set of
 tests. Can it be merged and the bug closed? :)

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2012-08-22 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by anonymous):

 I just spent a ton of time debugging to figure out what this bug is. It
 causes ModelForms to have checkboxes that are all checked.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2012-02-27 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
 Reporter:  homm |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.2
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by ramiro):

 * 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-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] #15040: Boolean fields return 0 and 1 when loaded through select_related

2011-04-13 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
-+-
   Reporter:  homm   |Owner:  nobody
   Type:  Bug|   Status:  new
  Milestone: |Component:  Database layer
Version:  1.2|  (models, ORM)
 Resolution: | Severity:  Normal
   Triage Stage:  Accepted   | Keywords:
Needs documentation:  0  |Has patch:  0
Patch needs improvement:  0  |  Needs tests:  0
-+-
Changes (by anonymous):

 * type:   => Bug
 * severity:   => Normal
 * milestone:  1.3 =>


-- 
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] #15040: Boolean fields return 0 and 1 when loaded through select_related

2011-02-24 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
+---
   Reporter:  homm  | Owner:  nobody
 Status:  new   | Milestone:  1.3   
  Component:  Database layer (models, ORM)  |   Version:  1.2   
 Resolution:|  Keywords:
   Triage Stage:  Accepted  | Has patch:  0 
Needs documentation:  0 |   Needs tests:  0 
Patch needs improvement:  0 |  
+---

Comment (by adamnelson):

 Change at #15169 may be related and address this

-- 
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] #15040: Boolean fields return 0 and 1 when loaded through select_related

2011-01-10 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
---+
  Reporter:  homm  | Owner:  nobody
Status:  new   | Milestone:  1.3   
 Component:  Database layer (models, ORM)  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

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

Comment:

 This is because MySQL has special handling for returning boolean values;
 in 1.2, we added some callbacks to do the post-processing to ensure values
 get rectified. However, that rectification is performed with reference to
 the original model field. When using select_related, the original model
 obviously isn't being carried along for the ride.

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



[Django] #15040: Boolean fields return 0 and 1 when loaded through select_related

2011-01-09 Thread Django
#15040: Boolean fields return 0 and 1 when loaded through select_related
--+-
 Reporter:  homm  |   Owner:  nobody
   Status:  new   |   Milestone:  1.3   
Component:  Database layer (models, ORM)  | Version:  1.2   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 This behavior only on mysql. SQLite always return True or False.

 Models.py file:

 {{{
 from django.db import models

 class BoolModel(models.Model):
 bool = models.BooleanField()

 class Parent(models.Model):
 true = models.ForeignKey(BoolModel, related_name='trues')
 false = models.ForeignKey(BoolModel, related_name='falses')
 }}}

 In command line:

 {{{
 ./manage.py shell
 >>> from ex.models import *
 >>> true = BoolModel.objects.create(bool=True)
 >>> false = BoolModel.objects.create(bool=False)
 >>> parent = Parent.objects.create(true=true, false=false)

 >>> parent = Parent.objects.get()
 >>> parent.true.bool
 True
 >>> parent.false.bool
 False

 >>> parent = Parent.objects.select_related('true', 'false').get()
 >>> parent.true.bool
 1
 >>> parent.false.bool
 0
 }}}

 As you can seen, in first case, when parent object loaded without
 select_related, booleans is booleans.
 In second case, when object loaded with select_related, boolens are
 numbers.

 Version 1.2 and 1.3 acts the same.

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