@classmethod
def prettyqty(cls, amount):
    """return a quantity as kilos (k) or megas (M) if  justified)"""
    if amount < 10000:
        return '%d' % (amount,)
    if amount < 10000000.0:
        return '%dk' % (amount // 1000,)
    if amount < 100000000.0:
        return '%1.1fM' % (amount // 10000000.0,)
    return '%dM' % (amount // 10000000.0,)
