def get_votes(obj):
 obj_type = apps.get_model('contenttypes', 'ContentType').objects.get_for_model(obj)
 try:
  return Votes.objects.get(content_type=obj_type, object_id=obj.id).count
 except Votes.DoesNotExist:
  return 0

def get_votes ( obj ) : obj_type = apps . get_model ( 'contenttypes' , 'ContentType' ) . objects . get_for_model ( obj ) try : return Votes . objects . get ( content_type = obj_type , object_id = obj . id ) . count except Votes . DoesNotExist : return 0
get the number of votes an object has .