<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_sum(qs, field):
 """ get sum for queryset. ``qs``: queryset ``field``: The field name to sum. """

    sum_field = '%s__sum' % field
    qty = qs.aggregate(Sum(field))[sum_field]
    return qty if qty else 0