#23159: There should be a way to exclude certain fields from migrations
-------------------------------+--------------------------------------
     Reporter:  nemesisdesign  |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Migrations     |                  Version:  1.7-rc-2
     Severity:  Normal         |               Resolution:
     Keywords:  migrations     |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------

Comment (by nemesisdesign):

 Alternatively, if adding a new attribute is time-consuming and doesn't add
 much value, we can ensure backward compatiblity by testing for the column
 attribute on the field:

 {{{
 if isinstance(field, OrderWrt):
     continue
 # these two lines maximize compatibility with existing apps that set the
 column attribute to None
 if field.column is None:
     continue
 }}}

 The column attribute is used in the options API to determine if a field
 should be considered as concrete or not:
 https://github.com/django/django/blob/master/django/db/models/options.py#L315

 So it makes sense to skip non-concrete fields in the migrations framework
 too.

 Otherwise IMHO the way django 1.7 would treat these non-concrete fields
 would be really inconsistent (sad). It slighlty differs already from
 django models than django model forms (which is daunting), and it would
 differ in a new way in the migration framework (not nice at all).

 I hope you can consider these points in this new awsome feature that is
 the migration framework. I'm pretty sure one of these two solutions won't
 break existing tests and would ensure maximum compatibility, hence benefit
 future django versions lot.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23159#comment:3>
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 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/071.fa715b0c99563673e8e492bcbef7cfa2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to