def array_type(data_types, field):
from sqlalchemy.dialects import postgresql<EOL>internal_type = field.base_field.get_internal_type()<EOL>if internal_type in data_types and internal_type != '<STR_LIT>':<EOL><INDENT>sub_type = data_types[internal_type](field)<EOL>if not isinstance(sub_type, (list, tuple)):<EOL><INDENT>sub_type = [sub_type]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>return postgresql.ARRAY(sub_type)<EOL>
Allows conversion of Django ArrayField to SQLAlchemy Array.
Takes care of mapping the type of the array element.