Re: [Django] #23335: Related fields pointing to custom fields that store different values in the database than the python representation do not remember selections

2015-09-25 Thread Django
#23335: Related fields pointing to custom fields that store different values in 
the
database than the python representation do not remember selections
---+--
 Reporter:  thenewguy  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Forms  |  Version:  1.7-rc-2
 Severity:  Normal |   Resolution:  fixed
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by thenewguy):

 * resolution:  needsinfo => fixed


Comment:

 So this has been fixed in DJ18 with the from_db_value() method.  I was
 never able to get something working under DJ17.  I've been able to make
 this work with DJ18, DJ19 and 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 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/067.2453638c79e9e383fbea4514dd5d7752%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23335: Related fields pointing to custom fields that store different values in the database than the python representation do not remember selections

2014-10-02 Thread Django
#23335: Related fields pointing to custom fields that store different values in 
the
database than the python representation do not remember selections
---+--
 Reporter:  thenewguy  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Forms  |  Version:  1.7-rc-2
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by timgraham):

 This may be a duplicate or at least related to #17122.

--
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/067.1d3cad7b4733c2ff1aeeddfad641d7e3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23335: Related fields pointing to custom fields that store different values in the database than the python representation do not remember selections

2014-10-01 Thread Django
#23335: Related fields pointing to custom fields that store different values in 
the
database than the python representation do not remember selections
---+--
 Reporter:  thenewguy  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Forms  |  Version:  1.7-rc-2
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by timgraham):

 Yes, please reopen when you provide more details showing what the bug is
 then I'll be happy to take another look.

--
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/067.d1ff2ea16088e4b7e9d5c000ae83b270%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23335: Related fields pointing to custom fields that store different values in the database than the python representation do not remember selections

2014-10-01 Thread Django
#23335: Related fields pointing to custom fields that store different values in 
the
database than the python representation do not remember selections
---+--
 Reporter:  thenewguy  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Forms  |  Version:  1.7-rc-2
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by thenewguy):

 Hello Tim.  I am happy to spend more time on this.  I am covered up for a
 few weeks with deadlines.  Can we reopen 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 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/067.445843ded593739c498580a7ee82064b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23335: Related fields pointing to custom fields that store different values in the database than the python representation do not remember selections

2014-10-01 Thread Django
#23335: Related fields pointing to custom fields that store different values in 
the
database than the python representation do not remember selections
---+--
 Reporter:  thenewguy  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Forms  |  Version:  1.7-rc-2
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by timgraham):

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


Comment:

 I think we really need more effort on your part in suggesting a solution
 since the example is quite complex and very specialized. Once again, I
 spent over an hour looking at this and couldn't figure out the exact
 issue.

 Something suspicious that seems related to the problem:
 {{{
 >>> a = BarInt.objects.get()
 >>> a.pk
 -15
 >>> # a.pk is a shortcut for a.id_id
 >>> a.id_id
 -15
 >>> a.id
 

 >>> # how form data is generated
 >>> model_to_dict(a)
 {'id': -15}

 >>> # how form choices are generated
 >>> [str(a) for a in FooInt.objects.all()]
 ['185']
 }}}

 I could make the Id and Fk widgets work by adding this method to the
 model:
 {{{
 def serializable_value(self, field_name):
 val = super(FooInt, self).serializable_value(field_name)
 if field_name == 'id':
 return val.db_value
 return val
 }}}
 but this may not be a good solution and I'm not sure if this will cause
 other problems (also m2m didn't work).

 Also it would be helpful to modify your project so that it doesn't use
 `SubFieldBase` to verify the issue still exists without that (I suspect it
 does).

--
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/067.685a4c1b236e7d30e7dab0e1caa23203%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23335: Related fields pointing to custom fields that store different values in the database than the python representation do not remember selections

2014-09-18 Thread Django
#23335: Related fields pointing to custom fields that store different values in 
the
database than the python representation do not remember selections
---+--
 Reporter:  thenewguy  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Forms  |  Version:  1.7-rc-2
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by thenewguy):

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


--
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/067.174f8ec57083cc4ec8b091a23c6b5854%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23335: Related fields pointing to custom fields that store different values in the database than the python representation do not remember selections

2014-09-18 Thread Django
#23335: Related fields pointing to custom fields that store different values in 
the
database than the python representation do not remember selections
---+--
 Reporter:  thenewguy  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Forms  |  Version:  1.7-rc-2
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by thenewguy):

 Sorry for the delayed response.  I didn't get a notice of activity for
 some reason.

 I am not sure exactly where the bug is.  This is from memory from awhile
 ago, but when the form is rendered the widget is passed the raw value of
 the relation (e.g. -200 instead of 1 for the int field in my demo).  So
 when the choice widget compares the value -200 against possible choice
 values, it doesn't match because it is comparing the db value against the
 to_python value.  The choices iterable that the widget checks for the
 value -200 in contains the to_python value that -200 was mapped to (i.e.
 1).

 I do not think the bug is in my code.  It seems to work for everything
 except for this issue with forms.

 Have I explained the problem well enough for you to reproduce/observe the
 symptoms?

--
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/067.5f904555c34ec6abfbafc4490d48d3a8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23335: Related fields pointing to custom fields that store different values in the database than the python representation do not remember selections

2014-08-27 Thread Django
#23335: Related fields pointing to custom fields that store different values in 
the
database than the python representation do not remember selections
---+--
 Reporter:  thenewguy  |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Forms  |  Version:  1.7-rc-2
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by timgraham):

 * status:  new => closed
 * needs_better_patch:   => 0
 * resolution:   => needsinfo
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 I spent some time looking at this, but ultimately, I couldn't determine
 whether this was a bug in Django or in your own code. It would be helpful
 if you could provide more details about where you think the problem lies.

 By the way, there are [https://github.com/django/django/pull/3047 plans to
 deprecate] `SubFieldBase`. Your issue may still be valid, but I thought
 I'd mention it so you are aware.

--
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/067.773bcc4ab2b39813524b0762517117e3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #23335: Related fields pointing to custom fields that store different values in the database than the python representation do not remember selections

2014-08-21 Thread Django
#23335: Related fields pointing to custom fields that store different values in 
the
database than the python representation do not remember selections
+--
 Reporter:  thenewguy   |  Owner:  nobody
 Type:  Bug | Status:  new
Component:  Forms   |Version:  1.7-rc-2
 Severity:  Normal  |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0   |  UI/UX:  0
+--
 I have uploaded a demonstration to github here:
 
https://github.com/thenewguy/django_custom_primary_key_related_field_incompatibility
 Concisely, forms do not preserve related field selections on these custom
 fields.

 If you have a custom field that returns a custom object from the database
 that is different from the value returned from to_python, related fields
 that point to forget the current selection when they are rendered by
 forms.

 I encountered this attempting to use a custom field that maps signed
 integers to fixed length string representation of unsigned integers for
 use as identifiers.

-- 
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/052.15638828903b1c8607d642754ee3e8d7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.