<s> from django . db import models <EOL> from . import enums <EOL> class ProductQuerySet ( models . QuerySet ) : <EOL> def active ( self ) : <EOL> return self . filter ( active = True ) <EOL> class ProductTrxQuerySet ( models . QuerySet ) : <EOL> def finalized ( self ) : <EOL> return self . filter ( trx_status = enums . TrxStatus . FINALIZED ) <EOL> def quantity ( self ) : <EOL> return self . finalized ( ) . aggregate ( qty = models . Sum ( '<STR_LIT>' ) ) [ '<STR_LIT>' ] or <NUM_LIT:0> </s>
