def get_next_photo(self):
try:<EOL><INDENT>next_photo = Photo.objects.filter(<EOL>gallery=self.gallery,<EOL>created__gt=self.created,<EOL>)[<NUM_LIT:0>]<EOL><DEDENT>except IndexError:<EOL><INDENT>next_photo = Photo.objects.filter(gallery=self.gallery)[<NUM_LIT:0>]<EOL><DEDENT>return next_photo<EOL>
Returns next photo from the same gallery (in chronological order).

Wraps around from last photo in the gallery to the first one.