def _last_post_from(posts, exclude_post=None):
 if exclude_post:
  posts = posts.exclude(id=exclude_post.id)
 posts = posts.order_by('-created')
 try:
  return posts[0]
 except IndexError:
  return None

def _last_post_from ( posts , exclude_post = None ) : if exclude_post : posts = posts . exclude ( id = exclude_post . id ) posts = posts . order_by ( '-created' ) try : return posts [ 0 ] except IndexError : return None
return the most recent post in the given set .