Re: [Django] #30006: Wrong UUID serialization in inline admin when used as a 1to1Field primary key of a UUID primary key.

2018-12-04 Thread Django
#30006: Wrong UUID serialization in inline admin when used as a 1to1Field 
primary
key of a UUID primary key.
-+-
 Reporter:  Gerhut   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 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 Simon Charette):

 * status:  new => closed
 * component:  contrib.admin => Database layer (models, ORM)
 * resolution:   => duplicate


Comment:

 Duplicate of #27595 which will be fixed in Django 2.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 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/064.f1661573c0cfed8a540f54d797d65c8e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30006: Wrong UUID serialization in inline admin when used as a 1to1Field primary key of a UUID primary key.

2018-12-04 Thread Django
#30006: Wrong UUID serialization in inline admin when used as a 1to1Field 
primary
key of a UUID primary key.
---+--
 Reporter:  Gerhut |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  2.1
 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
---+--

Comment (by Gerhut):

 {{{
 >>> from app.models import *
 >>> Teacher.objects.last().room_id
 UUID('38c7b7f8-1006-467c-809b-e95546dcc58e')
 >>> Student.objects.last().teacher_id
 '38c7b7f81006467c809be95546dcc58e'
 }}}

 They are all UUIDs

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


Re: [Django] #30006: Wrong UUID serialization in inline admin when used as a 1to1Field primary key of a UUID primary key.

2018-12-03 Thread Django
#30006: Wrong UUID serialization in inline admin when used as a 1to1Field 
primary
key of a UUID primary key.
---+--
 Reporter:  Gerhut |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  2.1
 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
---+--

Comment (by Gerhut):

 Found a workaround: add {{{readonly_fields = ('teachers',)}}} to student
 inline works.

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


[Django] #30006: Wrong UUID serialization in inline admin when used as a 1to1Field primary key of a UUID primary key.

2018-12-03 Thread Django
#30006: Wrong UUID serialization in inline admin when used as a 1to1Field 
primary
key of a UUID primary key.
-+
   Reporter:  Gerhut |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  contrib.admin  |Version:  2.1
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 Sorry for the confusing title, I create a reproducing
 [https://github.com/Gerhut/django-inline-admin-bug repo] on GitHub.

 Key code as follows:

 models.py


 {{{
 class Room(models.Model):
 id = models.UUIDField(default=uuid4, primary_key=True, editable=False)
 name = models.TextField()

 def __str__(self):
 return self.name


 class Teacher(models.Model):
 room = models.OneToOneField(Room, on_delete=models.CASCADE,
 primary_key=True)
 name = models.TextField()

 def __str__(self):
 return self.name


 class Student(models.Model):
 id = models.UUIDField(default=uuid4, primary_key=True, editable=False)
 teacher = models.ForeignKey(Teacher, on_delete=models.CASCADE)
 name = models.TextField()

 def __str__(self):
 return self.name
 }}}

 admin.py
 {{{
 from .models import Room, Teacher, Student


 @admin.register(Room)
 class RoomAdmin(admin.ModelAdmin):
 pass


 @admin.register(Teacher)
 class TeacherAdmin(admin.ModelAdmin):
 class StudentInline(admin.TabularInline):
 model = Student

 inlines = [StudentInline]
 }}}

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