Skip to content

Add aliasing to serializer formatting

Latest
Compare
Choose a tag to compare
@gwshaw gwshaw released this 19 Jun 07:49

API attribute names don't always match the database column names. This release adds the ability to specify separate api attribute and optional database attribute names.

ensure_zulu_time api_attribute, db_attribute

ensure_zulu_time enabled_at                # both are the same
ensure_zulu_time enabled_at, enabled_date  # API is enabled_at, DB is enabled_date

and this works similarly with enforce_iso8601_date