kvesteri / sqlalchemy-utils

Various utility functions and datatypes for SQLAlchemy.
Other
1.27k stars 322 forks source link

Add EUIType #763

Open jeffmcadams opened 1 month ago

jeffmcadams commented 1 month ago

EUIType can store netaddr EUI objects (either EUI48 or EUI64), converting to string when adding to the database and converting back to an EUI object when reading back out of the database.

This is to go along with IPAddressType to support storing and validating network MAC addresses (which are just EUI48s).

Code cribbed pretty heavily from IPAddressType and (less) ColorType.