def __cmp__(self, other):
    if isinstance(other, type(self)):
      return cmp(self.number, other.number)
    return NotImplemented
Generic code shared by get_form and get_formset.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/protorpc/protorpc/messages.py/Enum.__cmp__--crossover with--dataset/ETHPy150Open deschler/django-modeltranslation/modeltranslation/admin.py/TranslationBaseModelAdmin._get_form_or_formset