Skip to content

Instantly share code, notes, and snippets.

@mekhami
Created October 20, 2019 22:56
Show Gist options
  • Save mekhami/d06e623e8972460fec749c00bde894c2 to your computer and use it in GitHub Desktop.
Save mekhami/d06e623e8972460fec749c00bde894c2 to your computer and use it in GitHub Desktop.
@classmethod
def group_key(cls, box_shipment: NamedTuple) -> str:
return ",".join(
[
str(box_shipment.club_id),
str(box_shipment.theme_id),
",".join(sorted([str(book_id) for book_id in box_shipment.book_ids])),
str(box_shipment.outgoing_label),
str(box_shipment.sent),
str(box_shipment.box_weight_oz),
str(box_shipment.inserts_weight_oz),
str(box_shipment.return_mailer_weight_oz),
str(box_shipment.id)
if box_shipment.shipping_address_validation_error
else "",
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment