#27813: BinaryField is inconsistent between sqlite3 and postgresql
-------------------------------------+-------------------------------------
               Reporter:  Antonio    |          Owner:  nobody
  Terceiro                           |
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:  Database   |        Version:  1.10
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I have an application that has the following model:

 {{{
 class Attachment(models.Model):
     # ...
     data = models.BinaryField(default=None)
 }}}

 under sqlite3:

 {{{
 In [1]: Attachment.objects.last().data
 Out[1]: b'Mon Feb  6 16:53:37 UTC 2017\n'
 }}}

 under postgresql:

 {{{
 In [1]: Attachment.objects.last().data
 Out[1]: <memory at 0x7f1ae8e93108>
 }}}

 i.e. under sqlite the BinaryField values comes as bytes(), and under
 postgresql it comes as memoryview()

--
Ticket URL: <https://code.djangoproject.com/ticket/27813>
Django <https://code.djangoproject.com/>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.562022281c1024ffbce305e1ff337797%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to