<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def previous_blocks(self, quantity=-1):
 """Get the previous blocks in order."""

        blocks = (EighthBlock.objects.get_blocks_this_year().order_by(
            "-date", "-block_letter").filter(Q(date__lt=self.date) | (Q(date=self.date) & Q(block_letter__lt=self.block_letter))))
        if quantity == -1:
            return reversed(blocks)
        return reversed(blocks[:quantity])