So, bear in mind that you can easily set these defaults yourself in a migration with RunSQL if you need them for legacy purposes; that way they'll get applied, we don't need to add more code to Django, and it works fine for simple plain defaults without the need for a system where Django tries to work out if the default is safe or not.
Andrew On Fri, Oct 31, 2014 at 9:35 AM, Jon Dufresne <[email protected]> wrote: > On Fri, Oct 31, 2014 at 6:48 AM, Shai Berger <[email protected]> wrote: > > Peter, you said you're "interested in getting database migrations to > support > > setting database-level default values", but you haven't said why; unless > > there's a convincing use-case, I'm going to be -1 on this (per the new > rules, > > this is no longer a veto, but still). > > I am not the original poster, but, FWIW, I too would benefit from this > feature. > > My Django application interacts with an existing Legacy application > and database. These two applications share the existing database. > Parts of the Legacy application have been ported to Django, other > parts haven't. The existing Legacy application and legacy scripts > relied on these database defaults to handle some data. I've made an > effort to shape the database and Legacy application to the "Django > way", but sometimes it is inconvenient given the existing Legacy > compatibility. > > For my particular use case, just handling "primitave" values would be > sufficient: True, False, numbers, text. I understand arbitrary Python > functions can't be easily represeted by databases in a cross platform > way, but that is already beyond the common case. Those functions would > need to be implemented by the Legacy application already. > > As far as I'm concerned, Django's ORM doesn't even need to rely on > these defaults when creating objects, but if the migration system > _created_ them (and kept them up to date) it would be very helpful to > people in my situation. > > Cheers, > Jon > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" 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]. > Visit this group at http://groups.google.com/group/django-developers. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/CADhq2b7wNsZfoY9Gnq2QejigOCCO08uzQtmo7ZK8AX1whHnSRg%40mail.gmail.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" 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]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFwN1uo4Na6VrCSJzsd9g-6Kieg9nVyxJbuyvRG6UjKuM_zTtw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
