How to manage Postgres Enum type in Django?

Viewed 1379

I had used django-mysql to manage MySQL enum type from Django. Recently I am using the Postgres database for my Django project. To manage the Postgres Enum, I could not able to find any library. There is a db_type() method in Django to manage custom type. But the problem is Postgres enum must be created first at database and after that, I can use it.

Here is a code sample for Postgres enum.

CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
CREATE TABLE person (
    name text,
    current_mood mood
);

Is there present a library at all? If not, how could I be able to achieve the Postgres enum management from Django?

1 Answers
Related