Hi.

In general features that can live outside Django (doesn't require changes
in Django core to be implemented) needs quite well established de facto
standard in community to be included in the Django itself.

So best thing to do is to make sure that your implementation can work with
all current backends and preferably with all current supported Django
versions.

And get users to your enum field.


20.10.2017 14.55 "Ashley Waite" <[email protected]> kirjoitti:

I've been working a bit on an EnumField implementation because it'll save
me a lot of future time in a project, and existing implementations seem to
be fragile, non-reversible, or one-database-only. Wondering why there isn't
a PEP435 based EnumField in Django itself, I didn't find many answers with
a search on the mailing list.

Is this a feature that would be considered, and if so, what would the
expectations on it be?

I was a bit reluctant on all the implementations I could find because they
seem to reduce to these issues:
* Using an int/char instead of database enum
* Being database vendor specific
* Requiring a non-standard enum or sub-class of it
* Not allowing enum reuse
* Not migrating changes statefully (ie, injecting type declaration on
connection in postgres)
* Not allowing enum changes (add/remove/rename)
* Not parametising enum values (mysql)
* Not handling data consistency on enum changes

And realised, maybe that's why it's not a standard field.

I've done a POC implementation that works for mysql and postgres, and
should be able to easily generalise to work on any database via two flags
(has_enum, and requires_enum_declaration) that determine how to deal with
changes to it.

It addresses all of these issues, migrates, and with a little more work can
handle data effects as well.

So where should I go with this from here?
https://github.com/ashleywaite/django-more/tree/master/django_enum

- Ashley

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-developers/317b5aea-b68f-467b-886d-68a49c7194c7%40googlegroups.
com
<https://groups.google.com/d/msgid/django-developers/317b5aea-b68f-467b-886d-68a49c7194c7%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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAHn91ofgo8WKq8N2LA6v-mKp5249Xtcg09B04Poqe_NMAGisAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to