# Path: psqlextra/models/base.py
# class PostgresModel(models.Model):
#     """Base class for for taking advantage of PostgreSQL specific features."""
# 
#     class Meta:
#         abstract = True
#         base_manager_name = "objects"
# 
#     objects = PostgresManager()


from collections.abc import Mapping
from typing import Type
from django.db.migrations.state import ModelState
from django.db.models import Model
from psqlextra.models import PostgresModel
            # In Django 3.1 `self.fields` became a `dict`
            fields = {
                name: field.clone() for name, field in self.fields.items()
            }
        else:
            # In Django < 3.1 `self.fields` is a list of (name, field) tuples
            fields = {name: field.clone() for name, field in self.fields}

        meta = type(
            "Meta",
            (),
            {"app_label": self.app_label, "apps": apps, **self.options},
        )

        attributes = {
            **fields,
            "Meta": meta,
            "__module__": "__fake__",
            **dict(self.construct_managers()),
        }

        return type(*self._pre_render(self.name, bases, attributes))

    @classmethod
    def _pre_new(
        cls, model: PostgresModel, model_state: "PostgresModelState"
    ) -> "PostgresModelState":
        """Called when a new model state is created from the specified
        model."""


# Path: psqlextra/models/base.py
# class PostgresModel(models.Model):
#     """Base class for for taking advantage of PostgreSQL specific features."""
# 
#     class Meta:
#         abstract = True
#         base_manager_name = "objects"
# 
#     objects = PostgresManager()


# Path: psqlextra/backend/migrations/state/model.py
from collections.abc import Mapping
from typing import Type
from django.db.migrations.state import ModelState
from django.db.models import Model
from psqlextra.models import PostgresModel

            # In Django 3.1 `self.fields` became a `dict`
            fields = {
                name: field.clone() for name, field in self.fields.items()
            }
        else:
            # In Django < 3.1 `self.fields` is a list of (name, field) tuples
            fields = {name: field.clone() for name, field in self.fields}

        meta = type(
            "Meta",
            (),
            {"app_label": self.app_label, "apps": apps, **self.options},
        )

        attributes = {
            **fields,
            "Meta": meta,
            "__module__": "__fake__",
            **dict(self.construct_managers()),
        }

        return type(*self._pre_render(self.name, bases, attributes))

    @classmethod
    def _pre_new(
        cls, model: PostgresModel, model_state: "PostgresModelState"
    ) -> "PostgresModelState":
        """Called when a new model state is created from the specified
        model."""


        return model_state