#23987: sqlite backend don't always use effective_default
-------------------------------------+-------------------------------------
     Reporter:  coldmind             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by coldmind):

 As I can see need to have something like this.
 Not sure about `ManyToManyField`, but without check for `ManyToManyField`
 some tests fails.

 {{{
 Index: django/django/db/backends/sqlite3/schema.py
 ===================================================================
 --- django/django/db/backends/sqlite3/schema.py (date 1417898599000)
 +++ django/django/db/backends/sqlite3/schema.py (revision )
 @@ -69,8 +69,8 @@
          # Add in any created fields
          for field in create_fields:
              body[field.name] = field
 -            # If there's a default, insert it into the copy map
 -            if field.has_default():
 +            # Choose default and insert it into the copy map
 +            if not isinstance(field, ManyToManyField):
                  mapping[field.column] = self.quote_value(
                      self.effective_default(field)
                  )
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23987#comment:2>
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/066.c801b2b127301bb403f7074a85a26a7d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to