def user_quantity_remaining(self, user, filtered=True):
if filtered:<EOL><INDENT>if hasattr(self.condition, "<STR_LIT>"):<EOL><INDENT>return self.condition.remainder<EOL><DEDENT><DEDENT>qs = type(self.condition).objects.filter(pk=self.condition.id)<EOL>qs = self.pre_filter(qs, user)<EOL>if len(qs) > <NUM_LIT:0>:<EOL><INDENT>return qs[<NUM_LIT:0>].remainder<EOL><DEDENT>else:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>
returns 0 if the date range is violated, otherwise, it will return
        the quantity remaining under the stock limit.

        The filter for this condition must add an annotation called "remainder"
        in order for this to work.