I agree with Tim.

I would support refactoring inspectdb so that it would be easier for anyone
to subclass the command and add additional logic to the introspection
process. Alternatively, moving much of the logic out to a function that
returns a JSON representation of the database that inspectdb uses to write
the model data.

Regards,
Michael Manfre

On Tue, Mar 10, 2015 at 11:56 AM, Collin Anderson <[email protected]>
wrote:

> Hi All,
>
> We recently added database introspection of defaults for purposes of
> testing migrations.
>
>
> https://github.com/django/django/commit/75303b01a9cc900eebf1f27ba0bc6508334242fc
>
> I would find it useful to have inspectdb attempt to use those defaults
> when generating models. (My use case is running inspectdb on a WordPress
> database which has a bunch of database defaults.)
>
> Rough proof of concept: https://github.com/django/django/pull/4030
>
> Though Tim says: "Translating database level defaults into model field
> defaults isn't functionally equivalent and given that Django doesn't
> translate the model field default option into a database level default, I
> think it would be inconsistent to do a conversion in the other direction."
>
> Collin
>
>  --
> 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/11972cea-2565-4940-abe6-8cdec8f40a1e%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/11972cea-2565-4940-abe6-8cdec8f40a1e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAGdCwBtPJ30Rv5Bx2h-Thy0rqaG%3D7AC%3DGROWhn26rRPoNBhBmQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to