O'Reilly logo
  • Christopher Smith thinks this is interesting:

def get_entry_or_404(slug): valid_statuses = (Entry.STATUS_PUBLIC, Entry.STATUS_DRAFT) (Entry.query .filter( (Entry.slug == slug) & (Entry.status.in_(valid_statuses))) .first_or_404())

From

Cover of Learning Flask Framework

Note

Should this return something?